Context
The application already uses audit logging in some flows, but user profile updates and account-related events do not consistently produce a structured history that can be reviewed later. This makes it harder to trace account changes or support investigations.
Problem statement
Implement a structured audit log for user profile changes and other account-level events so that updates are traceable and can be reviewed through a consistent mechanism.
Current behavior
- Some flows create audit logs, but profile and account changes do not have a consistent audit trail across the service layer.
- The current audit log model is not fully leveraged for user-facing state changes.
Required behavior
- User profile and account-related updates should create audit entries with enough context to understand what changed and who performed it.
- The audit log should be consistent across update operations and easy to query later.
- The change should not break the existing user update workflow.
Constraints
- The change should preserve the current user and audit model where possible.
- The implementation should remain compatible with the existing Prisma schema and service patterns.
Acceptance criteria
Out of scope
- Building a full admin audit viewer UI.
- Rewriting the audit logging infrastructure.
Hints and references
- Review the existing audit log model and the user controller/service update paths for the best insertion point.
Context
The application already uses audit logging in some flows, but user profile updates and account-related events do not consistently produce a structured history that can be reviewed later. This makes it harder to trace account changes or support investigations.
Problem statement
Implement a structured audit log for user profile changes and other account-level events so that updates are traceable and can be reviewed through a consistent mechanism.
Current behavior
Required behavior
Constraints
Acceptance criteria
Out of scope
Hints and references