Add tickets & bookings to account page
Add TicketDTO, user_tickets/user_bookings to CalendarService protocol and SqlCalendarService implementation, plus nav links and panel templates for the auth account sub-pages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,20 @@ class CalendarDTO:
|
||||
description: str | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class TicketDTO:
|
||||
id: int
|
||||
code: str
|
||||
state: str
|
||||
entry_name: str
|
||||
entry_start_at: datetime
|
||||
entry_end_at: datetime | None = None
|
||||
ticket_type_name: str | None = None
|
||||
calendar_name: str | None = None
|
||||
created_at: datetime | None = None
|
||||
checked_in_at: datetime | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class CalendarEntryDTO:
|
||||
id: int
|
||||
|
||||
@@ -13,6 +13,7 @@ from .dtos import (
|
||||
PostDTO,
|
||||
CalendarDTO,
|
||||
CalendarEntryDTO,
|
||||
TicketDTO,
|
||||
MarketPlaceDTO,
|
||||
ProductDTO,
|
||||
CartItemDTO,
|
||||
@@ -69,6 +70,14 @@ class CalendarService(Protocol):
|
||||
self, session: AsyncSession, order_id: int,
|
||||
) -> list[CalendarEntryDTO]: ...
|
||||
|
||||
async def user_tickets(
|
||||
self, session: AsyncSession, *, user_id: int,
|
||||
) -> list[TicketDTO]: ...
|
||||
|
||||
async def user_bookings(
|
||||
self, session: AsyncSession, *, user_id: int,
|
||||
) -> list[CalendarEntryDTO]: ...
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class MarketService(Protocol):
|
||||
|
||||
Reference in New Issue
Block a user