Skip to content

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

  1. Host arrives Friday at 19:30, scans card
  2. ESP32 finds entry: SCHEDULED, time slot with overnight window
  3. Current time (Friday 19:30) is after start (19:00) on a matching day — access granted
  4. Host re-enters at 00:30 Saturday morning
  5. Current time is before end (02:00) of the overnight window — still granted

Alternative Flows

A1: Host initiates space shutdown, someone forgot something

  1. Event goes past the 02:00 window end
  2. At 02:45, host presses the shutdown button (space shutdown)
  3. Host exits at 02:47 (mechanical exit always possible)
  4. At 03:05, a guest realizes they left their jacket
  5. Grace period (30 min) counts from shutdown (02:45), so grace runs until 03:15
  6. Guest scans card at 03:05 — access granted with GRANTED_GRACE
  7. Grace resets from 03:05, new window until 03:35

Error Flows

E1: Host tries to enter Saturday afternoon

  1. Host scans card Saturday at 14:00
  2. The overnight window only covers Friday 19:00 to Saturday 02:00
  3. 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).