Skip to content

Conversation

@lightspark-copybara
Copy link

Auto-synced external account schemas from webdev.

These schemas are generated from VASP adapter field definitions in sparkcore.

Please review the changes before merging.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

This 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

  • Added MxnSpeiAccountInfo.yaml schema with 18-digit CLABE number validation and regex pattern
  • Added InrUpiAccountInfo.yaml schema with VPA (Virtual Payment Address) support for UPI payments
  • Updated discriminator mappings in ExternalAccountInfoOneOf.yaml to include both new account types

Issues Found

  • Style inconsistencies: Both new schemas inline the beneficiary discriminator logic instead of using the shared BeneficiaryOneOf.yaml reference like all other external account types (PHP, NGN, CAD, GBP, etc.)
  • Title naming inconsistency: The new entries use schema names ("MxnSpeiAccountInfo", "InrUpiAccountInfo") instead of human-readable titles like other entries ("US Account", "PIX Account", etc.)

These style issues don't affect functionality but reduce maintainability and break established patterns in this auto-synced codebase.

Confidence Score: 3/5

  • Safe to merge after addressing style inconsistencies that affect API documentation quality
  • All schemas are functionally correct and well-structured with proper validation rules. However, there are multiple style inconsistencies (beneficiary reference pattern and title naming) that deviate from established codebase patterns. These don't break functionality but reduce maintainability and documentation consistency.
  • All three files need minor style adjustments to match existing patterns: InrUpiAccountInfo.yaml and MxnSpeiAccountInfo.yaml should use shared beneficiary references, and ExternalAccountInfoOneOf.yaml needs consistent title formatting

Important Files Changed

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
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +23 to +31
beneficiary:
oneOf:
- $ref: ./IndividualBeneficiary.yaml
- $ref: ./BusinessBeneficiary.yaml
discriminator:
propertyName: beneficiaryType
mapping:
INDIVIDUAL: ./IndividualBeneficiary.yaml
BUSINESS: ./BusinessBeneficiary.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
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.

Comment on lines +26 to +34
beneficiary:
oneOf:
- $ref: ./IndividualBeneficiary.yaml
- $ref: ./BusinessBeneficiary.yaml
discriminator:
propertyName: beneficiaryType
mapping:
INDIVIDUAL: ./IndividualBeneficiary.yaml
BUSINESS: ./BusinessBeneficiary.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
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.

Comment on lines +34 to +37
- title: MxnSpeiAccountInfo
$ref: ./MxnSpeiAccountInfo.yaml
- title: InrUpiAccountInfo
$ref: ./InrUpiAccountInfo.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
- 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.

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.

0 participants