All files / src/api/inventory/hooks useInventoryData.ts

100% Statements 38/38
100% Branches 0/0
100% Functions 0/0
100% Lines 38/38

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 391x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * @file useInventoryData.ts
 * @module api/inventory/hooks
 *
 * @summary
 * Barrel export for inventory data fetching hooks.
 * Provides unified interface for supplier loading, item search, and item details queries.
 *
 * @enterprise
 * - Single import location for all inventory hooks
 * - Backward compatible with existing imports (no changes needed in consuming files)
 * - Clear separation of concerns across hook modules
 * - Consistent caching strategy: 5min suppliers, 30s items
 * - Performance optimized with conditional enabling
 * - Comprehensive TypeDoc documentation
 *
 * @backend_limitation
 * The /api/inventory search endpoint doesn't properly filter by supplierId parameter,
 * so `useItemSearchQuery` applies client-side filtering to ensure supplier isolation.
 *
 * @usage
 * ```typescript
 * import { useSuppliersQuery, useItemSearchQuery, useItemDetailsQuery } from '@/api/inventory/hooks';
 *
 * const suppliers = useSuppliersQuery(dialogOpen);
 * const items = useItemSearchQuery(selectedSupplier, searchQuery);
 * const itemDetails = useItemDetailsQuery(selectedItem?.id);
 * ```
 */
 
// Supplier selection hook
export { useSuppliersQuery } from './useSuppliersQuery';
 
// Item search with client-side supplier filtering
export { useItemSearchQuery } from './useItemSearchQuery';
 
// Item details for forms and dialogs
export { useItemDetailsQuery } from './useItemDetailsQuery';