from typing import Literal, List

from pydantic import BaseModel, Field, ConfigDict
from pydantic.alias_generators import to_camel

from persona_models.common import create_uuid

UsageType = Literal["seconds", "tokens", "characters", "pages", "calls"]


class Usage(BaseModel):
    source: str
    type: UsageType
    value: float = 0

    model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)


class UsageCost(BaseModel):
    service: str
    value: float
    cost: float
    price: float
    credits: float
    unit: UsageType


class ServicePrice(BaseModel):
    id: str = Field(default_factory=create_uuid)
    service: str
    cost: float
    unit: UsageType
    markup_percentage: float
    fixed_price: float = 0

    model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
