WFDASH-WEBAPP/src/components
Dave 7986784eaf chore(tests): fix ~60 pre-existing TS errors across 11 test files
Typecheck cleanup after the deploy blocker push — `tsc --noEmit` was
silent on `d11a184` baseline but ~60 errors hid across test files
that only the compiler surfaces (the build was clean because test
files are excluded from the prod bundle). Touched:

- src/app/api/mcp/route.test.ts (16) — generic on `vi.fn()` for
  tuple inference; `as unknown as` two-step cast on record literals
- src/app/api/mcp/po-agent-workflow.test.ts (1) — spread instead of
  duplicate key
- src/components/buyer-tasks/buyer-task-group-card.test.tsx (5) —
  `PurchaseOrderEmailPayload` now requires `subject`/`body`
- src/components/collection-confirm/confirm-stock-dialog.test.tsx (1)
  — removed shadowed `id` from `makeRow` overrides
- src/components/item-intel-popover.test.tsx (2) — missing row
  fields + boolean→object for `verified`
- src/components/quotes/process-item-card.test.tsx (2) — full
  QuoteItem stub; generic on `vi.fn()`
- src/components/sprint-item-pricing-modal.test.tsx (3) — full
  SprintItem/QuoteItemAttachment/QuoteAttachment stubs
- src/lib/server/orders-service-review.test.ts (~60) — annotated
  `getOne` return type to break union widening on the expand option
- src/lib/server/orders-service.test.ts (2) — removed bogus
  `includeArchivedCounts` param; `rfq_number` now whitelisted on Order
- src/lib/server/quotes-service.test.ts (3) — two-step cast on
  Quote header; `unit?` now on QuoteItem
- src/lib/server/stock-purchase-items-service.test.ts (~10) — typed
  `pbMock` via `StockPurchaseItemsPb` so `*WithPb(pb,...)` checks

Also added two optional fields to `src/lib/types.ts`:
- `QuoteItem.unit?` — pre-2026 rows have no unit, so it's optional
- `Order.rfq_number?` — populated by the n8n email agent, inherited
  verbatim by `splitOrder`

Build: clean. Typecheck: 0 errors. Tests: 14 pre-existing runtime
failures + 1 pre-existing unhandled error in `supplier-form.test.tsx`
remain — confirmed they exist on `d11a184` baseline, so they are
outside the cleanup scope and unchanged by this commit.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-27 04:43:40 +02:00
..
buyer-tasks chore(tests): fix ~60 pre-existing TS errors across 11 test files 2026-08-27 04:43:40 +02:00
charts feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
collection-confirm chore(tests): fix ~60 pre-existing TS errors across 11 test files 2026-08-27 04:43:40 +02:00
delivery-notes fix(delivery-notes): move 'Add item' to per-card button after each row 2026-08-26 01:32:46 +02:00
invoicing feat: add split views, stock picking slips, and invoice viewer 2026-08-09 23:16:55 +02:00
purchase-orders fix(send-po-modal): seed default body when resend has no prior email_payload 2026-08-06 18:10:08 +02:00
quotes chore(tests): fix ~60 pre-existing TS errors across 11 test files 2026-08-27 04:43:40 +02:00
stock-orders feat(stock-orders): attachments card on detail page 2026-08-06 23:29:00 +02:00
ui feat(quotes): add "Include older" toggle for searching full quote history 2026-08-20 10:18:44 +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.test.tsx feat(ai-history): render item-history blob shape-aware 2026-07-30 13:56:39 +02:00
ai-insights-renderer.tsx feat(ai-history): render item-history blob shape-aware 2026-07-30 13:56:39 +02:00
ai-item-history-trigger.tsx feat(item-intel): add new item intel popover and backend workflows 2026-08-11 02:57:57 +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
cancel-order-dialog.tsx feat(orders,invoicing): add duplicate order cleanup and soft cancellation 2026-08-13 09:02:27 +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 refactor(forms): update layout and structure of form components 2026-08-17 23:34:30 +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 refactor(forms): update layout and structure of form components 2026-08-17 23:34:30 +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(quotes): add "Include older" toggle for searching full quote history 2026-08-20 10:18:44 +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
duplicate-orders-dialog.tsx feat(duplicate-orders): enhance duplicate order detection and UI 2026-08-16 11:25:00 +02:00
filter-tabs.tsx feat: collection-map updates, todays-stops, quote/approval rework, buyer-tasks, e2e 2026-08-03 09:33:45 +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 feat(ai-history): render item-history blob shape-aware 2026-07-30 13:56:39 +02:00
item-history-popover.tsx style(popover,modal): warn-toned AI card + warning-bordered modal 2026-07-30 14:12:59 +02:00
item-intel-popover.test.tsx chore(tests): fix ~60 pre-existing TS errors across 11 test files 2026-08-27 04:43:40 +02:00
item-intel-popover.tsx feat(deliveries): enhance delivery notes management and UI 2026-08-17 01:27: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(orders): move delivered+cancelled to dedicated /orders/archive page 2026-08-04 19:58:43 +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
margin-approval-dialog.tsx feat(order-items): below-22% margin approval workflow 2026-08-04 00:58:33 +02:00
order-form.tsx feat: collection-map updates, todays-stops, quote/approval rework, buyer-tasks, e2e 2026-08-03 09:33:45 +02:00
order-item-context-panel.test.tsx test(context): OrderItemContextPanel UI tests 2026-08-07 02:54:24 +02:00
order-item-context-panel.tsx chore(context): lint + build adjustments 2026-08-07 03:04:28 +02:00
order-item-context-popover-trigger.test.tsx test(context): OrderItemContextPopoverTrigger UI tests 2026-08-07 02:55:39 +02:00
order-item-context-popover-trigger.tsx chore(context): lint + build adjustments 2026-08-07 03:04:28 +02:00
order-sprint-process-modal.test.tsx feat(context): swap sprint modal AI Insights for context panel 2026-08-07 02:58:47 +02:00
order-sprint-process-modal.tsx chore(context): lint + build adjustments 2026-08-07 03:04:28 +02:00
orders-review-modal-mount.test.tsx refactor(orders): replace OrdersReviewModal with OrdersReviewModalMount and streamline attachment handling 2026-08-24 07:26:18 +02:00
orders-review-modal-mount.tsx refactor(orders): replace OrdersReviewModal with OrdersReviewModalMount and streamline attachment handling 2026-08-24 07:26:18 +02:00
orders-review-modal.test.tsx feat(orders): show From + Subject in review modal Source of truth header 2026-08-05 16:09:53 +02:00
orders-review-modal.tsx feat(orders): show From + Subject in review modal Source of truth header 2026-08-05 16:09:53 +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(quote-form): allow empty quantity input for operator convenience 2026-08-18 07:28:25 +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(tv-dashboard): enhance TV dashboard with driver stops and performance metrics 2026-08-19 10:16:49 +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(counter): add standalone counter order PWA 2026-08-13 09:27:20 +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 ui(sidebar): rename Hermes nav entry to Giellie 2026-08-04 20:29:34 +02:00
sprint-item-pricing-modal.test.tsx chore(tests): fix ~60 pre-existing TS errors across 11 test files 2026-08-27 04:43:40 +02:00
sprint-item-pricing-modal.tsx fix: resolve PocketBase expand projection bug 2026-08-06 01:33:16 +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 refactor(forms): update layout and structure of form components 2026-08-17 23:34:30 +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