# This file was auto-generated by Fern from our API Definition.

from ......core.pydantic_utilities import UniversalBaseModel
from .....commons.types.charge_capture_id import ChargeCaptureId
from .charge_capture_status import ChargeCaptureStatus
from .charge_capture_data import ChargeCaptureData
from .....commons.types.patient_external_id import PatientExternalId
import typing
import datetime as dt
import pydantic
from ......core.pydantic_utilities import IS_PYDANTIC_V2


class ChargeCapture(UniversalBaseModel):
    id: ChargeCaptureId
    status: ChargeCaptureStatus
    charge_capture_data: ChargeCaptureData
    patient_external_id: PatientExternalId
    charge_external_id: str
    ehr_source_url: typing.Optional[str] = None
    date_of_service: typing.Optional[dt.date] = pydantic.Field(default=None)
    """
    Date formatted as YYYY-MM-DD; eg: 2019-08-24.
    This date must be the local date in the timezone where the service occurred.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
