Skip to content

Work entry audit log #11

@duchacekjan

Description

@duchacekjan

Overview

Track every WorkEntry mutation (create, update, delete) and surface the full history per day in a sidebar overlay on the worksheet page. History persists even after entries are deleted.

Design

  • Capture: EF Core ISaveChangesInterceptor — records audit in same transaction as mutation
  • Storage: Separate AuditLog table, no FK to WorkEntry (survives deletion)
  • Actor: PerformedBy = JWT name claim stored at write time
  • UI: History icon button on every day row → overlay sidebar with accordion timeline

See design handover and ADR in documents/work-entry-audit-log/.

Implementation plan

#2 (entity + migration)
  ├── #3 (interceptor)
  └── #4 (endpoint) ──── #5 (TS contracts + hook) ─── #6 (sidebar) ── #7 (wiring)

Acceptance criteria

  • All WorkEntry mutations captured by interceptor
  • Audit survives WorkEntry deletion
  • History sidebar visible on all day rows; shows correct events
  • Owner and admin can view history; non-admin cannot view other users
  • All tests pass (backend integration + Playwright UI)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions