api.routes.internal.location

Attributes

Classes

Functions

get_location(record_id)

Retrieves warehouse location information for a specific unit.

update_location(record_id, payload)

Update the location field of a warehouse unit in Airtable.

Module Contents

api.routes.internal.location.logger
class api.routes.internal.location.WarehouseLocationResponse

Bases: pydantic.BaseModel

name: str
serialNumber: str
imageUrls: list[str]
currentLocation: str
possibleLocations: list[str]
api.routes.internal.location.router
class api.routes.internal.location.UpdateLocationRequest

Bases: pydantic.BaseModel

location: str
async api.routes.internal.location.get_location(record_id: str)

Retrieves warehouse location information for a specific unit.

Fetches data from Airtable for the given record ID and returns structured location information including current location and all possible locations.

Parameters:

record_id – The Airtable record ID for the warehouse unit.

Returns:

Structured data containing unit name, serial number,

image URLs, current location, and possible locations.

Return type:

WarehouseLocationResponse

Raises:

HTTPException –

  • 400 if record_id is missing or empty

  • 404 if the record is not found or missing required name field

  • 500 for any other errors during Airtable data retrieval

async api.routes.internal.location.update_location(record_id: str, payload: UpdateLocationRequest)

Update the location field of a warehouse unit in Airtable.

Returns a success message with the old and new location.