# 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_object_allowances_item import CatalogEntryObjectAllowancesItem
from .catalog_entry_object_prices_item import CatalogEntryObjectPricesItem


class CatalogEntryObject(UniversalBaseModel):
    """
    Full catalog entry object returned for retrieve operations
    """

    id: str = pydantic.Field()
    """
    Unique identifier (prefixed with cte_)
    """

    ottimate_company_id: int = pydantic.Field()
    """
    Company ID
    """

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

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Item name
    """

    sku: typing.Optional[str] = pydantic.Field(default=None)
    """
    SKU code
    """

    upc: typing.Optional[str] = pydantic.Field(default=None)
    """
    UPC code
    """

    pack_size: typing.Optional[str] = pydantic.Field(default=None)
    """
    Pack size
    """

    uom: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unit of measure
    """

    price: typing.Optional[str] = pydantic.Field(default=None)
    """
    Price (decimal string)
    """

    unit_price: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unit price (decimal string)
    """

    last_purchased_price: typing.Optional[str] = pydantic.Field(default=None)
    """
    Last purchased price (decimal string)
    """

    erp_vendor_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ERP Vendor id from ERP/accounting system
    """

    ottimate_vendor_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Ottimate's resolved vendor name
    """

    is_split_case: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Split case indicator
    """

    dimensions: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Dimensions as key-value pairs (dimension_type: dimension_value)
    """

    display_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Display name for the item
    """

    last_purchased_date: typing.Optional[str] = pydantic.Field(default=None)
    """
    Last purchased date
    """

    created_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Record creation date
    """

    last_modified_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Record last modified date
    """

    prices: typing.Optional[typing.List[CatalogEntryObjectPricesItem]] = pydantic.Field(default=None)
    """
    List of catalog prices (only in retrieve or when expand=prices)
    """

    allowances: typing.Optional[typing.List[CatalogEntryObjectAllowancesItem]] = pydantic.Field(default=None)
    """
    List of catalog allowances (only in retrieve or when expand=allowances)
    """

    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
