Goal: Provide reusable catalog search/select plumbing (API + UI component) backed by our synced UEX data so inventory add flows can use it without live UEX calls.
Acceptance Criteria
- API endpoint (or confirm existing) to query synced UEX items with search, category filter, pagination; returns identifiers/names/category, and any metadata needed for inventory creation.
- Frontend service helper for catalog search that both personal and org inventory flows can call.
- Reusable UI selector component to search/paginate the catalog and return the chosen item (no live UEX requests).
- Handles large result sets efficiently (pagination + debounce), with error states surfaced.
- Includes basic tests (API/service/component) for search, pagination, and selection wiring.
Technical Elaboration
- Backend: add or confirm
GET /api/uex/items that queries synced tables with ILIKE search on name, category filter, limit/offset (cap to 100), default sort by name asc; return {items, total, limit, offset} with uexId, name, categoryId, categoryName (and any needed metadata for inventory creation). Add indexes as needed (name search, category).
- Frontend service: add
searchCatalog helper (new uex.service.ts or extend inventory service) with params {search?, categoryId?, limit?, offset?} and debounced usage.
- UI component: build
CatalogPicker (modal-friendly) that renders search box, category select, paginated results list; exposes onSelect(item); shows loading/error states; configurable page size. Backed by the service helper and debounce (300–400ms).
- Hook: optional
useCatalogSearch to encapsulate search/filters/pagination state for reuse by personal/org add modals.
- Testing: backend unit/integration for search/filter/pagination; frontend unit for service (axios mocked) and component behavior (debounce, pagination, selection).
Notes
- Designed to be shared by issues 54/55 add flows; no live UEX calls.
Goal: Provide reusable catalog search/select plumbing (API + UI component) backed by our synced UEX data so inventory add flows can use it without live UEX calls.
Acceptance Criteria
Technical Elaboration
GET /api/uex/itemsthat queries synced tables with ILIKE search on name, category filter, limit/offset (cap to 100), default sort by name asc; return{items, total, limit, offset}withuexId,name,categoryId,categoryName(and any needed metadata for inventory creation). Add indexes as needed (name search, category).searchCataloghelper (newuex.service.tsor extend inventory service) with params{search?, categoryId?, limit?, offset?}and debounced usage.CatalogPicker(modal-friendly) that renders search box, category select, paginated results list; exposesonSelect(item); shows loading/error states; configurable page size. Backed by the service helper and debounce (300–400ms).useCatalogSearchto encapsulate search/filters/pagination state for reuse by personal/org add modals.Notes