afterhours-shift-manager/tests/slack_bot
Adam Moussa 7733af6af0
Lock shift drops within 24h of start (#84) (#88)
A user can no longer `/oncall drop` a shift inside the 24h window before it
starts — inside that window coverage must be handed off via a verified swap
(target accepts) or opened by an admin.

- app.py: _within_drop_lock(date, shift_type) (24h before _shift_start);
  guard in _handle_drop after the ownership check. Admin `open` is a separate
  handler and is unaffected (bypasses the lock).
- Removed the now-unreachable 3CX-repoint-on-drop branch: a same-day shift is
  always inside the lock, so a drop never reaches mark_open for today.
- Help text + README note the 24h rule.
- tests: rewritten test_handle_drop (outside/inside-24h per shift type,
  weekend day, admin bypass, plus the existing guard-precedence cases) and
  direct _shift_start/_shift_started/_within_drop_lock helper tests. 185 passed.

Closes #84
2026-06-01 19:32:40 -04:00
..
conftest.py Add pytest suite and wire it into CI (#85) (#86) 2026-06-01 19:07:08 -04:00
test_handle_admin.py Add pytest suite and wire it into CI (#85) (#86) 2026-06-01 19:07:08 -04:00
test_handle_drop.py Lock shift drops within 24h of start (#84) (#88) 2026-06-01 19:32:40 -04:00
test_handle_pick.py Add pytest suite and wire it into CI (#85) (#86) 2026-06-01 19:07:08 -04:00
test_handle_register_rate.py Add pytest suite and wire it into CI (#85) (#86) 2026-06-01 19:07:08 -04:00
test_handle_swap.py Add swap-acceptance (verified-swap) flow (#87) 2026-06-01 19:22:55 -04:00
test_helpers.py Lock shift drops within 24h of start (#84) (#88) 2026-06-01 19:32:40 -04:00
test_parse_date.py Add pytest suite and wire it into CI (#85) (#86) 2026-06-01 19:07:08 -04:00
test_pickup_button.py Add pytest suite and wire it into CI (#85) (#86) 2026-06-01 19:07:08 -04:00
test_swap_accept_decline.py Add swap-acceptance (verified-swap) flow (#87) 2026-06-01 19:22:55 -04:00