Association Audit Logger
Component Detail
Infrastructure
low complexity
Shared Component
backend
0
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Infrastructure component that records all membership change events to the audit_logs table. Captures who made the change, which user was affected, which association was added or removed, whether primary status changed, and the timestamp — satisfying the audit trail requirement surfaced during NHF workshops for compliance and coordinator transparency.
association-audit-logger
Responsibilities
- Write audit log entries for membership add, remove, and primary-change events
- Capture acting admin user ID, affected user ID, association ID, and event type
- Store before/after state for primary association changes
- Support retrieval of membership change history for display in the admin UI
Interfaces
logMembershipAdded(actorId, userId, associationId)
logMembershipRemoved(actorId, userId, associationId)
logPrimaryChanged(actorId, userId, oldAssociationId, newAssociationId)
logBulkAssignment(actorId, userIds, associationId)
getAuditTrailForUser(userId)
getAuditTrailForAssociation(associationId)