from datetime import datetime from typing import Literal from uuid import UUID from app.common.schemas import Page, RequestModel, ResponseModel class Cards(ResponseModel): g: int y: int r: int class CoachActivity(ResponseModel): id: UUID name: str coaches: str reviews: int class EarningsBar(ResponseModel): month: str amount_minor: int class Dashboard(ResponseModel): month: str currency: str | None = None earnings_minor: int | None = None paying_players: int | None = None per_player_minor: int | None = None active_players: int new_this_month: int improving_pct: int | None analyses_this_week: int avg_review_hours: float | None cards: Cards coaches: list[CoachActivity] pending_requests: int not_filmed_7d: int earnings_bars: list[EarningsBar] = [] unavailable_reason: str | None = None as_of: datetime class DashboardResponse(ResponseModel): dashboard: Dashboard class Payout(ResponseModel): id: UUID scheduled_for: str amount_minor: int | None status: Literal["scheduled", "paid", "failed", "cancelled"] paid_at: datetime | None class Earnings(ResponseModel): month: str currency: str | None = None month_minor: int | None = None players: int | None = None per_player_minor: int | None = None ytd_minor: int | None = None projected_minor: int | None = None as_of: datetime payouts: list[Payout] = [] next_cursor: str | None = None unavailable_reason: str | None = None class EarningsResponse(ResponseModel): earnings: Earnings class CorpKpis(ResponseModel): locations_live: int active_players: int analyses: int improving_pct: int | None class CorpLocation(ResponseModel): id: UUID name: str active_players: int improving_pct: int | None class CorpFix(ResponseModel): metric_id: str label: str mode: Literal["h", "p"] affected_pct: int | None class Corporate(ResponseModel): month: str as_of: datetime kpis: CorpKpis locations: list[CorpLocation] fixes: list[CorpFix] class CorporateResponse(ResponseModel): corporate: Corporate class ConsentItem(ResponseModel): player_id: UUID name: str group: str group_ids: list[UUID] note: str version: str | None accepted_at: datetime | None withdrawn_at: datetime | None help_improve_ai: bool class ConsentPage(Page[ConsentItem]): accepted: int ai_opt_in: int class ConsentExportRequest(RequestModel): format: Literal["csv"] = "csv" group_id: UUID | None = None class ExportOut(ResponseModel): id: UUID status: str url: str expires_at: datetime filename: str class ExportResponse(ResponseModel): export: ExportOut