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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .ocr_attachment import OcrAttachment
from .ocr_bill_item import OcrBillItem
from .ocr_bill_item_additional_data import OcrBillItemAdditionalData
from .ocr_vendor import OcrVendor


class OcrResultData(UniversalBaseModel):
    bill_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="billNumber")] = None
    net_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="netAmount")] = None
    bill_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="billDate")] = None
    due_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="dueDate")] = None
    comments: typing.Optional[str] = None
    bill_items: typing_extensions.Annotated[
        typing.Optional[typing.List[OcrBillItem]], FieldMetadata(alias="billItems")
    ] = None
    mode: typing.Optional[int] = None
    accounting_field_1: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="accountingField1")] = (
        None
    )
    accounting_field_2: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="accountingField2")] = (
        None
    )
    additional_data: typing_extensions.Annotated[
        typing.Optional[OcrBillItemAdditionalData], FieldMetadata(alias="additionalData")
    ] = None
    vendor: typing.Optional[OcrVendor] = None
    end_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="endDate")] = None
    frequency: typing.Optional[str] = None
    terms: typing.Optional[str] = None
    status: typing.Optional[int] = None
    lot_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="lotNumber")] = None
    attachments: typing.Optional[typing.List[OcrAttachment]] = None

    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
