# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .catalog_entry_bulk_create_request_entries_item_allowances_item_allowance_type import (
    CatalogEntryBulkCreateRequestEntriesItemAllowancesItemAllowanceType,
)


class CatalogEntryBulkCreateRequestEntriesItemAllowancesItem(UniversalBaseModel):
    """
    Request body for creating a nested allowance in entry creation
    """

    allowance_type: typing.Optional[CatalogEntryBulkCreateRequestEntriesItemAllowancesItemAllowanceType] = (
        pydantic.Field(default=None)
    )
    """
    Type of allowance
    """

    amount: float = pydantic.Field()
    """
    Allowance amount
    """

    unit_allowance: typing.Optional[float] = pydantic.Field(default=None)
    """
    Unit allowance amount
    """

    target: typing.Optional[int] = pydantic.Field(default=None)
    """
    Target (10=company, 15=location_group, 20=location)
    """

    ottimate_location_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Location ID
    """

    ottimate_group_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Restaurant group ID
    """

    start_date: dt.datetime = pydantic.Field()
    """
    Start date
    """

    end_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    End date
    """

    reference_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unique key for upsert
    """

    properties: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Additional properties
    """

    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
