# generated by datamodel-codegen:
#   filename:  core/price.json
#   timestamp: 2026-02-23T01:56:40+00:00

from __future__ import annotations

from enum import Enum
from typing import Annotated

from adcp.types.base import AdCPBaseModel
from pydantic import ConfigDict, Field


class Period(Enum):
    night = 'night'
    month = 'month'
    year = 'year'
    one_time = 'one_time'


class Price(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    amount: Annotated[
        float, Field(description='Monetary amount in the specified currency.', ge=0.0)
    ]
    currency: Annotated[
        str,
        Field(
            description="ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').", pattern='^[A-Z]{3}$'
        ),
    ]
    period: Annotated[
        Period | None,
        Field(
            description="Billing period. 'night' for hotel rates, 'month' or 'year' for salaries and rentals, 'one_time' for purchase prices. Omit when the period is obvious from context (e.g., a vehicle price is always one-time)."
        ),
    ] = None
