Add contest table and routes

This commit is contained in:
Esa Kataja
2025-05-15 17:58:52 +03:00
parent 9ecdc1b040
commit a0344903ec
4 changed files with 88 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
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"],
)