# 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 ...types.ach_holder_type import AchHolderType
from ...types.ach_sec_code import AchSecCode
from ...types.batch_number import BatchNumber
from ...types.bill_data import BillData
from ...types.category import Category
from ...types.chargeback_id import ChargebackId
from ...types.created_at import CreatedAt
from ...types.dbaname import Dbaname
from ...types.deposit_date import DepositDate
from ...types.device import Device
from ...types.entrypage_id import EntrypageId
from ...types.entrypointfield import Entrypointfield
from ...types.expected_deposit_date import ExpectedDepositDate
from ...types.external_paypoint_id import ExternalPaypointId
from ...types.fee_amount import FeeAmount
from ...types.legalname import Legalname
from ...types.maskedaccount import Maskedaccount
from ...types.netamountnullable import Netamountnullable
from ...types.operation import Operation
from ...types.order_id import OrderId
from ...types.org_parent_name import OrgParentName
from ...types.orgid import Orgid
from ...types.payor_id import PayorId
from ...types.paypoint_id import PaypointId
from ...types.pending_fee_amount import PendingFeeAmount
from ...types.query_c_fee_transaction import QueryCFeeTransaction
from ...types.query_payment_data import QueryPaymentData
from ...types.query_response_data import QueryResponseData
from ...types.query_transaction_events import QueryTransactionEvents
from ...types.query_transaction_payor_data import QueryTransactionPayorData
from ...types.refund_id import RefundId
from ...types.retrieval_id import RetrievalId
from ...types.returned_id import ReturnedId
from ...types.source import Source
from ...types.split_funding import SplitFunding
from ...types.transaction_time import TransactionTime


class BatchDetailResponseRecord(UniversalBaseModel):
    id: typing_extensions.Annotated[int, FieldMetadata(alias="Id")]
    method: typing_extensions.Annotated[str, FieldMetadata(alias="Method")]
    wallet_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="WalletType")] = None
    settled_amount: typing_extensions.Annotated[float, FieldMetadata(alias="SettledAmount")]
    type: typing_extensions.Annotated[str, FieldMetadata(alias="Type")]
    batch_number: typing_extensions.Annotated[BatchNumber, FieldMetadata(alias="BatchNumber")]
    batch_amount: typing_extensions.Annotated[float, FieldMetadata(alias="BatchAmount")]
    payment_trans_id: typing_extensions.Annotated[str, FieldMetadata(alias="PaymentTransId")]
    payment_trans_status: typing_extensions.Annotated[int, FieldMetadata(alias="PaymentTransStatus")]
    schedule_reference: typing_extensions.Annotated[int, FieldMetadata(alias="ScheduleReference")]
    gateway_trans_id: typing_extensions.Annotated[str, FieldMetadata(alias="GatewayTransId")]
    order_id: typing_extensions.Annotated[OrderId, FieldMetadata(alias="OrderId")]
    trans_method: typing_extensions.Annotated[str, FieldMetadata(alias="TransMethod")]
    payment_data: typing_extensions.Annotated[typing.Optional[QueryPaymentData], FieldMetadata(alias="PaymentData")] = (
        None
    )
    net_amount: typing_extensions.Annotated[Netamountnullable, FieldMetadata(alias="NetAmount")]
    operation: typing_extensions.Annotated[Operation, FieldMetadata(alias="Operation")]
    category: typing_extensions.Annotated[Category, FieldMetadata(alias="Category")]
    source: typing_extensions.Annotated[typing.Optional[Source], FieldMetadata(alias="Source")] = None
    status: typing_extensions.Annotated[int, FieldMetadata(alias="Status")]
    transaction_time: typing_extensions.Annotated[TransactionTime, FieldMetadata(alias="TransactionTime")]
    customer: typing_extensions.Annotated[
        typing.Optional[QueryTransactionPayorData], FieldMetadata(alias="Customer")
    ] = None
    settlement_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="SettlementDate")]
    payment_settlement_status: typing_extensions.Annotated[int, FieldMetadata(alias="PaymentSettlementStatus")]
    batch_status: typing_extensions.Annotated[int, FieldMetadata(alias="BatchStatus")]
    deposit_date: typing_extensions.Annotated[DepositDate, FieldMetadata(alias="DepositDate")]
    expected_deposit_date: typing_extensions.Annotated[ExpectedDepositDate, FieldMetadata(alias="ExpectedDepositDate")]
    masked_account: typing_extensions.Annotated[Maskedaccount, FieldMetadata(alias="MaskedAccount")]
    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="CreatedAt")]
    paypoint_legalname: typing_extensions.Annotated[Legalname, FieldMetadata(alias="PaypointLegalname")]
    response_data: typing_extensions.Annotated[
        typing.Optional[QueryResponseData], FieldMetadata(alias="ResponseData")
    ] = None
    paypoint_dbaname: typing_extensions.Annotated[Dbaname, FieldMetadata(alias="PaypointDbaname")]
    parent_org_name: typing_extensions.Annotated[OrgParentName, FieldMetadata(alias="ParentOrgName")]
    parent_org_id: typing_extensions.Annotated[int, FieldMetadata(alias="ParentOrgId")]
    paypoint_entryname: typing_extensions.Annotated[Entrypointfield, FieldMetadata(alias="PaypointEntryname")]
    device_id: typing_extensions.Annotated[typing.Optional[Device], FieldMetadata(alias="DeviceId")] = None
    retrieval_id: typing_extensions.Annotated[RetrievalId, FieldMetadata(alias="RetrievalId")]
    chargeback_id: typing_extensions.Annotated[ChargebackId, FieldMetadata(alias="ChargebackId")]
    ach_holder_type: typing_extensions.Annotated[AchHolderType, FieldMetadata(alias="AchHolderType")]
    ach_sec_code: typing_extensions.Annotated[AchSecCode, FieldMetadata(alias="AchSecCode")]
    connector_name: typing_extensions.Annotated[str, FieldMetadata(alias="ConnectorName")]
    entrypage_id: typing_extensions.Annotated[EntrypageId, FieldMetadata(alias="EntrypageId")]
    fee_amount: typing_extensions.Annotated[FeeAmount, FieldMetadata(alias="FeeAmount")]
    org_id: typing_extensions.Annotated[Orgid, FieldMetadata(alias="OrgId")]
    payor_id: typing_extensions.Annotated[PayorId, FieldMetadata(alias="PayorId")]
    paypoint_id: typing_extensions.Annotated[PaypointId, FieldMetadata(alias="PaypointId")]
    pending_fee_amount: typing_extensions.Annotated[PendingFeeAmount, FieldMetadata(alias="PendingFeeAmount")]
    refund_id: typing_extensions.Annotated[RefundId, FieldMetadata(alias="RefundId")]
    returned_id: typing_extensions.Annotated[ReturnedId, FieldMetadata(alias="ReturnedId")]
    split_funding_instructions: typing_extensions.Annotated[
        SplitFunding, FieldMetadata(alias="splitFundingInstructions")
    ]
    total_amount: typing_extensions.Annotated[float, FieldMetadata(alias="TotalAmount")]
    cfee_transactions: typing_extensions.Annotated[
        typing.List[QueryCFeeTransaction], FieldMetadata(alias="CfeeTransactions")
    ]
    invoice_data: typing_extensions.Annotated[typing.Optional[BillData], FieldMetadata(alias="invoiceData")] = None
    transaction_events: typing_extensions.Annotated[
        typing.List[QueryTransactionEvents], FieldMetadata(alias="TransactionEvents")
    ]
    external_paypoint_id: typing_extensions.Annotated[ExternalPaypointId, FieldMetadata(alias="externalPaypointID")]
    is_hold: typing_extensions.Annotated[int, FieldMetadata(alias="isHold")]

    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
