fix(subaccounts): correct type on SubAccountCreateParameters #940
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
Current State (AS-IS)
Proposed Changes (TO-BE)
Reasons for the Changes
Optional Parameters:
Both secret and usePrimaryAccountBalance are optional in the actual HTTP request. Even if these parameters are not included in the request, it successfully creates the subaccount. Thus, the type definition should reflect their optional nature.
API Secret Validation:
The API secret has specific validation requirements:
These requirements are enforced in the Vonage dashboard but were not clear during testing in the development environment. Therefore, including these validation rules in the comments helps developers understand the constraints without having to rely on trial and error.
Test Adjustments:
The current tests might include invalid values for the secret. Updating the tests to align with the valid values is necessary to ensure the robustness of the test suite.
If the parameters were intentionally made non-optional to prevent user errors, let me know
Types of changes
Checklist