Lot Models

Lot models for the Catalog API.

Field shapes ported against ab/api/schemas/catalog.json (swagger, Tier 3) with ABConnectTools/ABConnect/api/models/catalog.py as secondary reference (Tier 4). The prior placeholder implementation had invented field names that did not match either source — see specs/036-lotsdb-migration-prep/gap-recommendations.md for the full drift history.

Casing note: the Catalog API uses mixed PascalCase / camelCase for LotDataDto field aliases (Qty, L, W, H, Wgt, Cpack, ItemID, Notes are PascalCase; value, description, forceCrate, doNotTip, commodityId, notedConditions are camelCase). Python field names keep the database shape (l/w/h/wgt) because downstream tools diff and persist model_dump(by_alias=False). Aliases below match swagger exactly. ABConnectTools used uniform PascalCase on writes (CPack); when in doubt swagger wins per the constitution’s Sources of Truth hierarchy.

class ab.api.models.lots.LotDataDto(*, qty=None, l=None, w=None, h=None, wgt=None, value=None, cpack=None, description=None, forceCrate=None, itemId=None, notes=None, notedConditions=None, doNotTip=None, commodityId=None)[source]

Bases: ResponseModel

Nested data payload shared by lot reads and writes.

Used in both response contexts (LotDto.initial_data) and request contexts (AddLotRequest.initial_data, BulkInsertLotRequest.initial_data). extra="ignore" is used instead of the default allow because the API occasionally echoes keys from related entities back into nested lot data.

Parameters:
  • qty (int | None)

  • l (float | None)

  • w (float | None)

  • h (float | None)

  • wgt (float | None)

  • value (float | None)

  • cpack (str | None)

  • description (str | None)

  • forceCrate (bool | None)

  • itemId (str | None)

  • notes (str | None)

  • notedConditions (str | None)

  • doNotTip (bool | None)

  • commodityId (str | None)

model_config = {'alias_generator': <function _to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

qty: int | None
l: float | None
w: float | None
h: float | None
wgt: float | None
value: float | None
cpack: str | None
description: str | None
force_crate: bool | None
item_id: str | None
notes: str | None
noted_conditions: str | None
do_not_tip: bool | None
commodity_id: str | None
class ab.api.models.lots.ImageLinkDto(*, id, link=None, **extra_data)[source]

Bases: ResponseModel

Image link reference.

Parameters:
  • id (int)

  • link (str | None)

  • extra_data (Any)

id: int
model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.lots.LotCatalogDto(*, catalogId, lotNumber=None, **extra_data)[source]

Bases: ResponseModel

Lot-to-catalog association. Also used as a body fragment in AddLotRequest and UpdateLotRequest.

Parameters:
  • catalogId (int)

  • lotNumber (str | None)

  • extra_data (Any)

catalog_id: int
lot_number: str | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.lots.LotCatalogInformationDto(*, id, lotNumber=None, **extra_data)[source]

Bases: ResponseModel

Basic lot information embedded in a catalog response.

Parameters:
  • id (int)

  • lotNumber (str | None)

  • extra_data (Any)

id: int
lot_number: str | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.lots.LotDto(*, id, customerItemId=None, initialData=None, overridenData=None, catalogs=None, imageLinks=None, **extra_data)[source]

Bases: ResponseModel

Full lot — returned by POST /Lot and GET /Lot/{id}.

Parameters:
id: int
customer_item_id: str | None
initial_data: LotDataDto | None
overriden_data: List[LotDataDto] | None
catalogs: List[LotCatalogDto] | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.lots.LotOverrideDto(*, qty=None, l=None, w=None, h=None, wgt=None, value=None, cpack=None, description=None, forceCrate=None, itemId=None, notes=None, notedConditions=None, doNotTip=None, commodityId=None, customerItemId=None)[source]

Bases: LotDataDto

Lot override data keyed by customer item ID.

Inherits every field from LotDataDto and adds customerItemId. Used by POST /Lot/get-overrides.

Parameters:
  • qty (int | None)

  • l (float | None)

  • w (float | None)

  • h (float | None)

  • wgt (float | None)

  • value (float | None)

  • cpack (str | None)

  • description (str | None)

  • forceCrate (bool | None)

  • itemId (str | None)

  • notes (str | None)

  • notedConditions (str | None)

  • doNotTip (bool | None)

  • commodityId (str | None)

  • customerItemId (str | None)

customer_item_id: str | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.lots.AddLotRequest(*, customerItemId=None, imageLinks=None, overridenData=None, catalogs=None, initialData=None)[source]

Bases: RequestModel

Body for POST /Lot.

All fields are optional per swagger — the server will reject an empty body with a 400 on its own side; the SDK does not duplicate that validation because swagger does not declare required fields. Callers typically supply at minimum customer_item_id, catalogs, and initial_data.

Parameters:
customer_item_id: str | None
overriden_data: List[LotDataDto] | None
catalogs: List[LotCatalogDto] | None
initial_data: LotDataDto | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.lots.UpdateLotRequest(*, customerItemId=None, imageLinks=None, overridenData=None, catalogs=None)[source]

Bases: RequestModel

Body for PUT /Lot/{id}. Note: no initialData — updates cannot change the initial measurements.

Parameters:
customer_item_id: str | None
overriden_data: List[LotDataDto] | None
catalogs: List[LotCatalogDto] | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.lots.LotListParams(*, Id=None, CustomerItemId=None, LotNumber=None, PageSize=None, PageNumber=None)[source]

Bases: RequestModel

Query parameters for GET /Lot.

Parameters:
  • Id (int | None)

  • CustomerItemId (str | None)

  • LotNumber (str | None)

  • PageSize (int | None)

  • PageNumber (int | None)

id: int | None
customer_item_id: str | None
lot_number: str | None
page_size: int | None
page_number: int | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].