Source code for sidequest_common.schemas.weekly_board

 1"""Schemas for the bot's weekly board: the week's events and the Discord card it posts for each one."""
 2
 3from datetime import datetime
 4from uuid import UUID
 5
 6from pydantic import BaseModel, ConfigDict, Field
 7
 8from sidequest_common.schemas.events import EventKind, SignupRole, SignupStatus, WowClass
 9
10
[docs] 11class BoardSignup(BaseModel): 12 """One member's sign-up as an event's weekly-board card lists it, in sign-up order. 13 14 ``discord_id`` is the member to @-mention; ``class``/``role`` are only set for role kinds (raid, dungeon). 15 """ 16 17 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True) 18 19 status: SignupStatus 20 discord_id: int 21 wow_class: WowClass | None = Field(default=None, alias="class") 22 role: SignupRole | None = None
23 24
[docs] 25class WeeklyBoardEvent(BaseModel): 26 """One scheduled event for the weekly board post, with what its card shows.""" 27 28 model_config = ConfigDict(from_attributes=True) 29 30 id: UUID 31 kind: EventKind 32 title: str 33 starts_at: datetime 34 discord_thread_id: int | None 35 location: str = "" 36 notes: str | None = None 37 signups: list[BoardSignup] = Field(default_factory=list, description="Every sign-up, in sign-up order.")
38 39
[docs] 40class WeeklyBoardMessage(BaseModel): 41 """``PUT /api/guilds/{guild_id}/weekly-board/events/{event_id}/message``: the card the bot posted for an event. 42 43 From then on the event-sync push carries this message and the event's sign-ups, so the bot keeps the card's 44 Going/Maybe/Can't lists current. 45 """ 46 47 channel_id: int 48 message_id: int