26 lines
817 B
Python
26 lines
817 B
Python
from pydantic import BaseModel, Field
|
|
from datetime import date, datetime
|
|
|
|
|
|
class Contest(BaseModel):
|
|
id: int
|
|
year: int = Field(
|
|
default_factory=lambda: datetime.now().year,
|
|
description="The year of the contest",
|
|
examples=[2025],
|
|
)
|
|
is_active: bool = Field(
|
|
default=True, description="Is this the active contest?", examples=[True, False]
|
|
)
|
|
finals_date: date = Field(
|
|
description="The date of the finals", examples=["2025-05-15"]
|
|
)
|
|
created_at: datetime = Field(
|
|
description="The date and time when the contest was created",
|
|
examples=["2025-05-15T17:40:42.000Z"],
|
|
)
|
|
updated_at: datetime = Field(
|
|
description="The date and time when the contest was last updated",
|
|
examples=["2025-05-15T17:40:42.000Z"],
|
|
)
|