Backend overhaul: new models, routers, schemas for shifts, business day, flags, messages, settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 12:12:05 +03:00
parent 603fd45eaa
commit defc49f84f
31 changed files with 2626 additions and 55 deletions

View File

@@ -0,0 +1,14 @@
from datetime import datetime
from typing import Annotated
from pydantic import PlainSerializer
# SQLite strips tzinfo on read-back, so naive datetimes from DB are actually UTC.
# This serializer appends "Z" so browsers parse them correctly as UTC.
UTCDatetime = Annotated[
datetime,
PlainSerializer(
lambda dt: (dt.isoformat() + "Z") if dt.tzinfo is None else dt.isoformat(),
return_type=str,
when_used="json",
),
]