Skip to content

#34716 fix: added none to empty func on reciept retrieval - #2032

Merged
Oluwapizzy merged 1 commit into
mainfrom
fix/receipt-response-null-numbers
Oct 16, 2026
Merged

Oluwapizzy merged 1 commit into
mainfrom
fix/receipt-response-null-numbers

Conversation

@Oluwapizzy

Copy link
Copy Markdown
Collaborator

Issue #: bcgov/entity#34716

Description of changes:

The receipts endpoint returns 500 when Pay sends invoiceNumber and receiptNumber as null. That happens for a PAD, EFT, EJV, or internal invoice that is approved but not settled yet. The emailer calls POST /payments/{id}/receipt to attach the PDF. Namex loads the Pay payload into ReceiptResponse, and Pydantic rejects the nulls because those two fields are plain strings. The PDF is never built, and the payment email goes out without the receipt.

ReceiptResponse now turns a null invoice number or receipt number into an empty string before validation. A real number is left as it is. Card payments already send real numbers, so that path is unchanged. The debit and the name-request status are not part of this change.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).

@sonarqubecloud

Copy link
Copy Markdown

@Oluwapizzy
Oluwapizzy merged commit 96ae694 into main Oct 16, 2026
11 of 12 checks passed
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.

2 participants