# 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 .bill_id import BillId
from .comments import Comments
from .datenullable import Datenullable
from .invoice_number import InvoiceNumber
from .net_amountstring import NetAmountstring


class BillDetailsResponse(UniversalBaseModel):
    """
    Response object for bill details. Contains basic information about a bill.
    """

    bill_id: typing_extensions.Annotated[
        typing.Optional[BillId], FieldMetadata(alias="billId"), pydantic.Field(alias="billId")
    ] = None
    lot_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="lotNumber"),
        pydantic.Field(alias="lotNumber", description="Lot number of the bill."),
    ] = None
    invoice_number: typing_extensions.Annotated[
        typing.Optional[InvoiceNumber],
        FieldMetadata(alias="invoiceNumber"),
        pydantic.Field(alias="invoiceNumber", description="Custom number identifying the bill."),
    ] = None
    net_amount: typing_extensions.Annotated[
        typing.Optional[NetAmountstring],
        FieldMetadata(alias="netAmount"),
        pydantic.Field(alias="netAmount", description="Net Amount owed in bill. Required when adding a bill."),
    ] = None
    discount: typing.Optional[str] = pydantic.Field(default=None)
    """
    Bill discount amount.
    """

    due_date: typing_extensions.Annotated[
        typing.Optional[Datenullable],
        FieldMetadata(alias="dueDate"),
        pydantic.Field(alias="dueDate", description="Bill due date in format YYYY-MM-DD or MM/DD/YYYY."),
    ] = None
    invoice_date: typing_extensions.Annotated[
        typing.Optional[Datenullable],
        FieldMetadata(alias="invoiceDate"),
        pydantic.Field(alias="invoiceDate", description="Bill date in format YYYY-MM-DD or MM/DD/YYYY."),
    ] = None
    comments: typing.Optional[Comments] = pydantic.Field(default=None)
    """
    Any comments about bill. **For managed payouts, this field has a limit of 100 characters**.
    """

    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
