2026-06-11 18:30:02 +00:00
|
|
|
{
|
|
|
|
|
"name": "wfdash",
|
|
|
|
|
"version": "0.1.0",
|
|
|
|
|
"private": true,
|
|
|
|
|
"engines": {
|
|
|
|
|
"node": ">=20.9.0"
|
|
|
|
|
},
|
|
|
|
|
"scripts": {
|
|
|
|
|
"dev": "next dev --webpack",
|
|
|
|
|
"build": "next build",
|
|
|
|
|
"start": "next start",
|
|
|
|
|
"lint": "eslint",
|
|
|
|
|
"setup": "npx tsx scripts/setup-pocketbase.ts",
|
|
|
|
|
"pb:migrate:orders-v2": "npx tsx scripts/migrations/create-order-items-v2-and-collection-pool.ts",
|
2026-06-16 18:46:28 +00:00
|
|
|
"pb:migrate:quote-attachments": "npx tsx scripts/migrations/create-quote-attachments-and-replies.ts",
|
2026-06-22 16:29:59 +00:00
|
|
|
"pb:migrate:quote-items-user-edited": "npx tsx scripts/migrations/add-quote-items-user-edited.ts",
|
2026-06-29 11:06:01 +00:00
|
|
|
"pb:migrate:order-status-in-stock": "echo 'deprecated: orders.status was dropped 2026-06-27. No-op.' && exit 0",
|
|
|
|
|
"pb:migrate:orders-rep": "npx tsx scripts/migrations/2026-06-26-add-orders-rep.ts",
|
|
|
|
|
"pb:migrate:drop-orders-status": "npx tsx scripts/migrations/2026-06-27-drop-orders-status-and-wipe.ts",
|
|
|
|
|
"pb:migrate:add-order-quote-match": "npx tsx scripts/migrations/2026-06-27-add-order-quote-match-fields.ts",
|
|
|
|
|
"pb:migrate:add-purchase-order-pdfs": "npx tsx scripts/migrations/2026-06-28-add-purchase-order-pdfs.ts",
|
|
|
|
|
"pb:migrate:add-companies-coordinates": "npx tsx scripts/migrations/2026-06-28-add-companies-coordinates.ts",
|
|
|
|
|
"pb:migrate:convert-customer-fields": "npx tsx scripts/migrations/2026-06-28-convert-customer-fields.ts",
|
2026-06-30 07:14:36 +00:00
|
|
|
"pb:migrate:raw-price-list": "npx tsx scripts/migrations/2026-06-30-add-raw-price-list.ts",
|
2026-06-30 09:09:27 +00:00
|
|
|
"pb:migrate:pricelist-notes": "npx tsx scripts/migrations/2026-06-30-add-pricelist-notes.ts",
|
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 09:49:48 +00:00
|
|
|
"pb:migrate:price-list-source-file": "npx tsx scripts/migrations/2026-06-30-add-price-list-source-file.ts",
|
feat(pricelist): Catalogue search hits every field (incl. synonyms)
The Catalogue tab's search box used to OR across just sku,
description, and brand. Now it hits:
- sku, description, brand, supplier, category, subcategory
(PB's case-insensitive `~` operator, each indexed)
- search_text (a denormalised text blob)
The denormalised column is the key part: PB can't substring-
match a JSON field, so without this, synonyms from
`specifications.synonyms` ("slugger cutter", "turbo tough",
etc.) would never match in the search box. The n8n workflow's
Code node now flattens every searchable bit — including the
synonyms array — into search_text on every POST. The 46 pre-
existing rows were backfilled once with the same formula.
The `price_list.supplier` field also stored the PB id on the
46 pre-existing rows (n8n was setting the resolved name, but
the original LLM tests that seeded the table didn't). Fixed
that in the same backfill — supplier now reads 'JEISA -
WESTSCOTT GROUP' instead of 'q6hpwbxsicyoiuu', which makes
the supplier filter dropdown work AND makes
'supplier ~ "jeisa"' match.
Migration `2026-06-30-add-price-list-search-text`:
- Adds `search_text` (text) column
- Adds `idx_pl_search_text` non-unique index
- Idempotent — re-runs are safe and self-heal the index
Updates:
- `getPriceLists` helper ORs across all 6 columns + search_text
- `PriceList` TS type gains `search_text: string`
- `pricelist-extraction.md` Code node snippet shows how the
n8n workflow should populate `search_text` on every POST
- Search input placeholder reads 'Search anything — SKU,
description, brand, supplier, synonyms…'
Tests: 229/230 (same pre-existing failure, unrelated).
TypeScript clean.
2026-06-30 10:10:27 +00:00
|
|
|
"pb:migrate:price-list-search-text": "npx tsx scripts/migrations/2026-06-30-add-price-list-search-text.ts",
|
2026-06-30 19:20:53 +00:00
|
|
|
"pb:backfill:price-list-search-text": "npx tsx scripts/migrations/2026-06-30-backfill-price-list-search-text.ts",
|
|
|
|
|
"pb:migrate:price-list-sku-normalised": "npx tsx scripts/migrations/2026-06-30-add-price-list-sku-normalised.ts",
|
|
|
|
|
"pb:migrate:quote-items-sku": "npx tsx scripts/migrations/2026-06-30-add-quote-items-sku-and-pricing.ts",
|
|
|
|
|
"pb:migrate:rfq-outbound": "npx tsx scripts/migrations/2026-06-30-create-rfq-outbound.ts",
|
2026-07-09 20:28:50 +00:00
|
|
|
"pb:migrate:sprint-categories": "npx tsx scripts/migrations/2026-07-02-add-sprint-categories-and-claims.ts",
|
|
|
|
|
"pb:migrate:po-pdf-tokens": "npx tsx scripts/migrations/2026-07-09-po-pdf-tokens.ts",
|
2026-06-16 18:46:28 +00:00
|
|
|
"smoke:counter": "npx tsx scripts/smoke/counter.ts",
|
|
|
|
|
"smoke:counter-concurrent": "npx tsx scripts/smoke/counter-concurrent.ts",
|
|
|
|
|
"smoke:create-from-email": "npx tsx scripts/smoke/create-from-email.ts",
|
2026-06-29 11:06:01 +00:00
|
|
|
"smoke:management": "npx tsx scripts/smoke/management-flow.ts",
|
|
|
|
|
"smoke:mcp-management": "npx tsx scripts/smoke/mcp-management.ts",
|
|
|
|
|
"smoke:rest-management": "npx tsx scripts/smoke/rest-management.ts",
|
2026-06-11 18:30:02 +00:00
|
|
|
"test": "vitest",
|
|
|
|
|
"test:run": "vitest run",
|
|
|
|
|
"test:coverage": "vitest run --coverage",
|
|
|
|
|
"e2e": "playwright test",
|
|
|
|
|
"e2e:ui": "playwright test --ui",
|
|
|
|
|
"e2e:install": "playwright install --with-deps chromium"
|
|
|
|
|
},
|
|
|
|
|
"dependencies": {
|
|
|
|
|
"@base-ui/react": "^1.5.0",
|
|
|
|
|
"@radix-ui/react-slot": "^1.2.4",
|
2026-06-23 06:30:38 +00:00
|
|
|
"@react-pdf/renderer": "^4.5.1",
|
2026-06-11 18:30:02 +00:00
|
|
|
"@types/leaflet": "^1.9.21",
|
|
|
|
|
"class-variance-authority": "^0.7.1",
|
|
|
|
|
"clsx": "^2.1.1",
|
|
|
|
|
"cmdk": "^1.1.1",
|
2026-07-09 07:44:55 +00:00
|
|
|
"jspdf": "^2.5.2",
|
2026-06-11 18:30:02 +00:00
|
|
|
"leaflet": "^1.9.4",
|
|
|
|
|
"lucide-react": "^1.16.0",
|
|
|
|
|
"next": "16.2.6",
|
|
|
|
|
"next-themes": "^0.4.6",
|
2026-07-09 20:28:50 +00:00
|
|
|
"pdf-lib": "^1.17.1",
|
2026-06-11 18:30:02 +00:00
|
|
|
"pocketbase": "^0.26.9",
|
|
|
|
|
"react": "19.2.4",
|
|
|
|
|
"react-dom": "19.2.4",
|
|
|
|
|
"react-leaflet": "^5.0.0",
|
|
|
|
|
"shadcn": "^4.8.0",
|
|
|
|
|
"sonner": "^2.0.7",
|
|
|
|
|
"tailwind-merge": "^3.6.0",
|
|
|
|
|
"tw-animate-css": "^1.4.0"
|
|
|
|
|
},
|
|
|
|
|
"devDependencies": {
|
|
|
|
|
"@playwright/test": "^1.60.0",
|
|
|
|
|
"@tailwindcss/postcss": "^4",
|
|
|
|
|
"@testing-library/dom": "^10.4.1",
|
2026-07-07 23:35:00 +00:00
|
|
|
"@testing-library/jest-dom": "^6.9.1",
|
2026-06-11 18:30:02 +00:00
|
|
|
"@testing-library/react": "^16.3.2",
|
|
|
|
|
"@types/node": "^20",
|
|
|
|
|
"@types/react": "^19",
|
|
|
|
|
"@types/react-dom": "^19",
|
|
|
|
|
"@vitejs/plugin-react": "^6.0.2",
|
|
|
|
|
"eslint": "^9",
|
|
|
|
|
"eslint-config-next": "16.2.6",
|
|
|
|
|
"jsdom": "^29.1.1",
|
|
|
|
|
"tailwindcss": "^4",
|
|
|
|
|
"typescript": "^5",
|
|
|
|
|
"vite-tsconfig-paths": "^6.1.1",
|
|
|
|
|
"vitest": "^4.1.8"
|
|
|
|
|
}
|
|
|
|
|
}
|