api.routes.internal.location ============================ .. py:module:: api.routes.internal.location Attributes ---------- .. autoapisummary:: api.routes.internal.location.logger api.routes.internal.location.router Classes ------- .. autoapisummary:: api.routes.internal.location.WarehouseLocationResponse api.routes.internal.location.UpdateLocationRequest Functions --------- .. autoapisummary:: api.routes.internal.location.get_location api.routes.internal.location.update_location Module Contents --------------- .. py:data:: logger .. py:class:: WarehouseLocationResponse Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: name :type: str .. py:attribute:: serialNumber :type: str .. py:attribute:: imageUrls :type: list[str] .. py:attribute:: currentLocation :type: str .. py:attribute:: possibleLocations :type: list[str] .. py:data:: router .. py:class:: UpdateLocationRequest Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: location :type: str .. py:function:: get_location(record_id: str) :async: 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. :param 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. :rtype: 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 .. py:function:: update_location(record_id: str, payload: UpdateLocationRequest) :async: Update the location field of a warehouse unit in Airtable. Returns a success message with the old and new location.