PR #258 · pramaan-io/pramaan-functions · merged 2026-06-05
sequenceDiagram autonumber participant dto as DTO participant svc as Service participant oas as OpenAPI spec participant tst as Contract test dto->>dto: Define ForumView svc->>svc: _view mapper dto->>oas: make openapi oas->>tst: assert shape
| Method | in → out | what it does |
|---|---|---|
ForumView | (class) | timestamped response model with audit fields |
_view | (forum) → ForumView | maps a Forum entity into the wire-shape view |
src/domains/forum/service.py+11 −14Adds a private helper that maps a Forum entity into the new ForumView shape, keeping app-facing responses aligned with the DTO.
| new method | signature |
|---|---|
_view | (forum) → ForumView |
Replaces the old catalog-style DTO with a timestamped ForumView class carrying audit fields (archived_at, archived_by, created_by).
| new class | signature |
|---|---|
ForumView | (class) |
archived_at : datetime | Nonearchived_by_user_id : UUID | Nonecreated_by_user_id : UUID | None