WFDASH-WEBAPP/docs/order-items-schema-standard.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.2 KiB

Order Items Naming Standard (PocketBase)

Goal

Use one consistent, driver-oriented naming convention in order_items with drv_* prefixes.

  • item_status (global item lifecycle)
  • drv_status (driver/collection lifecycle)
  • drv_id (relation to driver/user table)
  • drv_assigned_at
  • drv_collected_at
  • drv_problem_flag
  • drv_problem_type
  • drv_problem_notes

Transition Mapping

During migration, support these aliases in API:

  • driver_status -> drv_status
  • driver -> drv_id
  • problem_flag -> drv_problem_flag
  • problem_type -> drv_problem_type
  • problem_notes -> drv_problem_notes

Safe Migration Plan

  1. Add new drv_* fields (keep old fields temporarily).
  2. Backfill new fields from existing values.
  3. Update UI and automation writes to new fields only.
  4. Keep read-compat for old fields for 1-2 release cycles.
  5. Remove deprecated fields once no writers remain.

Minimal State Model

  • item_status: pending, processing, po_generated, ready_delivery, delivered, cancelled
  • drv_status: unassigned, assigned, en_route, collected, failed

Keep item lifecycle and driver lifecycle separate to avoid status collisions.