StockSync Cleanup Audit
Non-destructive audit — no changes made. Generated 2026-04-21. Admin use only.
13
Active Pages
3
Pages to Hide
10
Stale/Deprecated Functions
5
Entities Needing Review
3
Likely Stale Entities (safe to delete after confirmation)
These workflows are critical and must not be disrupted:
- Lightspeed live lookup (lightspeedSearch + lightspeedInventory)
- Transfer request/fulfillment flow (TransferRequest → FulfillOrder → createLsTransfer)
- POS sale creation (createLsPosSale)
- Shopify image enrichment (shopifyImageLookup + shopifyImageSync)
- Twilio customer notifications (sendCustomerNotification)
- Package label printing (PackageLabel + LabelPreview)
- Receive scan at destination (ReceiveScan)
- Multi-item customer orders (CreateOrder + OrderItem + CustomerOrder)
- Admin panel (AdminPanel + Lightspeed/Shopify auth flows)
- Analytics (Analytics page)
Rule: Hide before deleting. Archive before archiving.
Complete these in order. Do not skip to deletion.
Hide ProductSearch, InventoryView, and CreateRequest from navigation
Remove these 3 pages from pages.config.js PAGES object and from App.jsx routes. Do NOT delete the files yet. They still exist and can be restored if anything depends on them unexpectedly.
Risk: Low
Archive debug functions: debugLsTransfer, debugPosSale, debugBarcode, testShopifyConfig
These are dev-only diagnostic probes not called by any page or workflow. Move to an 'archived' folder or just leave them but label them clearly as ARCHIVED in the file header.
Risk: Low
Delete createPosTransfer and the old shopifyCallback backend function
createPosTransfer is a stubbed placeholder — it generates a fake POS ID and is superseded by createLsTransfer. shopifyCallback (backend) is superseded by the ShopifyCallback frontend page + shopifyExchangeCode. Both are safe to delete.
Risk: Low
Mark buildSearchIndex, buildCatalogIndices, patchVariantSystemSkus, cleanupDuplicates as DEPRECATED in their file headers
Add a comment at the top: /* DEPRECATED — superseded by [replacement] — do not invoke in production */. Do not delete yet.
Risk: None (read-only change)
Audit database record counts in ProductSearchIndex, InventoryByStore, Product, ProductVariant
Check if these tables have any records. If they are empty or very small, safe to delete after step 1 confirms nothing breaks.
Risk: None (read-only investigation)
Review StyleMatrix, SizeVariant, BarcodeIndex for active reads
After steps 1–4 are done, re-audit whether any remaining active code path reads StyleMatrix or SizeVariant. If nothing does, these can be deprecated. Do not rush this step.
Risk: Medium — needs confirmation
Main landing page. Summary metrics, quick-scan button, pending action lists. Actively used.
Primary scan + product lookup flow. Uses lightspeedSearch + live inventory. Core workflow.
Transfer request list with tabs (For Me, I Sent, In Transit, etc). Core workflow.
Full request detail with action buttons (Fulfill, Not Found, Notify Customer, Complete). Core workflow.
Source-store fulfillment flow — item picking, scan verification, mark sent. Creates LS transfer + POS sale. Core workflow.
3×3 shipping label print page. Used after fulfillment. Core workflow.
QR/barcode scan at destination store to mark package as arrived. Core workflow.
Multi-item customer order creation — consolidates cart items from ScanScreen into TransferRequests. Core workflow.
In-app notification list. Used in nav bar. Actively used.
Admin-only panel: Stores, Users, Lightspeed auth, Shopify auth. Actively used.
Metrics and charts — accessible to managers + admins via menu. Actively used.
OLD search flow — searches local StyleMatrix/SizeVariant catalog using a local index. Replaced by ScanScreen which does live Lightspeed lookups. Not in bottom nav. Safe to hide from routing first, delete later after confirmation.
OLD inventory detail page — reads from StyleMatrix + SizeVariant. Only reachable from ProductSearch. Since ProductSearch is deprecated, this has no active entry point. Safe to hide alongside ProductSearch.
OLD single-item request creation form — uses legacy Product/ProductVariant entities (the old catalog system). The current flow creates requests via ScanScreen → CreateOrder → TransferRequest with ls_item_id. This page is not linked from any active navigation path. Safe to hide.
OAuth redirect callback page for Lightspeed auth flow. Must stay — it handles the popup close + postMessage. Not user-facing but required.
OAuth redirect callback page for Shopify auth flow. Must stay. Not user-facing but required.
Legend
