From 4d40b5a11493aea2565ebe7640c928a54332dad9 Mon Sep 17 00:00:00 2001 From: Andre Goncalves Date: Thu, 19 Mar 2026 12:58:35 -0700 Subject: [PATCH 1/3] AB#28800 update payment number mapping --- .../ApplicantProfile/PaymentInfoDataProvider.cs | 2 +- .../applicant-portal/applicant-profile-data-providers.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs index 0fb17d0f99..9165e30af7 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs @@ -61,7 +61,7 @@ join application in applicationsQuery on submission.ApplicationId equals applica dto.Payments.AddRange(paymentDetails.Select(p => new PaymentInfoItemDto { Id = p.Id, - PaymentNumber = p.PaymentNumber ?? string.Empty, + PaymentNumber = p.InvoiceNumber ?? string.Empty, ReferenceNo = applicationLookup.TryGetValue(p.CorrelationId, out var refNo) ? refNo : string.Empty, Amount = p.Amount, PaymentDate = p.PaymentDate, diff --git a/documentation/applicant-portal/applicant-profile-data-providers.md b/documentation/applicant-portal/applicant-profile-data-providers.md index 135d63b9f2..91d5d552c3 100644 --- a/documentation/applicant-portal/applicant-profile-data-providers.md +++ b/documentation/applicant-portal/applicant-profile-data-providers.md @@ -428,7 +428,7 @@ flowchart LR | DTO Field | Source | Type | Description | |-----------|--------|------|-------------| | `Id` | `PaymentRequest.Id` | `Guid` | Payment request identifier | -| `PaymentNumber` | `PaymentRequest.PaymentNumber` | `string` | CAS payment number (empty string if null) | +| `PaymentNumber` | `PaymentRequest.InvoiceNumber` | `string` | CAS invoice number (empty string if null) | | `ReferenceNo` | `Application.ReferenceNo` | `string` | Application reference number, resolved via `CorrelationId → Application` lookup | | `Amount` | `PaymentRequest.Amount` | `decimal` | Requested payment amount | | `PaymentDate` | `PaymentRequest.PaymentDate` | `string?` | Date string populated during CAS reconciliation | From 7e0a1c8add22f48af9f5c4c23734ac03a0a33913 Mon Sep 17 00:00:00 2001 From: Andre Goncalves Date: Thu, 19 Mar 2026 13:27:17 -0700 Subject: [PATCH 2/3] AB#28800 fix unit tests for updated mapping --- .../Applicants/PaymentInfoDataProviderTests.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/applications/Unity.GrantManager/test/Unity.GrantManager.Application.Tests/Applicants/PaymentInfoDataProviderTests.cs b/applications/Unity.GrantManager/test/Unity.GrantManager.Application.Tests/Applicants/PaymentInfoDataProviderTests.cs index 33d09b85d2..c3429dc54e 100644 --- a/applications/Unity.GrantManager/test/Unity.GrantManager.Application.Tests/Applicants/PaymentInfoDataProviderTests.cs +++ b/applications/Unity.GrantManager/test/Unity.GrantManager.Application.Tests/Applicants/PaymentInfoDataProviderTests.cs @@ -84,12 +84,12 @@ private static Application CreateApplication(Guid id, string referenceNo = "") return entity; } - private static PaymentRequest CreatePaymentRequest(Guid correlationId, decimal amount = 1000m) + private static PaymentRequest CreatePaymentRequest(Guid correlationId, decimal amount = 1000m, string invoiceNumber = "INV-001") { var siteId = Guid.NewGuid(); var dto = new CreatePaymentRequestDto { - InvoiceNumber = "INV-001", + InvoiceNumber = invoiceNumber, Amount = amount, PayeeName = "Test Payee", ContractNumber = "C-001", @@ -169,7 +169,6 @@ public async Task GetDataAsync_ShouldMapPaymentFields() var applicationId = Guid.NewGuid(); var payment = CreatePaymentRequest(applicationId, 5000m); - payment.SetPaymentNumber("PAY-100"); payment.SetPaymentDate("15-Jan-2025"); payment.SetPaymentRequestStatus(PaymentRequestStatus.Paid); @@ -184,7 +183,7 @@ public async Task GetDataAsync_ShouldMapPaymentFields() dto.Payments.Count.ShouldBe(1); var item = dto.Payments[0]; - item.PaymentNumber.ShouldBe("PAY-100"); + item.PaymentNumber.ShouldBe("INV-001"); item.ReferenceNo.ShouldBe("REF-001"); item.Amount.ShouldBe(5000m); item.PaymentDate.ShouldBe("2025-01-15"); @@ -277,12 +276,12 @@ public async Task GetDataAsync_ShouldNotReturnPaymentsForOtherSubjects() } [Fact] - public async Task GetDataAsync_ShouldHandleNullPaymentNumber() + public async Task GetDataAsync_ShouldHandleEmptyInvoiceNumber() { var request = CreateRequest(); var applicationId = Guid.NewGuid(); - var payment = CreatePaymentRequest(applicationId); + var payment = CreatePaymentRequest(applicationId, invoiceNumber: string.Empty); SetupQueryables( [CreateSubmission(applicationId, "TESTUSER")], From fbaeaf48708f45b93e22ce49b692514b9e9ca29f Mon Sep 17 00:00:00 2001 From: Andre Goncalves Date: Thu, 19 Mar 2026 13:32:27 -0700 Subject: [PATCH 3/3] AB#28800 codeQL suggestion --- .../ApplicantProfile/PaymentInfoDataProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs index 9165e30af7..fc73e7f825 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/ApplicantProfile/PaymentInfoDataProvider.cs @@ -61,7 +61,7 @@ join application in applicationsQuery on submission.ApplicationId equals applica dto.Payments.AddRange(paymentDetails.Select(p => new PaymentInfoItemDto { Id = p.Id, - PaymentNumber = p.InvoiceNumber ?? string.Empty, + PaymentNumber = p.InvoiceNumber, ReferenceNo = applicationLookup.TryGetValue(p.CorrelationId, out var refNo) ? refNo : string.Empty, Amount = p.Amount, PaymentDate = p.PaymentDate,