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. |
list |
Lists 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 |
list
list(
*,
limit: int = 100,
start_key: str | None = None,
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,
) -> Iterator[Lot]
Lists Lot entities with optional filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
The maximum number of Lots to return, by default 100. |
100
|
start_key
|
Optional[str]
|
The primary key of the first item to evaluate for pagination. |
None
|
parent_id
|
Optional[str]
|
Fetches list of lots for a parentId (inventory). |
None
|
inventory_id
|
Optional[str]
|
Fetches list of lots for an inventory. |
None
|
barcode_id
|
Optional[str]
|
Fetches list of lots for a barcodeId. |
None
|
parent_id_category
|
Optional[str]
|
Fetches list of lots for a parentIdCategory (e.g., RawMaterials, Consumables). |
None
|
inventory_on_hand
|
Optional[str]
|
Fetches records based on inventoryOnHand (lteZero, gtZero, eqZero). |
None
|
location_id
|
Optional[str]
|
Fetches list of lots for a locationId. |
None
|
exact_match
|
bool
|
Determines if barcodeId field should be an exact match, by default False. |
False
|
begins_with
|
bool
|
Determines if barcodeId begins with a certain value, by default False. |
False
|
Yields:
Type | Description |
---|---|
Iterator[Lot]
|
An iterator of Lot objects. |
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 object as returned by the server. |