UC-005: Overnight Event Access¶
Actor: Event Host (member or organizer) Priority: Must Status: Implemented (protocol + firmware allow-list evaluation)
Summary¶
An event host runs an event that starts in the evening and goes past midnight (e.g., a Friday night social from 19:00 until 02:00 Saturday).
Preconditions¶
- Admin has configured a scheduled access rule with an overnight time slot
- Time slot: Friday 19:00–02:00 (end < start indicates overnight window)
- Host has an NFC card with this rule
Main Flow¶
- Host arrives Friday at 19:30, scans card
- ESP32 finds entry: SCHEDULED, time slot with overnight window
- Current time (Friday 19:30) is after start (19:00) on a matching day — access granted
- Host re-enters at 00:30 Saturday morning
- Current time is before end (02:00) of the overnight window — still granted
Alternative Flows¶
A1: Host initiates space shutdown, someone forgot something¶
- Event goes past the 02:00 window end
- At 02:45, host presses the shutdown button (space shutdown)
- Host exits at 02:47 (mechanical exit always possible)
- At 03:05, a guest realizes they left their jacket
- Grace period (30 min) counts from shutdown (02:45), so grace runs until 03:15
- Guest scans card at 03:05 — access granted with GRANTED_GRACE
- Grace resets from 03:05, new window until 03:35
Error Flows¶
E1: Host tries to enter Saturday afternoon¶
- Host scans card Saturday at 14:00
- The overnight window only covers Friday 19:00 to Saturday 02:00
- Saturday afternoon is outside all time slots — access denied
Postconditions¶
- Door accessible from Friday evening through early Saturday morning
- Space shutdown event logged
Access Rule¶
- Access type: SCHEDULED
- Time slots: Slot 1: Fri 19:00–02:00 (overnight, end < start)
- Notifications: None
- Grace period: 30 minutes
Notes¶
- The firmware's overnight window logic checks: if end_hour < start_hour, the window spans midnight. Access is granted if current time is after start on a matching day OR before end the next morning.
- Multiple overnight events per week are possible using separate time slots (up to 4).