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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .transfer_out_bank_account import TransferOutBankAccount
from .transfer_out_event_data import TransferOutEventData
from .transfer_out_message import TransferOutMessage


class TransferOutRecord(UniversalBaseModel):
    """
    A record representing an outbound transfer.
    """

    transfer_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="transferId")] = pydantic.Field(
        default=None
    )
    """
    Unique identifier for the transfer.
    """

    paypoint_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="paypointId")] = pydantic.Field(
        default=None
    )
    """
    The ID of the paypoint associated with the transfer.
    """

    batch_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="batchNumber")] = (
        pydantic.Field(default=None)
    )
    """
    The batch number for the transfer.
    """

    batch_currency: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="batchCurrency")] = (
        pydantic.Field(default=None)
    )
    """
    The currency of the batch.
    """

    batch_records: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="batchRecords")] = (
        pydantic.Field(default=None)
    )
    """
    The number of records in the batch.
    """

    transfer_identifier: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="transferIdentifier")
    ] = pydantic.Field(default=None)
    """
    An identifier for the transfer.
    """

    batch_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="batchId")] = pydantic.Field(
        default=None
    )
    """
    The ID of the batch.
    """

    batch_net_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="batchNetAmount")] = (
        pydantic.Field(default=None)
    )
    """
    The net amount of the batch.
    """

    batch_status: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="batchStatus")] = (
        pydantic.Field(default=None)
    )
    """
    The status of the batch.
    """

    paypoint_entry_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="paypointEntryName")] = (
        pydantic.Field(default=None)
    )
    """
    The entry name for the paypoint.
    """

    paypoint_legal_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="paypointLegalName")] = (
        pydantic.Field(default=None)
    )
    """
    The legal name of the paypoint.
    """

    paypoint_dba_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="paypointDbaName")] = (
        pydantic.Field(default=None)
    )
    """
    The DBA name of the paypoint.
    """

    paypoint_logo: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="paypointLogo")] = (
        pydantic.Field(default=None)
    )
    """
    URL to the paypoint's logo.
    """

    parent_org_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="parentOrgName")] = (
        pydantic.Field(default=None)
    )
    """
    The name of the parent organization.
    """

    parent_org_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="parentOrgId")] = (
        pydantic.Field(default=None)
    )
    """
    The ID of the parent organization.
    """

    parent_org_logo: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="parentOrgLogo")] = (
        pydantic.Field(default=None)
    )
    """
    URL to the parent organization's logo.
    """

    parent_org_entry_name: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="parentOrgEntryName")
    ] = pydantic.Field(default=None)
    """
    The entry name for the parent organization.
    """

    external_paypoint_id: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="externalPaypointID")
    ] = pydantic.Field(default=None)
    """
    External identifier for the paypoint.
    """

    bank_account: typing_extensions.Annotated[
        typing.Optional[TransferOutBankAccount], FieldMetadata(alias="bankAccount")
    ] = pydantic.Field(default=None)
    """
    Bank account information for the transfer.
    """

    transfer_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="transferDate")] = (
        pydantic.Field(default=None)
    )
    """
    The date of the transfer.
    """

    processor: typing.Optional[str] = pydantic.Field(default=None)
    """
    The processor used for the transfer.
    """

    transfer_status: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="transferStatus")] = (
        pydantic.Field(default=None)
    )
    """
    The status of the transfer.
    """

    gross_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="grossAmount")] = (
        pydantic.Field(default=None)
    )
    """
    The gross amount of the transfer.
    """

    charge_back_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="chargeBackAmount")] = (
        pydantic.Field(default=None)
    )
    """
    The chargeback amount deducted from the transfer.
    """

    returned_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="returnedAmount")] = (
        pydantic.Field(default=None)
    )
    """
    The returned amount deducted from the transfer.
    """

    hold_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="holdAmount")] = (
        pydantic.Field(default=None)
    )
    """
    The amount being held.
    """

    released_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="releasedAmount")] = (
        pydantic.Field(default=None)
    )
    """
    The amount that has been released.
    """

    billing_fees_amount: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="billingFeesAmount")
    ] = pydantic.Field(default=None)
    """
    The billing fees amount.
    """

    third_party_paid_amount: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="thirdPartyPaidAmount")
    ] = pydantic.Field(default=None)
    """
    The third party paid amount.
    """

    adjustments_amount: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="adjustmentsAmount")
    ] = pydantic.Field(default=None)
    """
    The adjustments amount.
    """

    net_transfer_amount: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="netTransferAmount")
    ] = pydantic.Field(default=None)
    """
    The net transfer amount after all deductions.
    """

    split_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="splitAmount")] = (
        pydantic.Field(default=None)
    )
    """
    The split funding amount.
    """

    events_data: typing_extensions.Annotated[
        typing.Optional[typing.List[TransferOutEventData]], FieldMetadata(alias="eventsData")
    ] = pydantic.Field(default=None)
    """
    List of events associated with the transfer.
    """

    messages: typing.Optional[typing.List[TransferOutMessage]] = pydantic.Field(default=None)
    """
    List of messages associated with the transfer.
    """

    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
