chore: Update external account schemas from webdev#150
chore: Update external account schemas from webdev#150lightspark-copybara[bot] wants to merge 1 commit intomainfrom
Conversation
Greptile OverviewGreptile SummaryThis PR adds support for two new payment corridors: MXN SPEI (Mexican bank transfers) and INR UPI (Indian payments). The changes include new OpenAPI schemas with proper validation rules and integration into the external account discriminator union. Key Changes
Issues Found
These style issues don't affect functionality but reduce maintainability and break established patterns in this auto-synced codebase. Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/external_accounts/InrUpiAccountInfo.yaml | New INR UPI account schema added with correct structure but inconsistent beneficiary reference pattern |
| openapi/components/schemas/external_accounts/MxnSpeiAccountInfo.yaml | New MXN SPEI account schema with proper CLABE validation but inconsistent beneficiary reference pattern |
| openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml | Added new account types to discriminator union with inconsistent title naming convention |
Sequence Diagram
sequenceDiagram
participant Client
participant GridAPI
participant SchemaValidator
participant VASPAdapter
Client->>GridAPI: POST /customers/external-accounts
Note over Client,GridAPI: Body contains accountType: MXN_SPEI_ACCOUNT or INR_UPI_ACCOUNT
GridAPI->>SchemaValidator: Validate ExternalAccountInfoOneOf
SchemaValidator->>SchemaValidator: Check discriminator (accountType)
alt MXN_SPEI_ACCOUNT
SchemaValidator->>SchemaValidator: Validate MxnSpeiAccountInfo schema
Note over SchemaValidator: Validates clabeNumber, name, beneficiary
else INR_UPI_ACCOUNT
SchemaValidator->>SchemaValidator: Validate InrUpiAccountInfo schema
Note over SchemaValidator: Validates fullName, vpa, beneficiary
end
SchemaValidator->>SchemaValidator: Validate beneficiary (INDIVIDUAL or BUSINESS)
SchemaValidator-->>GridAPI: Validation result
alt Valid
GridAPI->>VASPAdapter: Create external account
Note over VASPAdapter: Auto-synced schemas from sparkcore
VASPAdapter-->>GridAPI: Account created
GridAPI-->>Client: 201 Created
else Invalid
GridAPI-->>Client: 400 Bad Request
end
| beneficiary: | ||
| oneOf: | ||
| - $ref: ./IndividualBeneficiary.yaml | ||
| - $ref: ./BusinessBeneficiary.yaml | ||
| discriminator: | ||
| propertyName: beneficiaryType | ||
| mapping: | ||
| INDIVIDUAL: ./IndividualBeneficiary.yaml | ||
| BUSINESS: ./BusinessBeneficiary.yaml |
There was a problem hiding this comment.
Use shared BeneficiaryOneOf.yaml reference for consistency with other external account types. All other account schemas (PHP, NGN, CAD, etc.) reference ./BeneficiaryOneOf.yaml instead of inlining the discriminator logic.
| beneficiary: | |
| oneOf: | |
| - $ref: ./IndividualBeneficiary.yaml | |
| - $ref: ./BusinessBeneficiary.yaml | |
| discriminator: | |
| propertyName: beneficiaryType | |
| mapping: | |
| INDIVIDUAL: ./IndividualBeneficiary.yaml | |
| BUSINESS: ./BusinessBeneficiary.yaml | |
| beneficiary: | |
| $ref: ./BeneficiaryOneOf.yaml |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/InrUpiAccountInfo.yaml
Line: 23:31
Comment:
Use shared `BeneficiaryOneOf.yaml` reference for consistency with other external account types. All other account schemas (PHP, NGN, CAD, etc.) reference `./BeneficiaryOneOf.yaml` instead of inlining the discriminator logic.
```suggestion
beneficiary:
$ref: ./BeneficiaryOneOf.yaml
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| beneficiary: | ||
| oneOf: | ||
| - $ref: ./IndividualBeneficiary.yaml | ||
| - $ref: ./BusinessBeneficiary.yaml | ||
| discriminator: | ||
| propertyName: beneficiaryType | ||
| mapping: | ||
| INDIVIDUAL: ./IndividualBeneficiary.yaml | ||
| BUSINESS: ./BusinessBeneficiary.yaml |
There was a problem hiding this comment.
Use shared BeneficiaryOneOf.yaml reference for consistency with other external account types. All other account schemas reference ./BeneficiaryOneOf.yaml instead of inlining the discriminator logic.
| beneficiary: | |
| oneOf: | |
| - $ref: ./IndividualBeneficiary.yaml | |
| - $ref: ./BusinessBeneficiary.yaml | |
| discriminator: | |
| propertyName: beneficiaryType | |
| mapping: | |
| INDIVIDUAL: ./IndividualBeneficiary.yaml | |
| BUSINESS: ./BusinessBeneficiary.yaml | |
| beneficiary: | |
| $ref: ./BeneficiaryOneOf.yaml |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/MxnSpeiAccountInfo.yaml
Line: 26:34
Comment:
Use shared `BeneficiaryOneOf.yaml` reference for consistency with other external account types. All other account schemas reference `./BeneficiaryOneOf.yaml` instead of inlining the discriminator logic.
```suggestion
beneficiary:
$ref: ./BeneficiaryOneOf.yaml
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| - title: MxnSpeiAccountInfo | ||
| $ref: ./MxnSpeiAccountInfo.yaml | ||
| - title: InrUpiAccountInfo | ||
| $ref: ./InrUpiAccountInfo.yaml |
There was a problem hiding this comment.
Use human-readable titles like other entries (e.g., "MXN SPEI Account" and "INR UPI Account" instead of schema names). This inconsistency breaks the naming pattern used by all other account types in this file.
| - title: MxnSpeiAccountInfo | |
| $ref: ./MxnSpeiAccountInfo.yaml | |
| - title: InrUpiAccountInfo | |
| $ref: ./InrUpiAccountInfo.yaml | |
| - title: MXN SPEI Account | |
| $ref: ./MxnSpeiAccountInfo.yaml | |
| - title: INR UPI Account | |
| $ref: ./InrUpiAccountInfo.yaml |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 34:37
Comment:
Use human-readable titles like other entries (e.g., "MXN SPEI Account" and "INR UPI Account" instead of schema names). This inconsistency breaks the naming pattern used by all other account types in this file.
```suggestion
- title: MXN SPEI Account
$ref: ./MxnSpeiAccountInfo.yaml
- title: INR UPI Account
$ref: ./InrUpiAccountInfo.yaml
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Auto-synced external account schemas from webdev.
These schemas are generated from VASP adapter field definitions in sparkcore.
Please review the changes before merging.