Skip to content

feat: add TestModeParameter type to replace inline testmode definitions#475

Merged
janpaepke merged 1 commit intomasterfrom
feat/add-testmode-parameter
Apr 2, 2026
Merged

feat: add TestModeParameter type to replace inline testmode definitions#475
janpaepke merged 1 commit intomasterfrom
feat/add-testmode-parameter

Conversation

@janpaepke
Copy link
Copy Markdown
Collaborator

Summary

  • Adds TestModeParameter interface to src/types/parameters.ts, mirroring the existing SortParameter approach
  • Replaces all inline testmode?: boolean definitions across 19 binder parameter files with extends/intersections of the shared type
  • Empty interfaces that only contained testmode were converted to intersected type aliases

@janpaepke janpaepke changed the title Add TestModeParameter type to replace inline testmode definitions fat: add TestModeParameter type to replace inline testmode definitions Apr 1, 2026
@janpaepke janpaepke changed the title fat: add TestModeParameter type to replace inline testmode definitions feat: add TestModeParameter type to replace inline testmode definitions Apr 1, 2026
@janpaepke janpaepke requested a review from Copilot April 1, 2026 10:37
Copy link
Copy Markdown
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 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 TestModeParameter to src/types/parameters.ts.
  • Replaced inline testmode?: boolean definitions across multiple binder parameter files with TestModeParameter via extends/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.limit documentation 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.

@janpaepke janpaepke requested a review from edorivai April 1, 2026 12:20
Copy link
Copy Markdown
Collaborator

@edorivai edorivai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice cleanup

@janpaepke janpaepke force-pushed the feat/add-sort-parameter branch from c45ef1c to 4425efe Compare April 2, 2026 08:34
Base automatically changed from feat/add-sort-parameter to master April 2, 2026 08:35
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.
@janpaepke janpaepke force-pushed the feat/add-testmode-parameter branch from e2bb75f to 6f010f3 Compare April 2, 2026 09:01
@janpaepke janpaepke merged commit b429599 into master Apr 2, 2026
5 checks passed
@janpaepke janpaepke deleted the feat/add-testmode-parameter branch April 2, 2026 09:02
@janpaepke janpaepke mentioned this pull request Apr 2, 2026
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