# 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 .created_at import CreatedAt
from .dbaname import Dbaname
from .entrypointfield import Entrypointfield
from .external_paypoint_id import ExternalPaypointId
from .legalname import Legalname
from .order_id import OrderId
from .org_parent_name import OrgParentName
from .page_identifier import PageIdentifier
from .query_payment_data import QueryPaymentData
from .query_transaction_payor_data import QueryTransactionPayorData
from .replyby import Replyby
from .transaction_query_records import TransactionQueryRecords
from .transaction_time import TransactionTime


class QueryChargebacksResponseRecordsItem(UniversalBaseModel):
    account_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="AccountType")] = (
        pydantic.Field(default=None)
    )
    """
    Type of account.
    """

    case_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="CaseNumber")] = pydantic.Field(
        default=None
    )
    """
    Case number of the chargeback.
    """

    chargeback_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="ChargebackDate")
    ] = pydantic.Field(default=None)
    """
    Date of the chargeback.
    """

    created_at: typing_extensions.Annotated[typing.Optional[CreatedAt], FieldMetadata(alias="CreatedAt")] = None
    customer: typing_extensions.Annotated[
        typing.Optional[QueryTransactionPayorData], FieldMetadata(alias="Customer")
    ] = None
    external_paypoint_id: typing_extensions.Annotated[
        typing.Optional[ExternalPaypointId], FieldMetadata(alias="externalPaypointID")
    ] = None
    id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="Id")] = pydantic.Field(default=None)
    """
    Unique identifier of the record.
    """

    last_four: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="LastFour")] = pydantic.Field(
        default=None
    )
    """
    Last four digits of the account number.
    """

    method: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="Method")] = pydantic.Field(
        default=None
    )
    """
    Method of payment.
    """

    net_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="NetAmount")] = pydantic.Field(
        default=None
    )
    """
    Net amount after deductions.
    """

    order_id: typing_extensions.Annotated[typing.Optional[OrderId], FieldMetadata(alias="OrderId")] = None
    pageidentifier: typing.Optional[PageIdentifier] = None
    parent_org_name: typing_extensions.Annotated[
        typing.Optional[OrgParentName], FieldMetadata(alias="ParentOrgName")
    ] = None
    payment_data: typing_extensions.Annotated[typing.Optional[QueryPaymentData], FieldMetadata(alias="PaymentData")] = (
        pydantic.Field(default=None)
    )
    """
    Payment data associated with the transaction.
    """

    payment_trans_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="PaymentTransId")] = (
        pydantic.Field(default=None)
    )
    """
    Transaction ID for the payment.
    """

    paypoint_dbaname: typing_extensions.Annotated[typing.Optional[Dbaname], FieldMetadata(alias="PaypointDbaname")] = (
        pydantic.Field(default=None)
    )
    """
    The 'Doing Business As' (DBA) name of the paypoint.
    """

    paypoint_entryname: typing_extensions.Annotated[
        typing.Optional[Entrypointfield], FieldMetadata(alias="PaypointEntryname")
    ] = pydantic.Field(default=None)
    """
    Entryname for the paypoint.
    """

    paypoint_legalname: typing_extensions.Annotated[
        typing.Optional[Legalname], FieldMetadata(alias="PaypointLegalname")
    ] = pydantic.Field(default=None)
    """
    Legal name of the paypoint.
    """

    reason: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="Reason")] = pydantic.Field(
        default=None
    )
    """
    Description of the reason for chargeback.
    """

    reason_code: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ReasonCode")] = pydantic.Field(
        default=None
    )
    """
    Code representing the reason for chargeback.
    """

    reference_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ReferenceNumber")] = (
        pydantic.Field(default=None)
    )
    """
    Reference number for the transaction.
    """

    reply_by: typing_extensions.Annotated[typing.Optional[Replyby], FieldMetadata(alias="ReplyBy")] = None
    responses: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="Responses")] = pydantic.Field(
        default=None
    )
    """
    Responses related to the transaction.
    """

    schedule_reference: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="ScheduleReference")] = (
        pydantic.Field(default=None)
    )
    """
    Reference for any scheduled transactions.
    """

    status: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="Status")] = pydantic.Field(
        default=None
    )
    """
    Status of the transaction.
    """

    transaction: typing_extensions.Annotated[
        typing.Optional[TransactionQueryRecords], FieldMetadata(alias="Transaction")
    ] = None
    transaction_time: typing_extensions.Annotated[
        typing.Optional[TransactionTime], FieldMetadata(alias="TransactionTime")
    ] = None

    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
