"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from abbyy_document_ai.types import BaseModel
from datetime import date
from enum import Enum
import pydantic
from typing import List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class HotelInvoiceFieldsTaxesTypedDict(TypedDict):
    tax_rate: NotRequired[float]
    r"""The tax rate applied to the purchase."""
    tax_amount: NotRequired[float]
    r"""The amount of tax for this rate."""


class HotelInvoiceFieldsTaxes(BaseModel):
    tax_rate: Annotated[Optional[float], pydantic.Field(alias="taxRate")] = None
    r"""The tax rate applied to the purchase."""

    tax_amount: Annotated[Optional[float], pydantic.Field(alias="taxAmount")] = None
    r"""The amount of tax for this rate."""


class Five(str, Enum):
    UNDEFINED = "Undefined"


class Four(str, Enum):
    MIXED = "Mixed"


class Three(str, Enum):
    TRANSFER = "Transfer"


class Two(str, Enum):
    CASH = "Cash"


class One(str, Enum):
    CARD = "Card"


PaymentMethodTypedDict = TypeAliasType(
    "PaymentMethodTypedDict", Union[One, Two, Three, Four, Five]
)
r"""Payment method used for the transaction."""


PaymentMethod = TypeAliasType("PaymentMethod", Union[One, Two, Three, Four, Five])
r"""Payment method used for the transaction."""


class CardType5(str, Enum):
    UNDEFINED = "Undefined"


class CardType4(str, Enum):
    NATIONAL_CARD = "NationalCard"


class CardType3(str, Enum):
    AMERICAN_EXPRESS = "AmericanExpress"


class CardType2(str, Enum):
    VISA = "VISA"


class CardType1(str, Enum):
    MASTERCARD = "Mastercard"


CardTypeTypedDict = TypeAliasType(
    "CardTypeTypedDict", Union[CardType1, CardType2, CardType3, CardType4, CardType5]
)
r"""The payment processing network of the card used for payment."""


CardType = TypeAliasType(
    "CardType", Union[CardType1, CardType2, CardType3, CardType4, CardType5]
)
r"""The payment processing network of the card used for payment."""


class CreditOrDebit2(str, Enum):
    DEBIT = "Debit"


class CreditOrDebit1(str, Enum):
    CREDIT = "Credit"


CreditOrDebitTypedDict = TypeAliasType(
    "CreditOrDebitTypedDict", Union[CreditOrDebit1, CreditOrDebit2]
)
r"""Whether a credit or debit card was used."""


CreditOrDebit = TypeAliasType("CreditOrDebit", Union[CreditOrDebit1, CreditOrDebit2])
r"""Whether a credit or debit card was used."""


class HotelInvoiceFieldsLineItemsTypedDict(TypedDict):
    sku: NotRequired[str]
    r"""The stock-keeping unit identifier of services or items provided to the guest."""
    description: NotRequired[str]
    r"""The name of the purchased service or item."""
    quantity: NotRequired[float]
    r"""The quantity of the service or item purchased."""
    price: NotRequired[float]
    r"""The price per unit."""
    amount: NotRequired[float]
    r"""The total amount in the line item."""


class HotelInvoiceFieldsLineItems(BaseModel):
    sku: Optional[str] = None
    r"""The stock-keeping unit identifier of services or items provided to the guest."""

    description: Optional[str] = None
    r"""The name of the purchased service or item."""

    quantity: Optional[float] = None
    r"""The quantity of the service or item purchased."""

    price: Optional[float] = None
    r"""The price per unit."""

    amount: Optional[float] = None
    r"""The total amount in the line item."""


class HotelInvoiceFieldsTypedDict(TypedDict):
    r"""Fields extracted from a hotel invoice"""

    date_: NotRequired[date]
    r"""The date when the invoice was issued by the hotel."""
    check_in_date: NotRequired[date]
    r"""The date when the guest checked into the hotel."""
    check_out_date: NotRequired[date]
    r"""The date when the guest checked out of the hotel."""
    nights: NotRequired[float]
    r"""The duration of the guest's stay."""
    hotel_name: NotRequired[str]
    r"""The name of the hotel."""
    address: NotRequired[str]
    r"""The address of the hotel."""
    city: NotRequired[str]
    r"""The city where the hotel is located."""
    state: NotRequired[str]
    r"""The state/province where the hotel is located."""
    postal_code: NotRequired[str]
    r"""The postal code of the hotel's address."""
    country: NotRequired[str]
    r"""The country where the hotel is located."""
    phone: NotRequired[str]
    r"""The phone number of the hotel."""
    currency: NotRequired[str]
    r"""The currency of the payment."""
    total: NotRequired[float]
    r"""The total amount of the invoice."""
    tax_total: NotRequired[float]
    r"""The total amount of tax levied on the purchase."""
    taxes: NotRequired[List[HotelInvoiceFieldsTaxesTypedDict]]
    payment_method: NotRequired[PaymentMethodTypedDict]
    r"""Payment method used for the transaction."""
    card_type: NotRequired[CardTypeTypedDict]
    r"""The payment processing network of the card used for payment."""
    credit_or_debit: NotRequired[CreditOrDebitTypedDict]
    r"""Whether a credit or debit card was used."""
    card_number: NotRequired[str]
    r"""The number of the card used for payment. May be partially masked."""
    line_items: NotRequired[List[HotelInvoiceFieldsLineItemsTypedDict]]


class HotelInvoiceFields(BaseModel):
    r"""Fields extracted from a hotel invoice"""

    date_: Annotated[Optional[date], pydantic.Field(alias="date")] = None
    r"""The date when the invoice was issued by the hotel."""

    check_in_date: Annotated[Optional[date], pydantic.Field(alias="checkInDate")] = None
    r"""The date when the guest checked into the hotel."""

    check_out_date: Annotated[Optional[date], pydantic.Field(alias="checkOutDate")] = (
        None
    )
    r"""The date when the guest checked out of the hotel."""

    nights: Optional[float] = None
    r"""The duration of the guest's stay."""

    hotel_name: Annotated[Optional[str], pydantic.Field(alias="hotelName")] = None
    r"""The name of the hotel."""

    address: Optional[str] = None
    r"""The address of the hotel."""

    city: Optional[str] = None
    r"""The city where the hotel is located."""

    state: Optional[str] = None
    r"""The state/province where the hotel is located."""

    postal_code: Annotated[Optional[str], pydantic.Field(alias="postalCode")] = None
    r"""The postal code of the hotel's address."""

    country: Optional[str] = None
    r"""The country where the hotel is located."""

    phone: Optional[str] = None
    r"""The phone number of the hotel."""

    currency: Optional[str] = None
    r"""The currency of the payment."""

    total: Optional[float] = None
    r"""The total amount of the invoice."""

    tax_total: Annotated[Optional[float], pydantic.Field(alias="taxTotal")] = None
    r"""The total amount of tax levied on the purchase."""

    taxes: Optional[List[HotelInvoiceFieldsTaxes]] = None

    payment_method: Annotated[
        Optional[PaymentMethod], pydantic.Field(alias="paymentMethod")
    ] = None
    r"""Payment method used for the transaction."""

    card_type: Annotated[Optional[CardType], pydantic.Field(alias="cardType")] = None
    r"""The payment processing network of the card used for payment."""

    credit_or_debit: Annotated[
        Optional[CreditOrDebit], pydantic.Field(alias="creditOrDebit")
    ] = None
    r"""Whether a credit or debit card was used."""

    card_number: Annotated[Optional[str], pydantic.Field(alias="cardNumber")] = None
    r"""The number of the card used for payment. May be partially masked."""

    line_items: Annotated[
        Optional[List[HotelInvoiceFieldsLineItems]], pydantic.Field(alias="lineItems")
    ] = None
