fix(types): correct invoice log param and utilityPayment id type - #171
Open
mateussiqueira wants to merge 1 commit into
Open
fix(types): correct invoice log param and utilityPayment id type#171mateussiqueira wants to merge 1 commit into
mateussiqueira wants to merge 1 commit into
Conversation
Two TypeScript type definition fixes: 1. Invoice log query/page params used 'paymentIds' instead of 'invoiceIds', which silently ignores the filter because the JS runtime destructures 'invoiceIds'. The JSDoc @param was already correct. 2. UtilityPayment readonly id was typed as optional (?string | null), but the API always returns an id for existing payments. Changed to required 'string' for the class property (constructor keeps it optional since ids don't exist at creation time). Closes starkbank#113 Closes starkbank#114
This was referenced Jun 22, 2026
Author
|
Follow-up: algum feedback sobre este PR? Corrige os tipos de invoice log (paymentIds → invoiceIds) e torna UtilityPayment.id obrigatório. Esses bugs de tipo afetam usuários TypeScript que usam strict mode. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two TypeScript type definition fixes found while reviewing the SDK.
1.
invoice.log.query()andinvoice.log.page()use wrong param name (#114)The type definitions use
paymentIdsin the function signature, but the JS runtime destructuresinvoiceIds. TypeScript users passingpaymentIdswould have their filter silently ignored — the value goes nowhere.The JSDoc
@paramalready correctly saysinvoiceIds, so this was a copy-paste mistake from other payment-type log modules (which correctly usepaymentIdsfor their domain).2.
UtilityPayment.idshould not be optional (#113)The
idis always returned by the API for existing payments. Having it asstring | null | undefinedforces unnecessary null checks on users who retrieve payments. The constructor still acceptsid?: string | nullfor creation scenarios.Testing
npm test(mocha) passesnpm run test:typescript(jest) passesCloses #113
Closes #114