UC-004: Room Cleaner Access¶
Actor: Room Cleaner (service provider) Priority: Should Status: Implemented (protocol + firmware allow-list evaluation)
Summary¶
A room cleaner enters the space on a fixed weekly schedule to clean, with anomaly reporting for out-of-schedule access attempts.
Preconditions¶
- Admin has registered the cleaner with a weekly scheduled access rule
- Schedule: Wednesday and Friday, 08:00–11:00
- NOTIFY_ON_ANOMALY flag is set to detect unusual access patterns
Main Flow¶
- Cleaner arrives Wednesday at 08:30
- Scans NFC card at the terminal
- ESP32 finds entry: SCHEDULED, time slot matches (Wed, 08:00–11:00)
- Access granted, door unlocks
Alternative Flows¶
A1: Cleaner runs late¶
- Cleaner finishes at 11:20, leaves and space shutdown happens at 11:25
- At 11:35, cleaner realizes a mop was left inside
- Grace period (15 min) counts from shutdown (11:25), so grace runs until 11:40 — access granted with GRANTED_GRACE
- Grace period resets from this re-entry (11:35), new window until 11:50
- If the cleaner had come back at 11:45 instead (20 min after shutdown, past original grace but within reset), still granted
- Anomaly notification is queued (NOTIFY_ON_ANOMALY)
A2: Cleaner tries outside schedule¶
- Cleaner scans card on Monday
- Day mask does not include Monday
- Access denied
- Anomaly notification is queued (NOTIFY_ON_ANOMALY + NOTIFY_ON_DENY)
- Admin is alerted to the unusual access attempt
Error Flows¶
E1: Contract ended¶
- Admin sets valid_until to the contract end date
- Cleaner scans card after the date — access denied
- Card can be reclaimed
Postconditions¶
- Door unlocks during the scheduled cleaning window
- Any out-of-schedule usage generates an anomaly notification to the admin
Access Rule¶
- Access type: SCHEDULED
- Time slots: Slot 1: Wed 08:00–11:00, Slot 2: Fri 08:00–11:00
- Notifications: NOTIFY_ON_ANOMALY | NOTIFY_ON_DENY
- Grace period: 15 minutes
- valid_until: Contract end date
Notes¶
- The combination of NOTIFY_ON_ANOMALY and NOTIFY_ON_DENY gives admins visibility into both successful out-of-hours access (grace period) and denied attempts.
- The cleaner can always lock the door when leaving, even after the window closes. Note: the cleaner typically does not perform space shutdown — they lock the door on their way out, but a keyholder is responsible for the overall space state.