WFDASH-WEBAPP/src/components
SJCoetz 74c73e9f17 feat(orders): totals + add/remove items in review modal
Two related enhancements to the orders review modal:

* Tier 1 — header totals: the "Order items" header now shows the
  item count plus the cost and selling totals (qty*price summed
  across the live draft state). Uses formatCurrency from
  pb-helpers.ts for the ZAR formatting.

* Tier 2 — add/remove items: the edit-mode items list now has an
  "Add item" button (Plus icon) and a per-row Trash icon. New rows
  get a sentinel id like "__new_1" and a left-edge accent stripe;
  rows flagged for removal flip to a strikethrough + reduced opacity
  with disabled inputs (toggle button flips to an Undo2 icon).

  On save, the route posts to /api/v1/orders/[id]/review-save with
  new itemsToAdd and itemsToRemove arrays. The service layer adds
  createOrderItems + softFlagOrderItems handlers (set
  item_status="removed" — operator confirmed the value is in the
  PB admin schema). The modal re-keys the new drafts with the
  returned PB ids so a follow-up save treats them as existing
  items.

  Partial-failure UI now has three sections (updates / adds /
  removes) sharing a labelled FailureSection helper. Response
  envelope now includes itemsAdded and itemsRemoved alongside the
  existing items block, plus a flat partialFailures array for
  the toast summary.

  Type cleanup: "removed" added to ItemStatus and the
  ITEM_STATUS_VISUAL map.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
2026-07-29 18:54:49 +02:00
..
charts feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
delivery-notes feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
stock feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
ui feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
ai-insights-panel.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
ai-insights-renderer.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
ai-item-history-trigger.tsx refactor(item-history): trigger fetches new endpoint instead of inline read 2026-07-29 15:13:15 +02:00
auth-provider.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
brand-stripe.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
company-form.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
company-form.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
customer-form.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
customer-form.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
data-table.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
data-table.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
delete-dialog.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
dev-identity-switcher.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
filter-tabs.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
fulfill-from-stock-cell.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
item-history-popover.test.tsx chore(item-history): pin Fastener Co duplicate rendering in popover tests 2026-07-29 15:09:35 +02:00
item-history-popover.tsx feat(item-history): tight popover renderer with 4 render states 2026-07-29 15:08:03 +02:00
item-status-pill.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
item-status-pill.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
item-status-tabs.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
leaflet-markers.test.ts feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
leaflet-markers.ts feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
line-items-table.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
order-form.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
order-sprint-process-modal.tsx feat(orders): add Order Sprint page + process modal + sidebar entry 2026-07-29 17:50:21 +02:00
orders-review-modal.test.tsx feat(orders): totals + add/remove items in review modal 2026-07-29 18:54:49 +02:00
orders-review-modal.tsx feat(orders): totals + add/remove items in review modal 2026-07-29 18:54:49 +02:00
pricelist-catalogue.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
pricelist-catalogue.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quote-email-card.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quote-form-contact-picker.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quote-form-item-card.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quote-form.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quote-form.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quote-pdf-viewer.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
rewrite-quote-modal.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
service-worker-registration.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
sidebar.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
sidebar.tsx feat(orders): add Order Sprint page + process modal + sidebar entry 2026-07-29 17:50:21 +02:00
sprint-item-pricing-modal.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
supplier-form.test.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
supplier-form.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
supplier-map.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
theme-bootstrap.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
theme-picker.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
theme-provider.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
traffic-tiles.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00