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> |
||
|---|---|---|
| .. | ||
| (app) | ||
| (auth) | ||
| (counter) | ||
| (tv) | ||
| api | ||
| favicon.ico | ||
| globals.css | ||
| layout.tsx | ||
| offline.tsx | ||
| page.tsx | ||