Lots
albert.collections.lots.LotCollection
Bases: BaseCollection
LotCollection is a collection class for managing Lot entities in the Albert platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
An Albert session instance. |
required |
Methods:
| Name | Description |
|---|---|
create |
|
get_by_id |
Get a lot by its ID. |
get_by_ids |
Get a list of lots by their IDs. |
delete |
Delete a lot by its ID. |
get_all |
Get all Lot entities with optional filters. |
update |
Update a lot. |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
|
Source code in src/albert/collections/lots.py
create
Source code in src/albert/collections/lots.py
get_by_id
get_by_ids
Get a list of lots by their IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
list[str]
|
A list of lot IDs to get. |
required |
Returns:
| Type | Description |
|---|---|
list[Lot]
|
A list of lots with the provided IDs. |
Source code in src/albert/collections/lots.py
delete
delete(*, id: str) -> None
Delete a lot by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The ID of the lot to delete. |
required |
get_all
get_all(
*,
parent_id: str | None = None,
inventory_id: str | None = None,
barcode_id: str | None = None,
parent_id_category: str | None = None,
inventory_on_hand: str | None = None,
location_id: str | None = None,
exact_match: bool = False,
begins_with: bool = False,
start_key: str | None = None,
page_size: int = 100,
max_items: int | None = None,
) -> Iterator[Lot]
Get all Lot entities with optional filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_id
|
str
|
Fetch lots for the given parentId (inventory). |
None
|
inventory_id
|
str
|
Fetch lots for the given inventoryId. |
None
|
barcode_id
|
str
|
Fetch lots for the given barcodeId. |
None
|
parent_id_category
|
str
|
Filter by parentIdCategory (e.g., RawMaterials, Consumables). |
None
|
inventory_on_hand
|
str
|
Filter by inventoryOnHand (lteZero, gtZero, eqZero). |
None
|
location_id
|
str
|
Filter by locationId. |
None
|
exact_match
|
bool
|
Whether to match barcodeId exactly. Default is False. |
False
|
begins_with
|
bool
|
Whether to match barcodeId as prefix. Default is False. |
False
|
start_key
|
str
|
The pagination key to continue listing from. |
None
|
page_size
|
int
|
Number of items to return per page. Default is 100. |
100
|
max_items
|
int
|
Maximum number of items to return in total. If None, fetches all available items. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[Lot]
|
An iterator of Lot entities matching the filters. |
Source code in src/albert/collections/lots.py
update
Update a lot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lot
|
Lot
|
The updated lot object. |
required |
Returns:
| Type | Description |
|---|---|
Lot
|
The updated Lot entity as returned by the server. |