Skip to content

TK-90: Track audit trail for Information Sharing Agreement changes - #72

Draft
burkkyy wants to merge 1 commit into
mainfrom
tk-90/track-audit-for-the-changes-in-the-information-sharing-agreement
Draft

TK-90: Track audit trail for Information Sharing Agreement changes#72
burkkyy wants to merge 1 commit into
mainfrom
tk-90/track-audit-for-the-changes-in-the-information-sharing-agreement

Conversation

@burkkyy

@burkkyy burkkyy commented Sep 12, 2026

Copy link
Copy Markdown
Member

Context

Information Sharing Agreements are drafted and revised freely before they are published, so the first draft should not be recorded. Once an agreement is signed, every later change matters and must be traceable.

This adds an audit trail that stays off until an agreement is first signed, then records all subsequent activity.

Implementation

  • Add audit_enabled flag to information_sharing_agreements (backfilled true for already-published agreements) and a new information_sharing_agreement_audits table.
  • Signing an agreement turns auditing on and records a Signed entry; editing records Updated; reverting records Reverted to draft. Editing an agreement that has never been signed records nothing.
  • Read-only GET /api/information-sharing-agreements/:id/audits endpoint, scoped to system admins or the agreement creator.
  • Add an Audit tab to the admin agreement page, shown only once auditing is enabled, listing the trail with actor and timestamp.

Testing Instructions

  1. Run the test suite via dev test.
  2. Boot the app via dev up.
  3. Log in to the app at http://localhost:3000.
  4. Go to AdministrationInformation Sharing Agreements and open a Draft agreement.
  5. Verify there is no Audit tab (only Access Grants).
  6. Open the agreement's ISA page, complete and Sign it.
  7. Return to the admin agreement page and verify an Audit tab now appears.
  8. Click Audit and verify a Signed entry is listed with your name and the timestamp.
  9. Edit the agreement and save; verify an Updated entry appears.
  10. Revert the agreement to draft; verify a Reverted to draft entry appears and the Audit tab remains visible.

Fixes https://yg-hpw.atlassian.net/browse/TK-90

…r first publish.

Why? Agreements are drafted and revised freely before they are published,
so the initial draft should not be recorded. Once an agreement is signed,
every subsequent change matters and must be traceable.

What? Auditing is off until an agreement is first signed. Signing turns it
on and records a "Signed" entry; after that, edits record "Updated" and
reverting to draft records "Reverted to draft". A read-only Audit tab on the
admin agreement page lists the trail once auditing is enabled.

NOTE: adds an audit_enabled flag to information_sharing_agreements (backfilled
true for already-published agreements) plus an information_sharing_agreement_audits table.

See https://yg-hpw.atlassian.net/browse/TK-90
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.

1 participant