feat(projects): record task and project edits in the audit trail (PMS-184) #155
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-184-task-edit-history"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Backend half of PMS-184: task and project edits now leave a real change-history record, so the project detail page can show a task's edit history with an "edited" marker.
Changes
update_taskandupdate_projectnow run as a transaction that snapshots the row before and after withto_jsonband writes an in-transactionaudit_logentry (entity_type=tasks/projects,entity_idset, before/after JSON), mirroring the establishedupdate_ticketpattern. A rollback drops the audit row with the change.entity_id-less row, so the per-record history endpoint had nothing to attribute to a specific task or project. Now every edit is captured with the exact columns that moved.Pairs with
The per-record history read endpoint (
GET /api/v1/audit-log/entity/{type}/{id}, PR #154) already whiteliststasksandprojects, so this lights up their detail-page history feeds. The SPA half is a separate mokosh-apps PR.Tests
task_and_project_edits_write_audit_rows: create a project + task, PUT a new task title and a new project name, then assert (directly againstaudit_log) that each produced an entity-scopedupdaterow whose old/new snapshots carry the changed value. Asserted against the table rather than the read endpoint so this PR stays independent of #154.🤖 Generated with Claude Code