# 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 .transaction_query_records import TransactionQueryRecords


class CustomerSummaryRecord(UniversalBaseModel):
    numberof_transactions: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="numberofTransactions"),
        pydantic.Field(alias="numberofTransactions", description="Number total of transactions or payments"),
    ] = None
    recent_transactions: typing_extensions.Annotated[
        typing.Optional[typing.List[TransactionQueryRecords]],
        FieldMetadata(alias="recentTransactions"),
        pydantic.Field(
            alias="recentTransactions", description="List of more recent 5 transactions belonging to the customer"
        ),
    ] = None
    total_amount_transactions: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="totalAmountTransactions"),
        pydantic.Field(alias="totalAmountTransactions", description="Total amount in transactions"),
    ] = None
    total_net_amount_transactions: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="totalNetAmountTransactions"),
        pydantic.Field(alias="totalNetAmountTransactions", description="Total net amount in transactions"),
    ] = 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
