Description
Add an admin-only POST /admin/scheduler/pause and /resume pair, backed by a Redis flag, that freezes new booking-intent creation platform-wide during incidents while leaving read paths intact.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/routes/admin/scheduler.ts, src/middleware/schedulerGate.ts, src/redis.ts
- Emit
scheduler_pause_total and scheduler_resume_total counters
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/scheduler-pause
- Implement changes
- Store
scheduler:paused=1 in Redis with a reason and initiated_by
- Guard the booking-intent create route with a
schedulerGate middleware
- Broadcast paused status via the existing WebSocket bus
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Redis unavailable at guard time (fail-open with warning), pause then immediate resume, unauthorized caller
- Include test output and notes
Example commit message
feat: scheduler pause/resume with Redis flag
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Add an admin-only
POST /admin/scheduler/pauseand/resumepair, backed by a Redis flag, that freezes new booking-intent creation platform-wide during incidents while leaving read paths intact.Requirements and context
src/routes/admin/scheduler.ts,src/middleware/schedulerGate.ts,src/redis.tsscheduler_pause_totalandscheduler_resume_totalcountersSuggested execution
git checkout -b feat/scheduler-pausescheduler:paused=1in Redis with areasonandinitiated_byschedulerGatemiddlewareTest and commit
npm testExample commit message
feat: scheduler pause/resume with Redis flagGuidelines