Skip to content

block start payment if there are duplicates - #8846

Open
arsforza wants to merge 6 commits into
arsforza/feat.block-duplicate-inclusion-create-paymentfrom
arsforza/feat.block-start-payment-with-duplicates
Open

arsforza wants to merge 6 commits into
arsforza/feat.block-duplicate-inclusion-create-paymentfrom
arsforza/feat.block-start-payment-with-duplicates

Conversation

@arsforza

@arsforza arsforza commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

AB#44196
AB#44194

Describe your changes

Checklist before requesting a code review

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

Portal preview-deployment

This PR does not have any preview deployments yet.

Copilot AI lite review requested due to automatic review settings September 14, 2026 13:20
@arsforza arsforza added the enhancement New feature or request that affects our end users label Sep 14, 2026
@arsforza
arsforza changed the base branch from main to Piotrk39/feat.dry-run-check-for-duplicates-and-throw-on-duplicates-on-back-end September 14, 2026 13:21
@arsforza
arsforza changed the base branch from Piotrk39/feat.dry-run-check-for-duplicates-and-throw-on-duplicates-on-back-end to arsforza/feat.block-duplicate-inclusion-create-payment September 14, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds duplicate-registration safeguards across payment approval/start flows and portal status/payment creation workflows.

Changes:

  • Reuses duplicate validation for payment approval and execution.
  • Supports multiple transaction statuses in repository queries.
  • Adds portal dialogs, toasts, and localization updates.
File summaries
File Description
services/121-service/src/payments/transactions/repositories/transaction.view.scoped.repository.ts Updated as part of this pull request.
services/121-service/src/payments/services/payments-management.service.ts Updated as part of this pull request.
services/121-service/src/payments/services/payments-helper.service.ts Updated as part of this pull request.
services/121-service/src/payments/services/payments-helper.service.spec.ts Updated as part of this pull request.
services/121-service/src/payments/services/payments-execution.service.ts Updated as part of this pull request.
interfaces/portal/src/locale/messages.xlf Updated as part of this pull request.
interfaces/portal/src/app/pages/program-registrations/components/change-status-dialog/change-status-dialog.component.ts Updated as part of this pull request.
interfaces/portal/src/app/pages/program-registrations/components/change-status-dialog/change-status-dialog.component.html Updated as part of this pull request.
interfaces/portal/src/app/pages/program-payments/components/create-payment/create-payment.component.ts Updated as part of this pull request.
interfaces/portal/src/app/pages/program-payment-transaction-list/program-payment-transaction-list.page.ts Updated as part of this pull request.
Review details

Suppressed comments (2)

services/121-service/src/payments/services/payments-helper.service.ts:87

  • The start-payment path now materializes every duplicate registration view via getRegistrationViewsNoLimit only to count them. For large payments this loads all selected columns and related data into memory; use a count/limit-one query for this guard so payment start does not scale with the full duplicate result set.
    const duplicateRegistrations =
      await this.registrationsPaginationService.getRegistrationViewsNoLimit({

services/121-service/src/payments/services/payments-helper.service.ts:66

  • This new guard now gates both approval and payment start, but the spec still only exercises FSP configuration validation. None of the new branches (no transactions, no duplicates, and duplicate rejection) are covered; add unit tests with mocked repository/pagination/query-builder calls, including the two statuses passed to the transaction lookup, so this payment safety rule is verified.
  async throwIfPaymentHasDuplicateRegistrations({
    programId,
    paymentId,
  }: {
    programId: number;
    paymentId: number;
  }): Promise<void> {
  • Files reviewed: 5/5 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread services/121-service/src/payments/services/payments-helper.service.spec.ts Outdated
Comment thread services/121-service/src/payments/services/payments-helper.service.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Fix error-response guards and i18n ID collisions, and add start-payment validation tests.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 6
  • Review effort level: Lite

Comment thread interfaces/portal/src/locale/messages.xlf Outdated
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.

2 participants