Expense Review Audit Writer
Component Detail
Description
Infrastructure adapter that writes a structured audit log entry to audit_logs for every approval state transition in the expense review workflow. Ensures Bufdir financial reporting requirements for traceability are met by recording actor, action, target, and timestamp for every reviewer decision.
expense-review-audit-writer
Sources & reasoning
Bufdir financial reporting requires a traceable audit trail for every reimbursement decision. The writer is separated from the approval service to enforce that audit entries are always produced as a side-effect of state transitions, independent of whether the caller remembers to invoke it explicitly.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Write audit_logs entries for approve, reject, and request-correction events
- Capture reviewer identity, expense reference, organization, and ISO timestamp
- Write bulk-approval audit entries per record even when batched
- Format audit payloads consistently with the platform-wide audit schema
Interfaces
logApprovalAction(actorId, expenseId, orgId, action, metadata)
logBulkApprovalActions(actorId, expenseIds[], orgId, action)
Related Data Entities (2)
Data entities managed by this component