WFDASH-WEBAPP/scripts
SJCoetz 1fb67efaee 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 12:10:27 +02:00
..
dev refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
migrations feat(pricelist): Catalogue search hits every field (incl. synonyms) 2026-06-30 12:10:27 +02:00
smoke refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
build_v5_workflow.py feat: add quote email intake and atomic numbering 2026-06-22 13:58:24 +02:00
deploy_v5_to_n8n.py feat: add quote email intake and atomic numbering 2026-06-22 13:58:24 +02:00
import-data.ts chore: standardize line endings and add full test + config scaffolding 2026-06-11 20:30:02 +02:00
n8n-v2-error.ts feat(quotes): add email-to-quote pipeline with attachments and replies 2026-06-16 20:46:28 +02:00
n8n-v2-main.ts feat(quotes): add email-to-quote pipeline with attachments and replies 2026-06-16 20:46:28 +02:00
setup-pocketbase.ts refactor: drop order-level status, shift to item-driven workflow 2026-06-29 13:06:01 +02:00
verify_v5.py feat: add quote email intake and atomic numbering 2026-06-22 13:58:24 +02:00