Skip to content

feat: audit infrastructure - actions, resolvers, and formatters#261

Merged
paymonsattar merged 2 commits intomainfrom
feat/hrp-296-audit-infrastructure
Apr 7, 2026
Merged

feat: audit infrastructure - actions, resolvers, and formatters#261
paymonsattar merged 2 commits intomainfrom
feat/hrp-296-audit-infrastructure

Conversation

@paymonsattar
Copy link
Copy Markdown
Collaborator

@paymonsattar paymonsattar commented Apr 1, 2026

Describe your changes

  • Adds the foundation for granular audit trail entries.
  • Audit templates now support metadata placeholders (old/new values, entity names, file names, folder names) resolved at display time, replacing the generic "X was updated" messages.
  • Added dedicated resolvers for diffing complex entity types — contacts, inspectors, procedures, outcomes, related/linked cases — that compare old and new state by ID and produce specific audit entries for each added, updated, or deleted item and sub-field.
  • Shared formatting utilities extracted for reuse across resolvers.

Issue ticket number and link

https://pins-ds.atlassian.net/browse/HRP-296

Copy link
Copy Markdown
Collaborator

@oscargay oscargay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, this is a very readable addition that I can see being easy to add new items to. Only a few comments, the main things are:

  1. Some of the resolves are 1 long function and it could be nice to break them down a little more into sub functions
  2. Overall this adds a layer of technical overhead, when adding a new feature a developer will need to know that they have to check & potentially add to the resolvers to get the audit to work, this is fine but we need some way of making sure that this doesn't slip through the cracks in future dev work - what do you think? It could be a documentation thing!

Great work!

Comment thread apps/manage/src/app/audit/resolvers/contact-resolver.ts
Comment thread apps/manage/src/app/audit/resolvers/inspector-resolver.ts Outdated
Comment thread apps/manage/src/app/audit/resolvers/procedure-outcome-resolver.ts Outdated
Copy link
Copy Markdown
Collaborator

@oscargay oscargay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice!

@paymonsattar paymonsattar merged commit 0c9722d into main Apr 7, 2026
5 checks passed
@paymonsattar paymonsattar deleted the feat/hrp-296-audit-infrastructure branch April 7, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants