Skip to content

feat(mint): implement programmable approval workflow engine#265

Merged
kelly-musk merged 2 commits into
kellymusk:masterfrom
Harbduls:master
Mar 31, 2026
Merged

feat(mint): implement programmable approval workflow engine#265
kelly-musk merged 2 commits into
kellymusk:masterfrom
Harbduls:master

Conversation

@Harbduls
Copy link
Copy Markdown
Contributor

closes #221

  • Add multi-step, role-based approval pipeline for cNGN mint requests
  • Tier logic: Tier1 (<1M NGN, 1 approval), Tier2 (1M-10M, 2 approvals), Tier3 (>10M, 3 approvals)
  • State machine: pending_approval -> partially_approved -> approved -> executed (or rejected/expired)
  • RBAC middleware: extract_identity + require_any_mint_role guards all mint endpoints
  • Self-approval prevention and duplicate approval prevention enforced in service layer
  • Rejection requires mandatory reason_code, immediately transitions to rejected
  • Execution guard: assert_executable() blocks on-chain tx unless fully approved
  • Immutable audit trail on every state change via mint_audit_log table
  • Mint expiry worker: auto-expires stale requests past 24h deadline (configurable poll interval)
  • Complete HTTP handlers: submit, approve, reject, get, list, audit endpoints
  • Correct HTTP status codes: 403 forbidden, 409 conflict, 400 bad request, 404 not found
  • DB schema: mint_requests, mint_approvals, mint_audit_log with indexes and triggers
  • Graceful shutdown support for expiry worker

- Add multi-step, role-based approval pipeline for cNGN mint requests
- Tier logic: Tier1 (<1M NGN, 1 approval), Tier2 (1M-10M, 2 approvals), Tier3 (>10M, 3 approvals)
- State machine: pending_approval -> partially_approved -> approved -> executed (or rejected/expired)
- RBAC middleware: extract_identity + require_any_mint_role guards all mint endpoints
- Self-approval prevention and duplicate approval prevention enforced in service layer
- Rejection requires mandatory reason_code, immediately transitions to rejected
- Execution guard: assert_executable() blocks on-chain tx unless fully approved
- Immutable audit trail on every state change via mint_audit_log table
- Mint expiry worker: auto-expires stale requests past 24h deadline (configurable poll interval)
- Complete HTTP handlers: submit, approve, reject, get, list, audit endpoints
- Correct HTTP status codes: 403 forbidden, 409 conflict, 400 bad request, 404 not found
- DB schema: mint_requests, mint_approvals, mint_audit_log with indexes and triggers
- Graceful shutdown support for expiry worker
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 28, 2026

@Harbduls 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! 🚀

Learn more about application limits

@kelly-musk kelly-musk merged commit f6e1557 into kellymusk:master Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-Stage Mint Approval Workflow Engine

2 participants