from pydantic import BaseModel
from typing import Optional
from schemas.base import UTCDatetime


class BusinessDayOut(BaseModel):
    id: int
    status: str
    opened_at: UTCDatetime
    opened_by_id: int
    closed_at: Optional[UTCDatetime] = None
    closed_by_id: Optional[int] = None
    notes: Optional[str] = None
    # Phase 2E
    store_opening_cash: Optional[float] = None
    store_closing_cash: Optional[float] = None
    store_cash_discrepancy: Optional[float] = None

    model_config = {"from_attributes": True}


class OpenBusinessDayRequest(BaseModel):
    notes: Optional[str] = None


class CloseBusinessDayRequest(BaseModel):
    force: bool = False
    notes: Optional[str] = None
    store_closing_cash: Optional[float] = None  # Phase 2E: physical cash counted at close
