feat(sync): live cross-module cache invalidation (no manual refresh)

- procurement store refreshes right after a warehouse receipt (arrivals) and
  after role/project changes (organization/admin), so the ledger reflects
  warehouse actions immediately
- refetchOnWindowFocus enabled on the shared query client
- BroadcastChannel (lib/crossTab.ts): mutations broadcast 'quotes' /
  'inventory'; all warehouse pages + the store hook resync open tabs
  automatically (receipt in one tab updates the ledger in another)
- warehouse mutations (stock changes) notify other tabs; same-page refresh
  behavior unchanged
This commit is contained in:
ali_mohaghegh
2026-09-03 15:00:58 +03:30
parent f9ec68815e
commit e4ae34ddbc
9 changed files with 122 additions and 43 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
export { useStoreData, useInvalidateStore } from "./useStoreData";
export { useStoreData, useInvalidateStore, refreshProcurementStore } from "./useStoreData";
export { useQuotes, useCreateQuote, useUpdateQuote, useDeleteQuote } from "./useQuotes";
export { useSuppliers, useAddSupplier, useUpdateSupplier, useRemoveSupplier } from "./useSuppliers";
export { useMaterials, useAddMaterial } from "./useMaterials";