WFDASH-WEBAPP/scripts
Dave 698abe9fbc feat(stock): inline qty editing + column sort + pricing-gap operator scripts
Doubles down on the /stock list to make catalogue and inventory
edits one-click for the operator.

What's new:

- /stock: clickable column headers on Cost / Markup / Selling
  cycle none → asc → desc → none and feed through to the PB sort
  param. The apply bar now commits pricing AND qty in parallel
  (Promise.all against /set-pricing and /set-quantities) with
  per-row failure tracking and focused error toasts. In edit
  mode the row is no longer a button — inputs render in-place
  for current_qty, min_qty, and target_qty alongside the existing
  pricing inputs, and the row click is gated off so clicks on an
  input never navigate to the detail page.
- stock-quantities-service + /api/v1/stock/items/set-quantities
  (POST): bulk-update current_qty / min_qty / target_qty on a
  set of stock_items rows. Whitelist-validated patches, per-row
  results with stable failure reasons, and a stock_ledger row
  written FIRST whenever current_qty actually moves so the audit
  trail stays ahead of the cached total (same pattern as
  stock-surplus and stock-booking-service).
- scripts/apply-default-markup.ts: one-shot operator tool that
  seeds selling_price = round(cost_price * 1.80, 2) and markup = 80
  on stock_items rows whose cost_price is set but selling_price
  is zero. Bypasses STOCK_ITEM_PATCHABLE_FIELDS (operator-initiated
  bulk action); idempotent (never overwrites a non-zero shelf
  price or markup).
- scripts/list-irda-stock.ts: read-only inspector for the
  IRIDA spray-caint line with summary counts (without
  selling_price, without cost_price, zero stock) so the
  operator can see exactly which rows the backfill tools above
  will touch.

Tests: 81 new test cases across /stock page, stock-quantities
service + route, and apply-default-markup.
2026-09-14 13:04:26 +02:00
..
__pycache__ feat(mcp): enhance API documentation and add new tools 2026-08-15 00:06:40 +02:00
dev
fixes feat(quotes): split attachments into internal vs outbound with operator upload UI 2026-09-09 13:43:56 +02:00
migrations feat(quotes): split attachments into internal vs outbound with operator upload UI 2026-09-09 13:43:56 +02:00
perf feat: add new order, invoice, and dashboard management tools 2026-08-05 23:00:54 +02:00
smoke feat(item-intel): add new item intel popover and backend workflows 2026-08-11 02:57:57 +02:00
utils
2026-08-03-load-husqvarna-cart.ts
2026-08-03-load-yg1-quote-soq078608.ts
2026-08-03-merge-yg1-drafts.ts
2026-08-13-heal-item-intel.ts feat(tv): add TV dashboard + refine workflows 2026-08-13 20:55:22 +02:00
2026-08-21-backfill-order-duplicates.ts feat(orders): enhance order handling with email_message_id deduplication and displayContactName utility 2026-08-21 19:18:02 +02:00
_env.ts feat(tv): add TV dashboard + refine workflows 2026-08-13 20:55:22 +02:00
apply-default-markup.test.ts feat(stock): inline qty editing + column sort + pricing-gap operator scripts 2026-09-14 13:04:26 +02:00
apply-default-markup.ts feat(stock): inline qty editing + column sort + pricing-gap operator scripts 2026-09-14 13:04:26 +02:00
audit-pb-fields.py
backfill-item-intel.ts feat(item-intel): add new item intel popover and backend workflows 2026-08-11 02:57:57 +02:00
backfill-po-items.mjs
backfill-stock-prices.test.ts feat(stock): seed pricing fields on create + sync price_list to stock_items 2026-09-14 13:04:08 +02:00
backfill-stock-prices.ts feat(stock): seed pricing fields on create + sync price_list to stock_items 2026-09-14 13:04:08 +02:00
build_v5_workflow.py
deploy_v5_to_n8n.py
fleetai-probe.mjs feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
import-data.ts
list-irda-stock.ts feat(stock): inline qty editing + column sort + pricing-gap operator scripts 2026-09-14 13:04:26 +02:00
mcp-doc-gen.py feat(mcp): enhance API documentation and add new tools 2026-08-15 00:06:40 +02:00
mrbxnim4-telegram-cloud-photo-size-4-6016860144018328845-y.jpg
n8n-v2-error.ts
n8n-v2-main.ts
quotes.pb.js
regenerate-delivery-note-pdfs.ts feat: add driverless collection confirm and new order tooling 2026-08-12 01:13:46 +02:00
seed-gielie-quotes.py
setup-pocketbase.ts
verify_v5.py