Commit graph

31 commits

Author SHA1 Message Date
Claude
3f82b0784d docs(spec): order-item context block (sprint modal + orders page)
Replaces the AI Insights section in order-sprint-process-modal with a
deterministic PocketBase-derived context block (last quote, last order,
last invoiced, stock). Same backend exposed as a popover trigger on
the orders detail page, replacing the existing AI-history ⓘ there.

Backend: new src/lib/server/order-item-context-service.ts +
GET /api/v1/order-items/[id]/context. Reuses pure helpers from
item-history-service (normaliseSkuForHistory, findBestDescriptionMatch,
aggregateSuppliers, computeCheapest).

UI: new <OrderItemContextPanel/> (inline expandable for the sprint
modal) and <OrderItemContextPopoverTrigger/> (ⓘ popover for orders
page). Apply = cost + supplier only; selling stays locked to the order.

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

Co-authored-by: Orca <help@stably.ai>
2026-08-07 02:16:31 +02:00
SJCoetz
3a954982d0 docs(spec): add Re-Send button on PO Sent tab of buyer-tasks
Co-authored-by: Orca <help@stably.ai>
2026-08-06 17:33:25 +02:00
SJCoetz
a663de2d36 docs(spec): clarify placement of vat computation
Co-authored-by: Orca <help@stably.ai>
2026-08-06 11:45:11 +02:00
SJCoetz
3beedc7ad6 docs(spec): add 15% VAT to supplier-facing PO PDF
Co-authored-by: Orca <help@stably.ai>
2026-08-06 11:44:54 +02:00
SJCoetz
286043cace docs(stock-orders): design spec for cell wrap + PDF downloads
Two small additions to /stock-orders:
- Wrap long text in Number + Supplier columns
- Two PDF download buttons (Stocktake PDF, Orders PDF)

Both PDFs always include all rows, ignore the active status
filter and pagination. No persistence — throwaway reports.

Design reviewed: covers architecture, data model, API contract,
error handling, testing, and manual smoke. No new PB schema,
no new types.

Co-authored-by: Orca <help@stably.ai>
2026-08-03 15:54:24 +02:00
SJCoetz
9489cf3a44 docs(stock-orders): design total-value columns on list table
Add an Approved design doc for the /stock-orders list table: two new
currency columns (Ordered, Received) showing sum(line.quantity *
line.cost_price) and sum(line.quantity_received * line.cost_price) per
stock purchase. Migrates the page from client-side direct PB read to
the service layer per AGENTS.md.

Co-authored-by: Orca <help@stably.ai>
2026-08-03 14:09:10 +02:00
SJCoetz
fc17b46f9a docs(buyer-tasks): design for mail-failed PO recovery in PO Draft tab
Mail-failed POs currently vanish from every buyer-tasks tab because
the po_draft and po_sent filters both exclude the 'mail_failed' status.
This adds a focused design that surfaces them in place inside PO Draft
with a red warning row + 'Resend' button that re-opens the shared
SendPoModal.

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

Co-authored-by: Orca <help@stably.ai>
2026-08-03 10:25:51 +02:00
SJCoetz
d1c5ea0643 docs(specs): add collection confirm revamp design
Removes the Adjust Quantity modal, surfaces invoice photos in a per-PO
strip, exposes inline-editable cost prices, and migrates the page to a
thin service layer (listCollectedItems, updateOrderItemCost,
confirmOrderItemsForInvoicing) with three new /api/v1 routes. Cost edits
are audited in the existing notes feed as category=cost entries; confirm
is one PocketBase batch.

Co-authored-by: Orca <help@stably.ai>
2026-08-02 23:23:11 +02:00
SJCoetz
23e8e94d7c docs(specs): stock quick-draft modal design
Adds spec for the new item-first quick-draft modal on /stock-orders:
item-first stock-order entry, accumulates per supplier into draft POs,
reuses existing Send/Receive flow. No schema changes.

Co-authored-by: Orca <help@stably.ai>
2026-07-30 21:26:47 +02:00
SJCoetz
fe1af217e0 docs: buyer tasks page design spec
Co-authored-by: Orca <help@stably.ai>
2026-07-29 19:35:44 +02:00
SJCoetz
03ca2c8d29 docs: clarify customer non-nullable, full-order scope, collision link, partial-fail UX
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
2026-07-29 13:54:21 +02:00
SJCoetz
20533bcddf docs: design for orders review modal (amber icon + inline edit + attachment preview)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
2026-07-29 13:53:36 +02:00
SJCoetz
74b7d4433f docs(spec): item history popover redesign — build both data sources, compare for 1 week
Redesign the per-item ⓘ popover on /sprint so it surfaces actionable history
(cheapest supplier, other quotes to this company, last sold, recommendation)
instead of the current decorative rainbow card.

- Deterministic PB-join service (new) computes suppliers, other quotes, last
  sold, stock from existing collections.
- Existing n8n AI blob keeps running — render side by side for comparison.
- After 1 week: delete whichever data source loses on speed / freshness /
  cost.
- Process orders section is a separate follow-up round.

Also ignore .superpowers/ (visual companion mockups are local-only).

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

Co-authored-by: Orca <help@stably.ai>
2026-07-29 13:51:25 +02:00
SJCoetz
046683c506 feat: add tangerine theme, new docs and plugin stubs
Add full Tangerine brand theme with light and dark mode variants to the app theme system.
Add four new design and integration documents for collection pool, map and driver app workflows.
Add initial scaffolding for three new plugin source directories for the collection pool bulk assignment feature.
2026-07-14 11:48:10 +02:00
SJCoetz
02458909f7 docs(collection-map): tighten Refresh-button open question wording 2026-07-11 23:31:41 +02:00
SJCoetz
191668088c docs(collection-map): spec — drop filter console + collapse pin taxonomy
Two-pin model per supplier bucket: blue circle + letter per driver,
amber circle + ✓/✕ for unassigned. Filters (status, readiness, driver
multi-select, search) all leave; date picker stays. No backend or
schema changes. Awaiting user review before plan + implementation.
2026-07-11 23:31:17 +02:00
SJCoetz
47b01bddfa feat: add picking slips, bulk print tracking, supplier map
- Add Supplier Map component to suppliers page and reorganize sidebar navigation
- Implement picking slip PDF generation with supplier per line item and picked-by signature footer
- Add invoice bulk print tracking API and view models to track printed invoice state
- Extend company search and form to support email/telephone fields and improve searchability
- Fix data table debounce race condition by using useRef for onSearch handler
- Fix supplier page fetch race condition with debounced timeout
- Reduce list page item counts to 10 per page for customers, companies, and suppliers
- Update company search filter to include email and telephone in search queries
- Add comprehensive test suite for new and existing components and APIs
- Add pdf-lib dependency for PDF generation and update related tooling
- Clean up unused code and fix minor linting issues
2026-07-10 10:47:11 +02:00
SJCoetz
0d508095f0 Add order color stripe spec 2026-07-10 02:03:16 +02:00
SJCoetz
683b6c8d0a Add collection confirm rewrite spec 2026-07-10 00:59:26 +02:00
SJCoetz
728bab1671 Add collection map date filter and unassign spec 2026-07-10 00:47:42 +02:00
SJCoetz
72b2ec09e2 test(collection-pool): simplify operational sort test + correct spec reasoning 2026-07-10 00:38:31 +02:00
SJCoetz
8d742e5e87 Add collection pool nearby sort spec 2026-07-10 00:30:14 +02:00
SJCoetz
dbbb3e2b2c Add collection pool mark-ready notes spec 2026-07-10 00:00:40 +02:00
SJCoetz
e19bb7dbf7 Add PO additional attachments spec 2026-07-09 22:55:16 +02:00
SJCoetz
538986d7db Add PO PDF token-vs-filename spec 2026-07-09 22:13:53 +02:00
SJCoetz
1a3ce560c6 Add customer search company-disambiguation spec 2026-07-09 21:31:45 +02:00
SJCoetz
1992b0f4af Add new quote form redesign spec 2026-07-09 17:53:44 +02:00
SJCoetz
18334721cb feat(invoicing): add QuickBooks invoicing flow and print functionality
Add complete end-to-end QuickBooks invoicing workflow for the invoicing page:
- Add `jspdf` dependency for client-side PDF generation
- Implement updated item status handling with fallback for new invoice statuses
- Add server-side proxy API for secure QuickBooks customer lookup
- Build utilities to combine QuickBooks invoices and picking slips into a single PDF
- Add invoicing view models for row grouping, payload construction, and status checks
- Add full test coverage for all new components, APIs, and utilities
- Include feature design documentation and sample n8n workflow config
2026-07-09 09:44:55 +02:00
SJCoetz
9378685164 feat(collection-confirm): add full collection confirm workflow
Implement the complete collection confirm feature set:
- Add new `/collection-confirm` operational page for reviewing and confirming collected order items
- Add sidebar navigation entries for Collection Confirm and Invoicing
- Add `order_items` to the file proxy API whitelist for attachment access
- Install required testing dependencies and configure Vitest test setup
- Add full design documentation, test suite, and page overview screenshot
- Update package.json and build configuration files
2026-07-08 01:35:00 +02:00
SJCoetz
5f1838051f feat(collection-pool): add nearby supplier cluster sort mode
Add optional nearby-supplier cluster sort mode to the collection pool table, keeping operational sort as the default. Also includes:
- Update UserSearch component to support fallback selected label for pre-selected values
- Refactor AssignDriverDialog into a separate inner component with intent and pre-filled driver label support
- Add assignment badge helper types and functions
- Add full test coverage for new sort logic and component behaviors
- Update implementation plans and documentation files
- Fix minor code consistency and lint issues across touched files
2026-07-07 21:56:29 +02:00
SJCoetz
b9828def38 feat(collection-pool): add unified redesigned collection pool view
Remove redundant Assign Drivers top-level navigation link since driver assignment is now embedded directly in the collection pool page per-row, and add an Other nav section for leftover navigation items
Extract collection pool view logic into a dedicated view-model module with full Vitest test coverage for assignment state classification, row sorting, pool age labeling, and proximity marker grouping
Flatten the collection pool page into a single unified list replacing the old grouped assigned/unassigned layout, with updated row UI showing all required operational details and context-aware actions
Add database migration to add optional `collection_photo` field to order_items for driver pickup proof photos
Add complete design documentation, planning artifacts, and brainstorming session files for the collection pool redesign project
2026-07-07 20:49:31 +02:00