Files
mtusi2026lab2/src/messenger/attachments/domain/events.py
T
Artyom 12db77133f Forward the lab 5 foundation while preserving lab 6 telemetry
Source: immutable lab5 snapshot f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071; forward the allowed diff from 64d5c67. Carry SQLAlchemy, Alembic, reliability fixes, versioned jobs, infrastructure and student tests without changing protected coursework files.

Validation: make check, validate, lint; 515 student tests passed with one Linux-only skip; public smoke with telemetry enabled and repeat migration passed. Stop the owned stack and retain volumes. Preserve the existing OTel work in progress; grade implementation remains a separate phase.
2026-11-06 12:29:35 +03:00

51 lines
1.3 KiB
Python

from dataclasses import dataclass, field
from uuid import UUID
from messenger.shared.domain.events import DomainEvent
@dataclass(frozen=True, slots=True)
class AttachmentQueued(DomainEvent):
attachment_id: UUID
chat_id: UUID
owner_id: UUID
size_bytes: int
name: str = field(init=False, default="attachment.queued")
@dataclass(frozen=True, slots=True)
class AttachmentDiscarded(DomainEvent):
attachment_id: UUID
chat_id: UUID
reason: str
name: str = field(init=False, default="attachment.discarded")
@dataclass(frozen=True, slots=True)
class JobSettled(DomainEvent):
job_id: UUID
attachment_id: UUID
pipeline_version: int
attempt: int
outcome: str
error_code: str | None = None
delay_seconds: float | None = None
name: str = field(init=False, default="job.settled")
@dataclass(frozen=True, slots=True)
class AttachmentReprocessRequested(DomainEvent):
attachment_id: UUID
pipeline_version: int
operator: str
result: str
name: str = field(init=False, default="attachment.reprocess_requested")
@dataclass(frozen=True, slots=True)
class AttachmentReplayRequested(DomainEvent):
attachment_id: UUID
operator: str
result: str
name: str = field(init=False, default="attachment.replay_requested")