Skip to content

Pydantic Schemas — Public Output DTOs #10

@calebyhan

Description

@calebyhan

Motivation

The API needs a typed contract between backend and frontend. Output DTOs define exactly what the frontend receives and ensure consistent serialization from SQLAlchemy models.

Deliverables

  • Create SenatorDTO with nested CommitteeAssignmentDTO list
  • Create CommitteeAssignmentDTO (committee_id, committee_name, role)
  • Create CommitteeDTO with nested SenatorDTO member list
  • Create LeadershipDTO (id, title, first_name, last_name, email, photo_url, session_number, is_current)
  • Create NewsDTO (id, title, summary, body, image_url, author_name, date_published, date_last_edited)
  • Create LegislationDTO with nested LegislationActionDTO list
  • Create LegislationActionDTO (id, action_date, description, action_type)
  • Create CalendarEventDTO (id, title, description, start_datetime, end_datetime, location, event_type)
  • Create CarouselSlideDTO (id, image_url, overlay_text, link_url, display_order, is_active)
  • Create FinanceHearingConfigDTO with nested FinanceHearingDateDTO list
  • Create FinanceHearingDateDTO (id, hearing_date, hearing_time, location, description, is_full)
  • Create StaffDTO (id, first_name, last_name, title, email, photo_url)
  • Create DistrictDTO with optional nested senator list
  • Create BudgetDataDTO with recursive children: List[BudgetDataDTO]
  • Create StaticPageDTO (id, page_slug, title, body, updated_at)
  • Create AccountDTO (id, email, pid, first_name, last_name, role)
  • Write tests that instantiate each DTO from mock model data and verify serialization

Important Notes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions