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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .catalog_entry_bulk_item_allowances_item import CatalogEntryBulkItemAllowancesItem
from .catalog_entry_bulk_item_prices_item import CatalogEntryBulkItemPricesItem


class CatalogEntryBulkItem(UniversalBaseModel):
    """
    Single entry in bulk create request
    """

    erp_vendor_id: str = pydantic.Field()
    """
    ERP Vendor id from ERP/accounting system
    """

    description: str = pydantic.Field()
    """
    Item name/description
    """

    original_description: typing.Optional[str] = None
    sku: typing.Optional[str] = None
    upc: typing.Optional[str] = None
    size: typing.Optional[str] = None
    uom: typing.Optional[str] = None
    price: typing.Optional[float] = None
    unit_price: typing.Optional[float] = None
    is_split_case: typing.Optional[bool] = None
    authorized_vendor: typing.Optional[bool] = None
    catalog_unique_key: typing.Optional[str] = None
    reference_id: typing.Optional[str] = None
    dimensions: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Dimension values keyed by type (e.g. PROJECT, CLASS). Each value is the ERP external_id of the dimension. For existing entries (matched via catalog_unique_key), REPLACES all existing dimensions — include every dimension you want to keep. For new entries, sets the initial dimensions. Omit the field or pass null to leave dimensions unchanged (updates) or create without dimensions (new entries). Passing {} returns 400.
    """

    properties: typing.Optional[typing.Dict[str, typing.Any]] = None
    prices: typing.Optional[typing.List[CatalogEntryBulkItemPricesItem]] = None
    allowances: typing.Optional[typing.List[CatalogEntryBulkItemAllowancesItem]] = 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
