# 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):
    """
    Examples
    --------
    import datetime

    from payabli import AssociatedVendor, CustomerData, VCardRecord

    VCardRecord(
        vcard_sent=True,
        card_token="vcrd_5Ty8NrBzXjKuqHm9DwElfP",
        card_number="44XX XXXX XXXX 1234",
        cvc="XXX",
        expiration_date="2025-12",
        status="Active",
        amount=500.0,
        current_balance=375.25,
        expense_limit=100.0,
        expense_limit_period="monthly",
        max_number_of_uses=10,
        current_number_of_uses=3,
        exact_amount=False,
        mcc="5812",
        tcc="T01",
        misc_1="Invoice #12345",
        misc_2="Project: Office Supplies",
        date_created=datetime.datetime.fromisoformat(
            "2023-01-15 09:30:00+00:00",
        ),
        date_modified=datetime.datetime.fromisoformat(
            "2023-02-20 14:15:22+00:00",
        ),
        associated_vendor=AssociatedVendor(
            vendor_number="V-12345",
            name_1="Office Supply Co.",
            ein="XXXXX6789",
            email="billing@officesupply.example.com",
            vendor_id=1542,
        ),
        associated_customer=CustomerData(
            firstname="Acme",
            lastname="Corporation",
        ),
        paypoint_dbaname="Global Factory LLC",
        paypoint_legalname="Global Factory LLC",
        paypoint_entryname="4872acb376a",
        external_paypoint_id="pay-10",
        parent_org_name="SupplyPro",
        paypoint_id=236,
    )
    """

    vcard_sent: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="vcardSent"),
        pydantic.Field(alias="vcardSent", description="When `true`, the vCard has been sent."),
    ] = None
    card_token: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="cardToken"), pydantic.Field(alias="cardToken")
    ] = None
    card_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="cardNumber"),
        pydantic.Field(alias="cardNumber", description="The vCard number."),
    ] = None
    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(
            alias="expirationDate",
            description="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.",
        ),
    ] = None
    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(alias="currentBalance", description="The vCard's current balance."),
    ] = None
    expense_limit: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="expenseLimit"), pydantic.Field(alias="expenseLimit")
    ] = None
    expense_limit_period: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="expenseLimitPeriod"), pydantic.Field(alias="expenseLimitPeriod")
    ] = None
    max_number_of_uses: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="maxNumberOfUses"), pydantic.Field(alias="maxNumberOfUses")
    ] = None
    current_number_of_uses: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="currentNumberOfUses"), pydantic.Field(alias="currentNumberOfUses")
    ] = None
    exact_amount: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="exactAmount"), pydantic.Field(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(alias="misc1", description="Custom field 1.")
    ] = None
    misc_2: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="misc2"), pydantic.Field(alias="misc2", description="Custom field 2.")
    ] = None
    date_created: typing_extensions.Annotated[
        typing.Optional[CreatedAt], FieldMetadata(alias="dateCreated"), pydantic.Field(alias="dateCreated")
    ] = None
    date_modified: typing_extensions.Annotated[
        typing.Optional[LastModified], FieldMetadata(alias="dateModified"), pydantic.Field(alias="dateModified")
    ] = None
    associated_vendor: typing_extensions.Annotated[
        typing.Optional[AssociatedVendor],
        FieldMetadata(alias="associatedVendor"),
        pydantic.Field(alias="associatedVendor"),
    ] = None
    associated_customer: typing_extensions.Annotated[
        typing.Optional[CustomerData],
        FieldMetadata(alias="associatedCustomer"),
        pydantic.Field(alias="associatedCustomer"),
    ] = None
    parent_org_name: typing_extensions.Annotated[
        typing.Optional[OrgParentName], FieldMetadata(alias="ParentOrgName"), pydantic.Field(alias="ParentOrgName")
    ] = None
    paypoint_dbaname: typing_extensions.Annotated[
        typing.Optional[Dbaname],
        FieldMetadata(alias="PaypointDbaname"),
        pydantic.Field(alias="PaypointDbaname", description="The paypoint's DBA name."),
    ] = None
    paypoint_legalname: typing_extensions.Annotated[
        typing.Optional[Legalname],
        FieldMetadata(alias="PaypointLegalname"),
        pydantic.Field(alias="PaypointLegalname", description="The paypoint's legal name."),
    ] = None
    paypoint_entryname: typing_extensions.Annotated[
        typing.Optional[Entrypointfield],
        FieldMetadata(alias="PaypointEntryname"),
        pydantic.Field(alias="PaypointEntryname", description="The paypoint's entry name (entrypoint)."),
    ] = None
    external_paypoint_id: typing_extensions.Annotated[
        typing.Optional[ExternalPaypointId],
        FieldMetadata(alias="externalPaypointID"),
        pydantic.Field(alias="externalPaypointID"),
    ] = None
    paypoint_id: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="paypointId"),
        pydantic.Field(alias="paypointId", description="The paypoint's unique identifier."),
    ] = 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
