feat(manufacturing): enrich inventory list with customer/user details and filters

The inventory list and detail page previously only showed raw
customer_id / user_list references. list_devices now batch-resolves
customer names and user display names/emails (via Firestore get_all(),
avoiding an N+1 round trip per device) and exposes them as
customer_name / users on DeviceInventoryItem. Search now matches
against device name, console name, customer name, and assigned users
in addition to serial/owner/batch.

Also adds hw_types (multi-select board type) and has_users filters to
GET /manufacturing/devices, and carries console_name through for
display. DeviceInventoryDetail is updated to show and use all of this
(customer name, assigned users, new UI components for signal/charts).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-21 18:34:08 +03:00
co-authored by Claude Sonnet 5
parent b07bdafd85
commit 6686faad6b
4 changed files with 197 additions and 27 deletions
+4
View File
@@ -72,6 +72,8 @@ async def create_batch(
def list_devices(
status: Optional[str] = Query(None),
hw_type: Optional[str] = Query(None),
hw_types: Optional[list[str]] = Query(None, description="Multi-select board type filter — repeat param, e.g. ?hw_types=vesper&hw_types=chronos"),
has_users: Optional[bool] = Query(None, description="Filter by whether the device has any app users assigned"),
search: Optional[str] = Query(None),
limit: int = Query(100, ge=1, le=500),
offset: int = Query(0, ge=0),
@@ -80,6 +82,8 @@ def list_devices(
items = service.list_devices(
status=status,
hw_type=hw_type,
hw_types=hw_types,
has_users=has_users,
search=search,
limit=limit,
offset=offset,