Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2 KiB
2 KiB
Core Recheck Matrix (Quotes, Orders, Company, Customer)
Ground Rules
- Quotes workflow is separate from driver/pool workflows.
- Driver and collection states apply only after quote-to-order conversion on
order_items. - Order creation from quote must not mutate quote status.
1) Quotes Recheck
- Collections:
quotesquote_items
- Must verify:
- create quote
- add/edit/remove quote items
- claim/unclaim
- process status transitions (
new -> claimed -> processed -> emailed/approval_pending -> approved/rejected/complete) - email metadata fields persist
- API/logic check:
- quote actions never touch
drv_status,collection_pool, or driver assignment fields.
- quote actions never touch
2) Orders Recheck
- Collections:
ordersorder_items(new schema replacement)purchase_orderscollection_pool
- Must verify:
- create order from quote via API
- copied order item values (description/qty/supplier/pricing)
- order item status updates (
item_status+drv_status) - PO generation per supplier
- no quote status mutation on order creation
3) Company Recheck
- Collections:
companiescompany_details
- Must verify:
- list/search/pagination
- create/edit/delete
- relation usage in quotes/orders
- address/vendor consistency with old Django usage
4) Customer Recheck
- Collections:
customers
- Must verify:
- list/search/pagination
- create/edit/delete
- email fields (
email,alternative_email,buyer_email) - relation/linking in quotes/orders
- duplicate handling strategy (from old merge commands)
Current Alignment Status
- Quotes/order separation fixed in service layer.
- Orders-first API and MCP layer in place.
- New
order_itemsreplacement schema prepared for import. collection_poolschema prepared.
Next implementation focus
- Wire UI screens for
order_itemsnew fields while keeping same look/behavior. - Add explicit quote-to-order action in quote detail/process pages.
- Add a lightweight validation script for collection field drift vs expected schema.