-
Notifications
You must be signed in to change notification settings - Fork 20
feat: payment approval #7676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: payment approval #7676
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a backend payment approval workflow, allowing payments to be approved by designated approvers before execution. The changes add multi-step payment processing: create → approve → start, replacing the previous single-step approach.
Key Changes:
- New approver management system with CRUD endpoints for assigning users as payment approvers
- Payment approval flow requiring all designated approvers to approve before payment execution
- Refactored test helper from
createAndStartPaymenttodoPaymentto include the new approval step - Database migration adding
approverandpayment_approvalentities
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 24 comments.
Show a summary per file
| File | Description |
|---|---|
| services/121-service/src/user/approver/entities/approver.entity.ts | New entity linking users to program-level approver role with ordering |
| services/121-service/src/user/approver/entities/payment-approval.entity.ts | New entity tracking individual approvals for each payment |
| services/121-service/src/user/approver/approver.service.ts | Service for managing approvers (CRUD operations) |
| services/121-service/src/user/approver/approver.controller.ts | REST endpoints for approver management |
| services/121-service/src/user/approver/dto/*.ts | DTOs for approver creation, updates, and responses |
| services/121-service/src/payments/entities/payment.entity.ts | Added one-to-many relation to payment approvals |
| services/121-service/src/payments/services/payments-creation.service.ts | Added approval logic requiring all approvers to approve before transactions are marked as approved |
| services/121-service/src/payments/services/payments-execution.service.ts | Updated to process approved (not pending approval) transactions |
| services/121-service/src/payments/payments.controller.ts | Added POST endpoint for approving payments |
| services/121-service/test/helpers/program.helper.ts | Renamed createAndStartPayment to doPayment, added approval step |
| services/121-service/test/payment/payment-approval.test.ts | Added basic integration test for approval workflow |
| services/121-service/test/users/manage-approvers.test.ts | New test for approver CRUD operations |
| services/121-service/src/migration/1766058193913-approvers.ts | Database migration creating approver and payment_approval tables |
| All other test files | Updated to use renamed doPayment helper function |
services/121-service/src/user/approver/entities/approver.entity.ts
Outdated
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-creation.service.ts
Outdated
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-creation.service.ts
Outdated
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-creation.service.ts
Outdated
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-management.service.ts
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-management.service.ts
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-creation.service.ts
Outdated
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-creation.service.ts
Outdated
Show resolved
Hide resolved
services/121-service/src/payments/services/payments-creation.service.ts
Outdated
Show resolved
Hide resolved
49088d4 to
edfa470
Compare
AB#37510
Describe your changes
Checklist before requesting a code review
Portal preview-deployment
https://happy-rock-0411d2003-7676.westeurope.3.azurestaticapps.net