"""Metric schemas."""

from datetime import datetime
from decimal import Decimal
from typing import Optional, Dict, Any, List
from uuid import UUID
from pydantic import BaseModel, ConfigDict


class MetricSummary(BaseModel):
    """Summary metrics for a scenario."""

    total_requests: int
    total_cost_usd: Decimal
    sqs_blocks: int
    lambda_invocations: int
    llm_tokens: int
    pii_violations: int


class CostBreakdown(BaseModel):
    """Cost breakdown by service."""

    service: str
    cost_usd: Decimal
    percentage: float


class TimeseriesPoint(BaseModel):
    """Single point in a timeseries."""

    timestamp: datetime
    metric_type: str
    value: Decimal


class MetricsResponse(BaseModel):
    """Complete metrics response for a scenario."""

    scenario_id: UUID
    summary: MetricSummary
    cost_breakdown: List[CostBreakdown]
    timeseries: List[TimeseriesPoint]
