# 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 .accounting_field import AccountingField
from .additional_data_string import AdditionalDataString
from .attachments import Attachments
from .comments import Comments
from .datenullable import Datenullable
from .invoice_number import InvoiceNumber
from .net_amountstring import NetAmountstring
from .terms import Terms


class BillPayOutDataRequest(UniversalBaseModel):
    bill_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="billId")] = pydantic.Field(
        default=None
    )
    """
    Bill ID in Payabli.
    """

    comments: typing.Optional[Comments] = pydantic.Field(default=None)
    """
    Any comments about bill. **For managed payouts, this field has a limit of 100 characters**.
    """

    due_date: typing_extensions.Annotated[typing.Optional[Datenullable], FieldMetadata(alias="dueDate")] = (
        pydantic.Field(default=None)
    )
    """
    Bill due date in format YYYY-MM-DD or MM/DD/YYYY.
    """

    invoice_date: typing_extensions.Annotated[typing.Optional[Datenullable], FieldMetadata(alias="invoiceDate")] = (
        pydantic.Field(default=None)
    )
    """
    Bill date in format YYYY-MM-DD or MM/DD/YYYY.
    """

    invoice_number: typing_extensions.Annotated[
        typing.Optional[InvoiceNumber], FieldMetadata(alias="invoiceNumber")
    ] = pydantic.Field(default=None)
    """
    Custom number identifying the bill. Must be unique in paypoint. **Required** for new bill and when `billId` isn't provided.
    """

    net_amount: typing_extensions.Annotated[typing.Optional[NetAmountstring], FieldMetadata(alias="netAmount")] = (
        pydantic.Field(default=None)
    )
    """
    Net Amount owed in bill. Required when adding a bill.
    """

    discount: typing.Optional[str] = pydantic.Field(default=None)
    """
    Bill discount amount.
    """

    terms: typing.Optional[Terms] = pydantic.Field(default=None)
    """
    Description of payment terms.
    """

    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] = pydantic.Field(default=None)
    """
    Bill image attachment. Send the bill image as Base64-encoded string, or as a publicly accessible link. For full details on using this field with a payout authorization, see [the documentation](/developers/developer-guides/pay-out-manage-payouts).
    """

    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
