[balanceplatform] Code generation: update services and models - #1737
[balanceplatform] Code generation: update services and models#1737AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the RecurringTopUpsApi service to manage recurring top-ups, adds a delete method for SCA devices, and updates transaction rules to support rule overrides and bypasses. The review feedback highlights several improvement opportunities: avoiding direct mutation of requestOptions and handling falsy values correctly in recurringTopUpsApi.ts, ensuring all generated model files consistently include a trailing newline, and strongly typing the referenceForBeneficiary field as string | null instead of any | null to maintain type safety.
| const hasDefinedQueryParams = limit ?? cursor; | ||
| if(hasDefinedQueryParams) { | ||
| if(!requestOptions) requestOptions = {}; | ||
| if(!requestOptions.params) requestOptions.params = {}; | ||
| if(limit) requestOptions.params["limit"] = limit; | ||
| if(cursor) requestOptions.params["cursor"] = cursor; | ||
| } |
There was a problem hiding this comment.
Mutating the user-supplied requestOptions parameter directly can lead to unexpected side-effects in client applications if the same options object is reused across multiple API calls. Additionally, using a loose truthiness check like if(limit) will fail to set the parameter if a valid falsy value (such as 0) is passed.
Consider constructing a new params object and copying requestOptions safely without mutating the original argument.
if (limit !== undefined || cursor !== undefined) {
const params = { ...requestOptions?.params };
if (limit !== undefined) params["limit"] = limit;
if (cursor !== undefined) params["cursor"] = cursor;
requestOptions = { ...requestOptions, params };
}| export namespace CreateRecurringTopUp { | ||
| export enum StatusEnum { | ||
| Active = 'active', | ||
| Inactive = 'inactive' | ||
| } | ||
| } |
There was a problem hiding this comment.
This generated model file is missing a trailing newline, which violates the repository's general guidelines. Please ensure that the generator configuration is updated to consistently append a trailing newline to all generated files (including other newly added files like patchableCreateRecurringTopUp.ts, patchableSchedule.ts, recurringTopUp.ts, schedule.ts, and scheduleType.ts).
| export namespace CreateRecurringTopUp { | |
| export enum StatusEnum { | |
| Active = 'active', | |
| Inactive = 'inactive' | |
| } | |
| } | |
| export namespace CreateRecurringTopUp { | |
| export enum StatusEnum { | |
| Active = 'active', | |
| Inactive = 'inactive' | |
| } | |
| } | |
References
- Ensure generated model files (e.g., in
src/typings/) consistently include a trailing newline, preferably by configuring the generator rather than applying manual fixes to individual files.
| /** | ||
| * A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, **0-9**. | ||
| */ | ||
| "referenceForBeneficiary"?: any | null; |
There was a problem hiding this comment.
The referenceForBeneficiary field is typed as any | null, which bypasses TypeScript's type safety. Since this field represents a string reference, it should ideally be typed as string | null to maintain strong typing and enable autocomplete. Please check the OpenAPI specification or generator templates to ensure this is generated with the correct type.
| "referenceForBeneficiary"?: any | null; | |
| "referenceForBeneficiary"?: string | null; |
ea17e0b to
44ae505
Compare
61cdf24 to
8c355ce
Compare
4bc2881 to
53d9904
Compare
62fcd7d to
1caf13e
Compare
1caf13e to
6ddd4ee
Compare
This PR contains the automated changes for the
balanceplatformservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.