"""Pydantic response schemas for GET /api/v1/dashboard (INDL-40)."""
from __future__ import annotations

from datetime import date
from typing import List, Literal

from pydantic import BaseModel

DeltaDirection = Literal["up", "down", "neutral"]


class KpiBlock(BaseModel):
    key: str
    label: str
    value: float
    delta: str
    delta_direction: DeltaDirection
    link: str


class ServiceEventBlock(BaseModel):
    id: str
    time: str
    type: str
    name: str
    service_detail_url: str


class WeeklyServiceDay(BaseModel):
    date: date
    day_label: str
    day_number: int
    is_past: bool
    services: List[ServiceEventBlock]


class SectionCapacity(BaseModel):
    name: str
    fill_pct: int


class CapacityBreakdown(BaseModel):
    total: int
    interred: int
    reserved: int
    available: int
    interred_pct: int
    sections: List[SectionCapacity]


class DashboardResponse(BaseModel):
    public_site_url: str
    kpis: List[KpiBlock]
    weekly_services: List[WeeklyServiceDay]
    capacity: CapacityBreakdown
