Skip to content

Conversation

@jannisvisser
Copy link
Contributor

@jannisvisser jannisvisser commented Dec 19, 2025

AB#37510

Describe your changes

  • WIP
  • Backend only
  • e2e tests are expected to fail because no front-end implemented
  • all other tests pass

Checklist before requesting a code review

  • I have performed a self-review of my code (and addressed any Copilot comments)
  • I have added tests for my changes, or: Adding tests is unnecessary/irrelevant
  • I have asked the design team to review these changes, or: The changes do not touch the UI/UX
  • I have made sure that all automated checks pass before requesting a review
  • I do not need any deviation from our PR guidelines
  • I have updated all documentation where necessary

Portal preview-deployment

https://happy-rock-0411d2003-7676.westeurope.3.azurestaticapps.net

Copilot AI review requested due to automatic review settings December 19, 2025 07:58
@jannisvisser jannisvisser added the enhancement New feature or request that affects our end users label Dec 19, 2025
@jannisvisser jannisvisser marked this pull request as draft December 19, 2025 07:58
@jannisvisser jannisvisser changed the title feat: BE payment approval feat: payment approval Dec 19, 2025
Copy link
Contributor

Copilot AI left a 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 createAndStartPayment to doPayment to include the new approval step
  • Database migration adding approver and payment_approval entities

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request that affects our end users

Development

Successfully merging this pull request may close these issues.

3 participants