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:
ResponseModelNested 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 defaultallowbecause the API occasionally echoes keys from related entities back into nested lot data.- Parameters:
- 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.ImageLinkDto(*, id, link=None, **extra_data)[source]
Bases:
ResponseModelImage link reference.
- 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:
ResponseModelLot-to-catalog association. Also used as a body fragment in
AddLotRequestandUpdateLotRequest.- 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:
ResponseModelBasic lot information embedded in a catalog response.
- 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:
ResponseModelFull lot — returned by
POST /LotandGET /Lot/{id}.- Parameters:
id (int)
customerItemId (str | None)
initialData (LotDataDto | None)
overridenData (List[LotDataDto] | None)
catalogs (List[LotCatalogDto] | None)
imageLinks (List[ImageLinkDto] | None)
extra_data (Any)
- initial_data: LotDataDto | None
- overriden_data: List[LotDataDto] | None
- catalogs: List[LotCatalogDto] | None
- image_links: List[ImageLinkDto] | 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:
LotDataDtoLot override data keyed by customer item ID.
Inherits every field from
LotDataDtoand addscustomerItemId. Used byPOST /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)
- 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:
RequestModelBody 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, andinitial_data.- Parameters:
customerItemId (str | None)
overridenData (List[LotDataDto] | None)
catalogs (List[LotCatalogDto] | None)
initialData (LotDataDto | 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:
RequestModelBody for
PUT /Lot/{id}. Note: noinitialData— updates cannot change the initial measurements.- Parameters:
customerItemId (str | None)
overridenData (List[LotDataDto] | None)
catalogs (List[LotCatalogDto] | 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:
RequestModelQuery parameters for
GET /Lot.- Parameters:
- 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].