feat: add TestModeParameter type to replace inline testmode definitions#475
Merged
feat: add TestModeParameter type to replace inline testmode definitions#475
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a shared TestModeParameter type in src/types/parameters.ts and refactors binder parameter types across the codebase to reuse it instead of duplicating testmode?: boolean inline.
Changes:
- Added
TestModeParametertosrc/types/parameters.ts. - Replaced inline
testmode?: booleandefinitions across multiple binder parameter files withTestModeParameterviaextends/intersections. - Converted a few “testmode-only” interfaces into equivalent type aliases that reference the shared type.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/parameters.ts | Adds TestModeParameter and updates the limit pagination doc comment. |
| src/binders/terminals/parameters.ts | Refactors paging params to include TestModeParameter via intersection. |
| src/binders/subscriptions/payments/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/subscriptions/parameters.ts | Refactors page params to include TestModeParameter. |
| src/binders/refunds/parameters.ts | Refactors page params to include TestModeParameter. |
| src/binders/refunds/orders/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/payments/routes/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/payments/refunds/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/payments/parameters.ts | Refactors multiple exported parameter types to reuse TestModeParameter (and converts a couple interfaces to type aliases). |
| src/binders/payments/orders/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/payments/captures/parameters.ts | Refactors get/page params to include TestModeParameter. |
| src/binders/paymentLinks/parameters.ts | Refactors create/get/page/update params to reuse TestModeParameter via a shared context alias. |
| src/binders/orders/shipments/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/orders/parameters.ts | Refactors create/get/update/page/cancel params to reuse TestModeParameter. |
| src/binders/orders/orderlines/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/methods/parameters.ts | Refactors get/list params to extend TestModeParameter. |
| src/binders/customers/subscriptions/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/customers/parameters.ts | Refactors common context params to alias TestModeParameter. |
| src/binders/customers/mandates/parameters.ts | Refactors context params to extend TestModeParameter. |
| src/binders/balance-transfers/parameters.ts | Refactors context params to alias TestModeParameter. |
Comments suppressed due to low confidence (1)
src/types/parameters.ts:13
- This PR also changes the
PaginationParameters.limitdocumentation from “Defaults to 250” to “Defaults to 50. Maximum 250.” Please confirm this matches the Mollie API behavior and update the PR description (or revert) so consumers aren’t misled by an unintended doc change.
/**
* The number of resources to return per page. Defaults to 50. Maximum 250.
*
* @see https://docs.mollie.com/reference/pagination
*/
limit?: number;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c45ef1c to
4425efe
Compare
Mirrors the SortParameter approach: define testmode once in src/types/parameters.ts, then extend or intersect it in all binder parameter files instead of repeating `testmode?: boolean` inline. Empty interfaces that only had testmode were converted to intersected type aliases.
e2bb75f to
6f010f3
Compare
Merged
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.
Summary
TestModeParameterinterface tosrc/types/parameters.ts, mirroring the existingSortParameterapproachtestmode?: booleandefinitions across 19 binder parameter files with extends/intersections of the shared typetestmodewere converted to intersected type aliases