Status History Tracking
Every status change is recorded in the statusHistory array within the BuylistOrder document:
- Initial Entry: When order is created, statusHistory includes: {previousStatus: null, newStatus: initialStatus, changedAt: timestamp}
- Subsequent Changes: Each status change adds entry: {previousStatus: oldStatus, newStatus: newStatus, changedAt: timestamp}
- Audit Trail: Complete history allows tracking when order moved through each stage
- Timestamp: Each entry includes changedAt field with exact Date/time of change
Custom Statuses
Stores can define custom statuses beyond the default ones. Custom statuses are managed via:
- GET /api/buylist/store/custom-statuses - List all custom statuses
- POST /api/buylist/store/custom-statuses - Add new custom status with id, name, color
- PUT /api/buylist/store/custom-statuses/:statusId - Update custom status
- DELETE /api/buylist/store/custom-statuses/:statusId - Delete custom status
- GET /api/buylist/store/default-status - Get default order status
- PUT /api/buylist/store/default-status - Set default order status (used for new orders)
Custom statuses can be used like default statuses but are not validated against ORDER_STATUSES enum. They support custom colors and labels for display in the UI.