# 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


class PayoutPaymentDetail(UniversalBaseModel):
    """
    Payment details for payout subscriptions.
    """

    total_amount: typing_extensions.Annotated[
        float,
        FieldMetadata(alias="totalAmount"),
        pydantic.Field(
            alias="totalAmount",
            description="Total payout amount. If a service fee is included, this amount should include the service fee.",
        ),
    ]
    service_fee: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="serviceFee"),
        pydantic.Field(
            alias="serviceFee",
            description="Service fee to be deducted from the total amount. This amount must be a number, percentages aren't accepted.",
        ),
    ] = None
    currency: typing.Optional[str] = pydantic.Field(default=None)
    """
    Currency code ISO-4217. If no code is provided, the currency in the paypoint setting is used. Default is `USD`.
    """

    check_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="checkNumber"),
        pydantic.Field(
            alias="checkNumber",
            description="A check number for the payout. Required when the payment method is `check`.",
        ),
    ] = None
    order_description: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="orderDescription"),
        pydantic.Field(alias="orderDescription", description="Description of the payout order."),
    ] = None
    order_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="orderId"),
        pydantic.Field(alias="orderId", description="Order identifier associated with the payout."),
    ] = None
    order_id_alternative: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="orderIdAlternative"),
        pydantic.Field(alias="orderIdAlternative", description="Alternative order identifier."),
    ] = None
    payment_description: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="paymentDescription"),
        pydantic.Field(alias="paymentDescription", description="Description of the payment."),
    ] = None
    settlement_descriptor: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="settlementDescriptor"),
        pydantic.Field(alias="settlementDescriptor", description="Settlement descriptor for the payout."),
    ] = None
    group_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="groupNumber"),
        pydantic.Field(alias="groupNumber", description="Group number for the payout."),
    ] = None
    source: typing.Optional[str] = pydantic.Field(default=None)
    """
    Source identifier for the payout.
    """

    payabli_trans_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="payabliTransId"),
        pydantic.Field(alias="payabliTransId", description="Payabli transaction identifier."),
    ] = None
    unbundled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When `true`, each bill is processed as a separate payout. When `false` or not provided, multiple bills are paid with a single payout.
    """

    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
