Skip to content

Add "who moved my cheese" audit log for slot inventory adjustments by admins #599

Description

@thlpkee20-wq

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
    • npm test
  • 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

Metadata

Metadata

Assignees

Labels

Stellar WaveStellar Wave issue batchbackendBackend scopefeatureNew feature workobservabilityLogs, metrics, tracing, dashboardssecuritySecurity hardening and threat mitigation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions