WFDASH-WEBAPP/docs/orders-first-rollout.md
SJCoetz c4e1c62882 chore: standardize line endings and add full test + config scaffolding
Fix inconsistent line endings across all project files for cross-environment consistency.
Add complete unit test suite covering core utilities, API routes, and server services.
Add Playwright E2E test setup with smoke, auth, and agent API tests.
Update all project configuration files to match standardized formatting.
Fix MCP API error handling to properly propagate HTTP status codes and use correct JSON-RPC error codes.
Add VSCode workspace configuration, extensions, and example MCP config files.
Update .gitignore to exclude new test and build artifacts.
2026-06-11 20:30:02 +02:00

1.3 KiB

Orders-First Rollout Plan

What was implemented

  • POST /api/v1/orders/from-quote:
    • creates orders record from a quote
    • copies all quote_items into configured order-items collection
    • defaults to order_items, can target order_items using env var
  • GET /api/v1/collection-pool:
    • lists collection_pool records for driver/collection operations
  • MCP tools added:
    • orders.create_from_quote
    • collection_pool.list

New collection definitions ready for import

  • /D:/NEWBUILD/wfnextjs/docs/pocketbase/order_items.collection.json
  • /D:/NEWBUILD/wfnextjs/docs/pocketbase/collection_pool.collection.json

Create collections automatically

Run:

npm run pb:migrate:orders-v2

Required env vars:

  • NEXT_PUBLIC_POCKETBASE_URL
  • PB_ADMIN_EMAIL
  • PB_ADMIN_PASSWORD

Switch API writes to the new order-items collection

Set in .env.local:

ORDER_ITEMS_COLLECTION=order_items

This immediately makes quote-to-order conversion write to order_items.

Quote alignment checks now covered

  • Quote-to-order conversion enforces one path.
  • Each copied item gets:
    • item_status=pending
    • drv_status=unassigned
    • quote link via quote_item
  • Status patcher accepts drv_status and maintains backward compatibility.