feat(state-machine): auto-clear confirmAbandon after 60s

If a customer walks away from the abandon confirmation screen,
the machine now returns to idle after 60 seconds instead of
hanging indefinitely. Cash stays in the cashbox as operator funds.

Closes #31

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-03-27 10:20:58 -04:00
commit 44f8f803ae

View file

@ -507,7 +507,11 @@ export function createATMMachine(
},
},
confirmAbandon: {
// Warning: cash is in the machine, abandoning forfeits it
// Warning: cash is in the machine, abandoning forfeits it.
// Auto-clear after 60s so the machine self-recovers if customer walked away.
after: {
60000: '#atm.idle',
},
on: {
CANCEL: '#atm.idle', // User confirms they want to leave
RETRY: 'generatingNdebit', // Go back and try again