WFDASH-WEBAPP/scripts/migrations
SJCoetz b75873a51b feat(pricelist): Catalogue tab with search + category/brand filters
Adds a second tab on /pricelist that shows the structured
`price_list` collection (AI-extracted line items) instead of the
raw PDF uploads. Operators can now:

  - Search across SKU, description, and brand
  - Filter by category (twist_drill, hss_cutter, countersink, ...)
  - Filter by brand (JEI, TurboSteel, TurboTough, ...)
  - See cost vs selling price side-by-side in ZAR
  - Click a row's 'Source' link to jump back to the raw PDF

The distinct filter values are pulled from a one-shot getList(1, 500)
on mount, with hardcoded fallbacks (FALLBACK_CATEGORIES /
FALLBACK_BRANDS) so the dropdowns are useful even before any
extractions have run.

Layout: Tabs (Raw Uploads | Catalogue) wrap both views; the
header + page chrome stay shared. The DeleteDialog stays outside
the Tabs since it's a modal.

Also ships an idempotent migration to add `source_file` (text)
to `price_list` — used by the n8n workflow to track which raw
PDF each extracted row came from, and by the verify-after-POST
step the workflow uses to decide whether to flip
`raw_price_list.status` to Completed vs Failed.

Price type is in PriceListRow (shared subset) and PriceList
(full record). Supplier names are resolved client-side via
getAllSuppliers() since the live schema has supplier as a text
field rather than a relation.

Tests: 229/230 (same pre-existing failure, unrelated). TypeScript
clean.
2026-06-30 11:49:48 +02:00
..
2026-06-23-add-quote-attachments-direction.ts feat: add quote templates, improved email, new statuses 2026-06-24 22:57:01 +02:00
2026-06-23-add-quote-email-composition-fields.ts feat: add quote templates, improved email, new statuses 2026-06-24 22:57:01 +02:00
2026-06-23-add-quote-outbound-email-fields.ts feat: add quote templates, improved email, new statuses 2026-06-24 22:57:01 +02:00
2026-06-23-add-quote-template-fields.ts feat: add quote templates, improved email, new statuses 2026-06-24 22:57:01 +02:00
2026-06-26-add-orders-rep.ts refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
2026-06-27-add-order-quote-match-fields.ts refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
2026-06-27-drop-orders-status-and-wipe.ts refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
2026-06-28-add-companies-coordinates.ts refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
2026-06-28-add-purchase-order-pdfs.ts refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
2026-06-28-convert-customer-fields.ts refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
2026-06-30-add-price-list-source-file.ts feat(pricelist): Catalogue tab with search + category/brand filters 2026-06-30 11:49:48 +02:00
2026-06-30-add-pricelist-notes.ts feat(pricelist): notes field for AI instructions + file_name on upload 2026-06-30 11:09:27 +02:00
2026-06-30-add-raw-price-list.ts feat(management): new Pricelist page with drag-drop upload + queue table 2026-06-30 09:14:36 +02:00
add-quote-items-user-edited.ts feat: add AI quote item rewriter and supporting UI/UX changes 2026-06-22 18:29:59 +02:00
broaden-quote-attachments-mime-types.ts feat(quotes): add email-to-quote pipeline with attachments and replies 2026-06-16 20:46:28 +02:00
create-order-items-v2-and-collection-pool.ts chore: standardize line endings and add full test + config scaffolding 2026-06-11 20:30:02 +02:00
create-quote-attachments-and-replies.ts feat(quotes): add email-to-quote pipeline with attachments and replies 2026-06-16 20:46:28 +02:00