Add contest table and routes
This commit is contained in:
@@ -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"],
|
||||
)
|
||||
Reference in New Issue
Block a user