# 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 .variance_object_invoice_items import VarianceObjectInvoiceItems
from .variance_object_last_invoice_item import VarianceObjectLastInvoiceItem


class VarianceObject(UniversalBaseModel):
    id: int = pydantic.Field()
    """
    Catalog entry ID
    """

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

    item_name: str
    sku: typing.Optional[str] = None
    upc: typing.Optional[str] = None
    pack_size: typing.Optional[str] = None
    price: typing.Optional[float] = pydantic.Field(default=None)
    """
    Catalog price
    """

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

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

    case_size: typing.Optional[str] = pydantic.Field(default=None)
    """
    Pack size for unit conversion
    """

    last_invoice_item: typing.Optional[VarianceObjectLastInvoiceItem] = pydantic.Field(default=None)
    """
    Most recent invoice item for this catalog entry
    """

    invoice_items: typing.Optional[VarianceObjectInvoiceItems] = pydantic.Field(default=None)
    """
    Invoice items for this catalog entry. Only included when expand=invoice_items is specified. Returns up to 10 items with pagination metadata.
    """

    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
