# 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 .annualrevenue import Annualrevenue
from .application_data_odp_contacts_item import ApplicationDataOdpContactsItem
from .application_data_odp_ownership_item import ApplicationDataOdpOwnershipItem
from .attachments import Attachments
from .baddress_1 import Baddress1
from .baddress_2 import Baddress2
from .bank_data import BankData
from .bcity import Bcity
from .bcountry import Bcountry
from .boarding_business_fax import BoardingBusinessFax
from .boarding_business_phone import BoardingBusinessPhone
from .bstate import Bstate
from .bsummary import Bsummary
from .busstartdate import Busstartdate
from .bzip import Bzip
from .dbaname import Dbaname
from .ein import Ein
from .email import Email
from .highticketamt import Highticketamt
from .legalname import Legalname
from .license import License
from .licensestate import Licensestate
from .maddress import Maddress
from .maddress_1 import Maddress1
from .mcc import Mcc
from .mcity import Mcity
from .mcountry import Mcountry
from .mstate import Mstate
from .mzip import Mzip
from .orgid import Orgid
from .own_type import OwnType
from .payout_average_monthly_volume import PayoutAverageMonthlyVolume
from .payout_average_ticket_limit import PayoutAverageTicketLimit
from .payout_credit_limit import PayoutCreditLimit
from .payout_high_ticket_amount import PayoutHighTicketAmount
from .recipient_email_notification import RecipientEmailNotification
from .rep_code import RepCode
from .rep_name import RepName
from .rep_office import RepOffice
from .resumable import Resumable
from .services import Services
from .signer_data_request import SignerDataRequest
from .taxfillname import Taxfillname
from .template_id import TemplateId
from .website import Website


class ApplicationDataOdp(UniversalBaseModel):
    services: typing.Optional[Services] = None
    annual_revenue: typing_extensions.Annotated[
        typing.Optional[Annualrevenue], FieldMetadata(alias="annualRevenue")
    ] = pydantic.Field(default=None)
    """
    Annual revenue amount. We recommend including this value.
    """

    attachments: typing.Optional[Attachments] = None
    baddress: typing.Optional[Baddress1] = None
    baddress_1: typing_extensions.Annotated[typing.Optional[Baddress2], FieldMetadata(alias="baddress1")] = None
    bank_data: typing_extensions.Annotated[typing.Optional[BankData], FieldMetadata(alias="bankData")] = None
    bcity: typing.Optional[Bcity] = None
    bcountry: typing.Optional[Bcountry] = None
    boarding_link_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="boardingLinkId")] = (
        pydantic.Field(default=None)
    )
    """
    Boarding link ID for the application. Either `templateId` or `boardingLinkId` are required.
    """

    bstate: typing.Optional[Bstate] = None
    bsummary: typing.Optional[Bsummary] = None
    btype: typing.Optional[OwnType] = None
    bzip: typing.Optional[Bzip] = None
    contacts: typing.Optional[typing.List[ApplicationDataOdpContactsItem]] = pydantic.Field(default=None)
    """
    List of contacts for the business.
    """

    dbaname: typing.Optional[Dbaname] = None
    ein: typing.Optional[Ein] = None
    faxnumber: typing.Optional[BoardingBusinessFax] = None
    highticketamt: typing.Optional[Highticketamt] = None
    legalname: typing.Optional[Legalname] = None
    license: typing.Optional[License] = None
    licstate: typing.Optional[Licensestate] = None
    maddress: typing.Optional[Maddress] = None
    maddress_1: typing_extensions.Annotated[typing.Optional[Maddress1], FieldMetadata(alias="maddress1")] = None
    mcc: typing.Optional[Mcc] = None
    mcity: typing.Optional[Mcity] = None
    mcountry: typing.Optional[Mcountry] = None
    mstate: typing.Optional[Mstate] = None
    mzip: typing.Optional[Mzip] = None
    org_id: typing_extensions.Annotated[typing.Optional[Orgid], FieldMetadata(alias="orgId")] = None
    ownership: typing.Optional[typing.List[ApplicationDataOdpOwnershipItem]] = pydantic.Field(default=None)
    """
    List of Owners with at least a 25% ownership.
    """

    payout_average_monthly_volume: typing_extensions.Annotated[
        PayoutAverageMonthlyVolume, FieldMetadata(alias="payoutAverageMonthlyVolume")
    ]
    payout_average_ticket_amount: typing_extensions.Annotated[
        PayoutAverageTicketLimit, FieldMetadata(alias="payoutAverageTicketAmount")
    ]
    payout_credit_limit: typing_extensions.Annotated[PayoutCreditLimit, FieldMetadata(alias="payoutCreditLimit")]
    payout_high_ticket_amount: typing_extensions.Annotated[
        PayoutHighTicketAmount, FieldMetadata(alias="payoutHighTicketAmount")
    ]
    phonenumber: typing.Optional[BoardingBusinessPhone] = None
    recipient_email: typing_extensions.Annotated[typing.Optional[Email], FieldMetadata(alias="recipientEmail")] = (
        pydantic.Field(default=None)
    )
    """
    Email address for the applicant. This is used to send the applicant a boarding link.
    """

    recipient_email_notification: typing_extensions.Annotated[
        typing.Optional[RecipientEmailNotification], FieldMetadata(alias="recipientEmailNotification")
    ] = None
    resumable: typing.Optional[Resumable] = None
    signer: SignerDataRequest
    startdate: typing.Optional[Busstartdate] = None
    taxfillname: typing.Optional[Taxfillname] = None
    template_id: typing_extensions.Annotated[typing.Optional[TemplateId], FieldMetadata(alias="templateId")] = (
        pydantic.Field(default=None)
    )
    """
    The associated boarding template's ID in Payabli. Either `templateId` or `boardingLinkId` are required.
    """

    website: typing.Optional[Website] = None
    rep_code: typing_extensions.Annotated[typing.Optional[RepCode], FieldMetadata(alias="RepCode")] = None
    rep_name: typing_extensions.Annotated[typing.Optional[RepName], FieldMetadata(alias="RepName")] = None
    rep_office: typing_extensions.Annotated[typing.Optional[RepOffice], FieldMetadata(alias="RepOffice")] = 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
