Files
mtusi2026lab5/src/messenger/attachments/entrypoints/schemas.py
T
ArtyomandClaude Opus 5.5 540fcb35ba Carry over the lab 4 solution
Bring the application, own tests, Dockerfile, toolchain, compose stack,
HAProxy, k6 and RustFS configuration, migrations, hooks, evidence and
scenario scripts and the CI job from the lab 4 solution commit d2744bc,
merge the lab 4 Makefile targets into the lab 5 skeleton Makefile
without touching its targets, and append the lab 4 solution variables
to the skeleton .env.example. The package and the application follow
the contract version 1.5.0, and the image and the throwaway test
containers are tagged lab5 so they do not collide with a lab 4 stand on
the same host.

This is the starting point of the lab 5 cycle: lint, own tests and the
offline skeleton check pass before any lab 5 change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 00:34:03 +03:00

37 lines
969 B
Python

from datetime import datetime
from typing import Literal
from uuid import UUID
from pydantic import BaseModel
from messenger.attachments.domain.models import Attachment
class AttachmentOut(BaseModel):
id: UUID
chat_id: UUID
owner_id: UUID
filename: str
content_type: str
size_bytes: int
sha256: str
status: Literal["ready"] = "ready"
variants: tuple[()] = ()
error_code: None = None
created_at: datetime
updated_at: datetime
@classmethod
def of(cls, attachment: Attachment) -> AttachmentOut:
return cls(
id=attachment.id,
chat_id=attachment.chat_id,
owner_id=attachment.owner_id,
filename=attachment.filename.value,
content_type=attachment.content_type,
size_bytes=attachment.size_bytes,
sha256=attachment.sha256,
created_at=attachment.created_at,
updated_at=attachment.updated_at,
)