Skip to content

bugfix/AB#31384 - Total Paid Amount - Update payment status checks for display#2011

Merged
JamesPasta merged 1 commit intodevfrom
bugfix/AB#31384-total-paid-amount
Feb 20, 2026
Merged

bugfix/AB#31384 - Total Paid Amount - Update payment status checks for display#2011
JamesPasta merged 1 commit intodevfrom
bugfix/AB#31384-total-paid-amount

Conversation

@plavoie-BC
Copy link
Contributor

@plavoie-BC plavoie-BC commented Feb 18, 2026

Pull request overview

This pull request refactors payment status checks to use type-safe constants and fixes a bug in the payment calculation logic. The PR replaces hardcoded "Fully Paid" string literals with the CasPaymentRequestStatus.FullyPaid constant across multiple components and services.

In the PaymentRequests table, there is "Payments"."PaymentRequests"."Status" and "Payments"."PaymentRequests"."PaymentStatus". There are cases where a payment request status can be "Submitted", but the payment status of that request is not "Fully Paid".

Now "Total Paid Amount $" and "Total Paid" are based on "Payments"."PaymentRequests"."PaymentStatus" = 'Fully Paid' instead of "Payments"."PaymentRequests"."Status" = 7 (Submitted).

Changes:

  • Fixed bug in ApplicantSubmissionsViewComponent that was checking Status == PaymentRequestStatus.Submitted instead of properly checking PaymentStatus == "Fully Paid" for calculating paid amounts
  • Replaced string literal "Fully Paid" with CasPaymentRequestStatus.FullyPaid constant for consistent payment status comparisons
  • Added null/whitespace validation for PaymentStatus field before comparison
  • Updated using directives to reference Unity.Payments.Codes namespace

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ApplicantSubmissionsViewComponent.cs Fixed payment status check logic to properly use PaymentStatus field with FullyPaid constant instead of checking Status field; added null/whitespace checks
GrantApplicationAppService.cs Replaced "Fully Paid" string literal with CasPaymentRequestStatus.FullyPaid constant; added null/whitespace validation; minor comment emoji cleanup
PaymentInfoViewComponent.cs Replaced "Fully Paid" string literal with CasPaymentRequestStatus.FullyPaid constant for consistency

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 pull request refactors payment status checks to use type-safe constants and fixes a bug in the payment calculation logic. The PR replaces hardcoded "Fully Paid" string literals with the CasPaymentRequestStatus.FullyPaid constant across multiple components and services.

Changes:

  • Replaced string literal "Fully Paid" with CasPaymentRequestStatus.FullyPaid constant for consistent payment status comparisons
  • Fixed bug in ApplicantSubmissionsViewComponent that was checking Status == PaymentRequestStatus.Submitted instead of properly checking PaymentStatus == "Fully Paid" for calculating paid amounts
  • Added null/whitespace validation for PaymentStatus field before comparison
  • Updated using directives to reference Unity.Payments.Codes namespace

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ApplicantSubmissionsViewComponent.cs Fixed payment status check logic to properly use PaymentStatus field with FullyPaid constant instead of checking Status field; added null/whitespace checks
GrantApplicationAppService.cs Replaced "Fully Paid" string literal with CasPaymentRequestStatus.FullyPaid constant; added null/whitespace validation; minor comment emoji cleanup
PaymentInfoViewComponent.cs Replaced "Fully Paid" string literal with CasPaymentRequestStatus.FullyPaid constant for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 340
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@plavoie-BC plavoie-BC marked this pull request as ready for review February 18, 2026 20:01
@JamesPasta JamesPasta merged commit 441de45 into dev Feb 20, 2026
28 checks passed
@JamesPasta JamesPasta deleted the bugfix/AB#31384-total-paid-amount branch February 20, 2026 00:23
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.

3 participants