Dependencies: Issue #27, Issue #28.
Context:
Sensitive actions must be recorded for security and compliance.
Tasks:
- Create an
audit_logs table/entity with fields:
id, merchant_id (nullable), actor_type, actor_id (nullable), action, target_type, target_id, metadata, created_at
- Add a lightweight audit log service with helper methods.
- Log at least:
- API key create/revoke
- webhook create/delete
- withdrawal request
Implementation Notes:
- Don’t log secrets (API keys, webhook secrets) — log identifiers and metadata only.
Scope:
- In scope: DB table + service + usage in endpoints.
- Out of scope: Admin UI.
Files: backend/api_gateway/src/audit/
Dependencies: Issue #27, Issue #28.
Context:
Sensitive actions must be recorded for security and compliance.
Tasks:
audit_logstable/entity with fields:id,merchant_id(nullable),actor_type,actor_id(nullable),action,target_type,target_id,metadata,created_atImplementation Notes:
Scope:
Files:
backend/api_gateway/src/audit/