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

import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from ...types.accounting_field import AccountingField
from ...types.additional_data_string import AdditionalDataString
from ...types.attachments import Attachments
from ...types.bill_id import BillId
from ...types.comments import Comments
from ...types.datenullable import Datenullable
from ...types.discount import Discount
from ...types.invoice_number import InvoiceNumber
from ...types.net_amountstring import NetAmountstring
from ...types.terms import Terms
from .lot_number import LotNumber


class RequestOutAuthorizeInvoiceData(UniversalBaseModel):
    invoice_number: typing_extensions.Annotated[
        typing.Optional[InvoiceNumber], FieldMetadata(alias="invoiceNumber")
    ] = None
    net_amount: typing_extensions.Annotated[typing.Optional[NetAmountstring], FieldMetadata(alias="netAmount")] = None
    invoice_date: typing_extensions.Annotated[typing.Optional[Datenullable], FieldMetadata(alias="invoiceDate")] = (
        pydantic.Field(default=None)
    )
    """
    Invoice date in any of the accepted formats: YYYY-MM-DD, MM/DD/YYYY.
    """

    due_date: typing_extensions.Annotated[typing.Optional[Datenullable], FieldMetadata(alias="dueDate")] = (
        pydantic.Field(default=None)
    )
    """
    Invoice due date in any of the accepted formats: YYYY-MM-DD, MM/DD/YYYY.
    """

    comments: typing.Optional[Comments] = None
    lot_number: typing_extensions.Annotated[typing.Optional[LotNumber], FieldMetadata(alias="lotNumber")] = None
    bill_id: typing_extensions.Annotated[typing.Optional[BillId], FieldMetadata(alias="billId")] = None
    discount: typing.Optional[Discount] = None
    terms: typing.Optional[Terms] = None
    accounting_field_1: typing_extensions.Annotated[
        typing.Optional[AccountingField], FieldMetadata(alias="accountingField1")
    ] = None
    accounting_field_2: typing_extensions.Annotated[
        typing.Optional[AccountingField], FieldMetadata(alias="accountingField2")
    ] = None
    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalDataString], FieldMetadata(alias="additionalData")
    ] = None
    attachments: typing.Optional[Attachments] = 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
