Commit graph

76 commits

Author SHA1 Message Date
SJCoetz
0b03a6cb81 style(collection-pool): promote time-in-list to text-primary 2026-07-10 23:44:27 +02:00
SJCoetz
c989d0d12e feat(collection-pool): sort by supplier name first 2026-07-10 23:41:45 +02:00
SJCoetz
4662347ca0 feat(collection-pool): add buildSupplierGroups helper 2026-07-10 23:39:05 +02:00
SJCoetz
cdaa2e2b25 fix, feat, style: standardize quote numbers, polish UI
- Standardize quote number format from Q-YYYY-MM-NNN to QYYYYMMNNN across all client, server, test and API code
- Add atomic backfill logic for quote counters to avoid sequence collisions with existing records
- Rearrange Delivery Notes and Repairs to the Operations sidebar section
- Add supplier count badge to pricelist catalogue and improve filter tab overflow styling
- Optimize font loading in root layout to skip preloading unused font weights
- Improve table styling for customer and company pages with better text wrapping and empty states
- Fix rep display logic in quotes page to show "Unassigned" when no rep is assigned
- Add supporting documentation, PocketBase counter schemas and setup migration scripts
- Remove embedded SupplierMap from suppliers page for cleaner layout
- Improve invoice card layout for company and customer info spacing
- Improve filter label styling and accessibility in collection map page
2026-07-10 22:21:50 +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
ae66762b76 feat(invoicing): add per-order color stripe on group sections 2026-07-10 02:09:29 +02:00
SJCoetz
bbd1e1df7c feat(collection-confirm): add per-order color stripe on group sections 2026-07-10 02:07:25 +02:00
SJCoetz
6477ebafcc feat(order-color): add FNV-1a hash helper for per-order color stripes 2026-07-10 02:05:45 +02:00
SJCoetz
4985b8c946 test(order-color): pin colorForOrder behaviour 2026-07-10 02:04:38 +02:00
SJCoetz
6d03be2ebc feat(collection-confirm): rewrite row card as stacked vertical sections 2026-07-10 01:07:29 +02:00
SJCoetz
9ab4be2666 feat(collection-confirm): show signed-in-as pill in the page header 2026-07-10 01:02:59 +02:00
SJCoetz
6074e79be0 fix(collection-confirm): hydrate actor from dev-identity cookie, not localStorage 2026-07-10 01:01:24 +02:00
SJCoetz
579acb300f style(assign-driver): give the action button more breathing room from the modal edge 2026-07-10 00:53:55 +02:00
SJCoetz
961d09a798 fix(collection-map): use ISO 8601 UTC bounds for assigned_at day filter 2026-07-10 00:51:17 +02:00
SJCoetz
1846e86b9e test(collection-map): cover assigned_at clear on unassign 2026-07-10 00:49:36 +02:00
SJCoetz
5ce3ef1000 fix(collection-map): clear assigned_at on unassign so item returns to pool 2026-07-10 00:48:23 +02:00
SJCoetz
72b2ec09e2 test(collection-pool): simplify operational sort test + correct spec reasoning 2026-07-10 00:38:31 +02:00
SJCoetz
363cdebe36 test(collection-pool): pin nearby-sort behaviour for missing coords 2026-07-10 00:36:28 +02:00
SJCoetz
e5285e67df chore(collection-pool): rename labels Ready/Pending instead of Ready/Awaiting 2026-07-10 00:24:43 +02:00
SJCoetz
32194e8bb3 feat(collection-pool): require note on Mark Ready 2026-07-10 00:15:24 +02:00
SJCoetz
1698e3d05b test(collection-pool): cover MarkReadyDialog behaviour 2026-07-10 00:11:53 +02:00
SJCoetz
58d7c90e77 feat(collection-pool): add MarkReadyDialog component 2026-07-10 00:08:18 +02:00
SJCoetz
00fb9a38f0 test(collection-map): cover ready_notes required-on-ready 2026-07-10 00:05:54 +02:00
SJCoetz
13165bfb8c feat(collection-map): require ready_notes when marking ready 2026-07-10 00:04:01 +02:00
SJCoetz
0eef0abd92 feat(orders): make Send PO modal wider and two-column, scrollable body 2026-07-09 23:48:26 +02:00
SJCoetz
f44f090351 test(po-attachments): use node env so the 25 MB cap assertion works 2026-07-09 23:39:12 +02:00
SJCoetz
0e59d83107 feat(mcp): add purchase_orders.add_attachment tool 2026-07-09 23:37:42 +02:00
SJCoetz
a6139b7c8a chore(orders): drop unused attachmentsLoading state from Send PO panel 2026-07-09 23:34:51 +02:00
SJCoetz
14e1a12cfe feat(orders): add additional attachments panel to Send PO modal 2026-07-09 23:33:56 +02:00
SJCoetz
2b3b50596c feat(po): include additional_attachments in send-email webhook 2026-07-09 23:25:05 +02:00
SJCoetz
9bc9d389ce test(po-attachments): use NextRequest instead of any cast 2026-07-09 23:20:10 +02:00
SJCoetz
1477265db9 feat(po-attachments): add delete route for PO additional attachments 2026-07-09 23:18:51 +02:00
SJCoetz
fff095caae test(po-attachments): cover delete route behaviour 2026-07-09 23:16:53 +02:00
SJCoetz
b362d92256 feat(po-attachments): add upload route for PO additional attachments 2026-07-09 23:15:08 +02:00
SJCoetz
a16b8fcdcb test(po-attachments): cover upload route behaviour 2026-07-09 23:01:55 +02:00
SJCoetz
d204a4715b feat(po): add additional_attachments to PurchaseOrder type 2026-07-09 23:01:07 +02:00
SJCoetz
dfe52a62d9 fix(orders): seed Send PO body with this PO's line count, not the order's 2026-07-09 22:43:52 +02:00
SJCoetz
44db71e6d7 feat(orders): add n8n shortcut icon to Supplier POs card 2026-07-09 22:34:04 +02:00
SJCoetz
f146e42ed0 test(po-pdf): cover token capture + proxy routing 2026-07-09 22:23:49 +02:00
SJCoetz
6a7dcc0af2 fix(po-pdf): capture PB token on upload and route GET through proxy 2026-07-09 22:18:53 +02:00
SJCoetz
1e99d23e8b feat(po-pdf): add token field to PurchaseOrderDocumentEntry 2026-07-09 22:17:21 +02:00
SJCoetz
2bee7aa4be feat(quotes/process): load customers with company expanded for picker 2026-07-09 21:45:00 +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
SJCoetz
17ae928331 refactor: update pool UI, fix tiles and config
overhaul the collection pool page's ready status UI: split the clickable chip into a static status indicator and dedicated toggle button with loading state, improving user clarity between status and actionable elements
update all related copy (toast messages, filter labels, button text) to use consistent "awaiting supplier confirmation" terminology across the interface
remove invalid `transparent` prop from traffic tile layers in both the collection map and traffic tiles components, update comments to reflect Leaflet does not support this option
add wildcard to allowedDevOrigins in next.config.ts to simplify local development testing across different network interfaces
add a comprehensive database backfill script to fix assigned order items missing the `ready_for_collection` flag, ensuring drivers see their correct assigned stops in the driver app
2026-07-07 18:01:43 +02:00
SJCoetz
7f924ccc45 refactor: switch hardcoded UI colors to semantic theme tokens
Overhaul the app's color system by replacing all hardcoded Tailwind color classes with semantic theme variables to ensure consistent theming across all components, pages, and tests.

Additional changes:
- Add assigned date support for order item status updates: add `assignedDate` field to the order item status PATCH API, implement server-side normalization/validation, and add corresponding tests
- Refactor purchase order PDF workflows to use the consolidated `purchase_orders.documents` field instead of the legacy separate `purchase_order_pdfs` collection
- Fix quote number parsing and formatting to support both dashed (Q-YYYY-MM-NNN) and dashless (QYYYYMMNNN) formats
- Rename `driver_pool` item status to `collection_pool` across the codebase
- Add null handling for order item quantities and pricing to display "—" for missing values
- Improve filter tab styling: make mobile tabs scrollable, prevent text wrapping, hide scrollbar
- Add new utility scripts, API routes, migrations, and polish small UI/UX fixes including tsconfig updates and theme hook improvements
2026-07-07 17:22:03 +02:00
SJCoetz
235c0ad39b fix(attachment-counts api): surface real error details instead of generic PB admin message
capture the thrown error, extract its message if available, and append it to the base "PB admin unavailable" error response. fall back to a generic unknown error message for non-Error failures, revealing actionable debugging details like missing env vars or invalid PB credentials.
2026-07-03 22:52:39 +02:00
SJCoetz
05abe499b0 feat(sprint): add new sprint pricing workflow and supporting code
Add full sprint pricing workflow and supporting infrastructure:
- New sidebar navigation entry for the sprint dashboard
- PocketBase category collection schema and migration script
- Server API routes for sprint item claims, attachments, counts, and file proxying
- Dev identity utilities and UI switcher for multi-user testing
- Reusable FilterTabs component replacing ItemStatusTabs
- Updated TypeScript types for sprint-related entities

Also include:
- Fix PocketBase file URL method casing (getUrl → getURL) across codebase
- Add development utility, smoke test, and helper scripts
- Update package.json with new sprint migration command
2026-07-03 07:29:43 +02:00