feat(audit): immutable contract audit log API - #205
Open
Carlys17 wants to merge 1 commit into
Open
Conversation
- Add contract_audit_logs table (append-only, UUID PK, SERIAL FKs) Tracks: contract_creation, milestone_creation, milestone_submission, approval, rejection, dispute_creation, dispute_resolution, contract_completion - Add ContractAuditLogService with createLog + listLogs (pagination + filters: contractId, projectId, action, actorUserId, date range) - Add /api/audit-logs POST + GET routes (withAuth, role-scoped access) - Wire audit log in contracts/deploy (contract_creation) and milestones/route (milestone_creation, when milestone has contract_id) - Access control: only contract participants or admins can access logs - Indexes for efficient paginated queries Closes Lumina-eX#187
|
@Carlys17 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add immutable application-level audit trail for contract actions (contract creation, milestone lifecycle, approval/rejection, disputes, completion).
Changes
contract_audit_logstable with UUID PK, SERIAL FKs, 8 action types, indexed for paginated queriesContractAuditLogServicewithcreateLog(append-only) andlistLogs(pagination + filters: contractId, projectId, action, actorUserId, date range)withAuthand role-scoped access (only contract participants or admins)Acceptance Criteria
Closes #187