# 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 .associated_vendor import AssociatedVendor
from .created_at import CreatedAt
from .customer_data import CustomerData
from .dbaname import Dbaname
from .entrypointfield import Entrypointfield
from .external_paypoint_id import ExternalPaypointId
from .last_modified import LastModified
from .legalname import Legalname
from .org_parent_name import OrgParentName


class VCardRecord(UniversalBaseModel):
    vcard_sent: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="vcardSent")] = pydantic.Field(
        default=None
    )
    """
    When `true`, the vCard has been sent.
    """

    card_token: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="cardToken")] = None
    card_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="cardNumber")] = pydantic.Field(
        default=None
    )
    """
    The vCard number.
    """

    cvc: typing.Optional[str] = pydantic.Field(default=None)
    """
    The vCard CVC number.
    """

    expiration_date: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="expirationDate")] = (
        pydantic.Field(default=None)
    )
    """
    Expiration date in format YYYY-MM-DD. The minimum time to expire is 3 months, maximum is 3 years. If not provided, the default is 6 months.
    """

    status: typing.Optional[str] = None
    amount: typing.Optional[float] = pydantic.Field(default=None)
    """
    The vCard amount.
    """

    current_balance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="currentBalance")] = (
        pydantic.Field(default=None)
    )
    """
    The vCard's current balance.
    """

    expense_limit: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="expenseLimit")] = None
    expense_limit_period: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="expenseLimitPeriod")
    ] = None
    max_number_of_uses: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="maxNumberOfUses")] = None
    current_number_of_uses: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="currentNumberOfUses")
    ] = None
    exact_amount: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="exactAmount")] = None
    mcc: typing.Optional[str] = pydantic.Field(default=None)
    """
    MCC assigned to vCard.
    """

    tcc: typing.Optional[str] = pydantic.Field(default=None)
    """
    TCC assigned to vCard.
    """

    misc_1: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="misc1")] = pydantic.Field(
        default=None
    )
    """
    Custom field 1.
    """

    misc_2: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="misc2")] = pydantic.Field(
        default=None
    )
    """
    Custom field 2.
    """

    date_created: typing_extensions.Annotated[typing.Optional[CreatedAt], FieldMetadata(alias="dateCreated")] = None
    date_modified: typing_extensions.Annotated[typing.Optional[LastModified], FieldMetadata(alias="dateModified")] = (
        None
    )
    associated_vendor: typing_extensions.Annotated[
        typing.Optional[AssociatedVendor], FieldMetadata(alias="associatedVendor")
    ] = None
    associated_customer: typing_extensions.Annotated[
        typing.Optional[CustomerData], FieldMetadata(alias="associatedCustomer")
    ] = None
    parent_org_name: typing_extensions.Annotated[
        typing.Optional[OrgParentName], FieldMetadata(alias="ParentOrgName")
    ] = None
    paypoint_dbaname: typing_extensions.Annotated[typing.Optional[Dbaname], FieldMetadata(alias="PaypointDbaname")] = (
        pydantic.Field(default=None)
    )
    """
    The paypoint's DBA name.
    """

    paypoint_legalname: typing_extensions.Annotated[
        typing.Optional[Legalname], FieldMetadata(alias="PaypointLegalname")
    ] = pydantic.Field(default=None)
    """
    The paypoint's legal name.
    """

    paypoint_entryname: typing_extensions.Annotated[
        typing.Optional[Entrypointfield], FieldMetadata(alias="PaypointEntryname")
    ] = pydantic.Field(default=None)
    """
    The paypoint's entry name (entrypoint).
    """

    external_paypoint_id: typing_extensions.Annotated[
        typing.Optional[ExternalPaypointId], FieldMetadata(alias="externalPaypointID")
    ] = 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
