from decimal import Decimal

from pydantic import BaseModel


class StageMetric(BaseModel):
    stage_id: int
    stage_name: str
    position: int
    count: int
    value: Decimal


class CrmMetricsResponse(BaseModel):
    total_accounts: int
    total_contacts: int
    total_leads: int
    open_leads: int
    open_opportunities: int
    open_pipeline_value: Decimal
    won_opportunities: int
    won_value: Decimal
    pending_activities: int
    by_stage: list[StageMetric]
