A confirmed booking has no terminal state that tells apart a stay that actually took place from one the customer never showed up for. Once the slot passes, the order and its lines stay "confirmed" forever, so reporting cannot distinguish a honored booking from a no-show.
Proposed resolution
Add two terminal states at both levels, the per-line booking and the order (booking transaction):
- completed: a confirmed booking that was honored (the slot was used, attended).
- unused: a confirmed booking the holder never used (a no-show).
Both are added to the consuming states (a used or no-show line still occupied its slot), unlike released, expired and cancelled which free the capacity. The transitions run from the confirmed state only: BookingManager gains complete() and markUnused() (each dispatching a booking event), TransactionManager gains completeTransaction() and markUnusedTransaction(), and OrderManager exposes completeOrder() and markUnusedOrder() with both a generic action (for the admin and Views Bulk Operations) and a workflow action.
Aggregation
The order state aggregates its line states, and dropped lines (released, expired, cancelled) no longer count against a positive state. So an order stays confirmed when the holder cancels some lines and the rest are confirmed, and it is completed when the remaining lines were honored even if some were cancelled. A held line keeps the whole order pending; an order is cancelled only when every line was dropped; a genuine mix of live states is partial.
Example workflow
The booking example workflow sets the order state from the attendance outcome: attended and damaged mark the order completed, a no-show marks it unused. Three action nodes sit between the attendance user task and the deposit steps.
Tests
OrderTest covers the new transitions, the completed and unused aggregation, and the dropped-line cases (a cancelled line keeps the order completed, a released line keeps it confirmed).
Issue fork yoyaku-3609459
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedMR !9 opened.
Comment #5
mably commented