# 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 .transfer_out_detail_bill_attachment import TransferOutDetailBillAttachment


class TransferOutDetailBill(UniversalBaseModel):
    """
    Bill information for an outbound transfer detail.
    """

    bill_id: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="billId"),
        pydantic.Field(alias="billId", description="Unique identifier for the bill."),
    ] = None
    lot_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="LotNumber"),
        pydantic.Field(alias="LotNumber", description="Lot number."),
    ] = None
    accounting_field_1: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="AccountingField1"),
        pydantic.Field(alias="AccountingField1", description="Accounting field 1."),
    ] = None
    accounting_field_2: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="AccountingField2"),
        pydantic.Field(alias="AccountingField2", description="Accounting field 2."),
    ] = None
    terms: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="Terms"), pydantic.Field(alias="Terms", description="Payment terms.")
    ] = None
    additional_data: typing_extensions.Annotated[
        typing.Optional[typing.Dict[str, typing.Any]],
        FieldMetadata(alias="AdditionalData"),
        pydantic.Field(alias="AdditionalData", description="Additional data for the bill."),
    ] = None
    attachments: typing.Optional[typing.List[TransferOutDetailBillAttachment]] = pydantic.Field(default=None)
    """
    Attachments for the bill.
    """

    invoice_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="invoiceNumber"),
        pydantic.Field(alias="invoiceNumber", description="Invoice number."),
    ] = None
    net_amount: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="netAmount"),
        pydantic.Field(alias="netAmount", description="Net amount of the bill."),
    ] = None
    invoice_date: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="invoiceDate"),
        pydantic.Field(alias="invoiceDate", description="Date of the invoice."),
    ] = None
    due_date: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="dueDate"),
        pydantic.Field(alias="dueDate", description="Due date for the bill."),
    ] = None
    comments: typing.Optional[str] = pydantic.Field(default=None)
    """
    Comments on the bill.
    """

    identifier: typing.Optional[str] = pydantic.Field(default=None)
    """
    Identifier for the bill.
    """

    discount: typing.Optional[float] = pydantic.Field(default=None)
    """
    Discount applied.
    """

    total_amount: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="totalAmount"),
        pydantic.Field(alias="totalAmount", description="Total amount of the bill."),
    ] = 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
