Description
Every admin adjustment to slot inventory (create/update/delete) writes an audit row {who, when, before, after, reason} and appears in a searchable admin UI feed.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/routes/admin/slots.ts, src/services/auditLog.ts
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/slot-inventory-audit
- Implement changes
- Wrap admin slot handlers in an
audit() helper capturing before/after
- Require
reason field on the request body (min 10 chars)
- Add
GET /admin/audit/slots with paginated feed
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- missing reason (400), no-op change (skip audit), rollback on downstream failure
- Include test output and security notes
Example commit message
feat: audit log for admin slot changes
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Every admin adjustment to slot inventory (create/update/delete) writes an audit row
{who, when, before, after, reason}and appears in a searchable admin UI feed.Requirements and context
src/routes/admin/slots.ts,src/services/auditLog.tsSuggested execution
git checkout -b feat/slot-inventory-auditaudit()helper capturing before/afterreasonfield on the request body (min 10 chars)GET /admin/audit/slotswith paginated feedTest and commit
npm testExample commit message
feat: audit log for admin slot changesGuidelines