1.2 KiB
1.2 KiB
Order Items Naming Standard (PocketBase)
Goal
Use one consistent, driver-oriented naming convention in order_items with drv_* prefixes.
Recommended Canonical Fields
item_status(global item lifecycle)drv_status(driver/collection lifecycle)drv_id(relation to driver/user table)drv_assigned_atdrv_collected_atdrv_problem_flagdrv_problem_typedrv_problem_notes
Transition Mapping
During migration, support these aliases in API:
driver_status->drv_statusdriver->drv_idproblem_flag->drv_problem_flagproblem_type->drv_problem_typeproblem_notes->drv_problem_notes
Safe Migration Plan
- Add new
drv_*fields (keep old fields temporarily). - Backfill new fields from existing values.
- Update UI and automation writes to new fields only.
- Keep read-compat for old fields for 1-2 release cycles.
- Remove deprecated fields once no writers remain.
Minimal State Model
item_status:pending,processing,po_generated,ready_delivery,delivered,cancelleddrv_status:unassigned,assigned,en_route,collected,failed
Keep item lifecycle and driver lifecycle separate to avoid status collisions.