Skip to content

Conversation

@pengying
Copy link
Contributor

@pengying pengying commented Jan 24, 2026

TL;DR

Refactored payment account schemas to simplify the inheritance structure and added platform account identification.

What changed?

  • Removed the PaymentAccountOrWalletInfo base schema and its discriminator pattern
  • Simplified inheritance by having payment account types directly reference their base account info
  • Replaced enum with const for account types and asset types to improve type safety
  • Relocated the ClabeAccountInfo schema to a more logical position in the schema hierarchy
  • Added isPlatformAccount boolean field to PaymentInstructions to distinguish between platform and customer accounts
  • Moved NgnAccountInfo schema to maintain better organization

@greptile-apps
Copy link

greptile-apps bot commented Jan 24, 2026

Greptile Overview

Greptile Summary

This PR simplifies the payment account schema architecture by removing the intermediate PaymentAccountOrWalletInfo base schema and establishing direct inheritance between payment schemas and their base account/wallet info types.

Key changes:

  • Removed PaymentAccountOrWalletInfo schema (now orphaned in codebase but no longer referenced)
  • Moved discriminator pattern from intermediate layer to PaymentInstructions level
  • Converted single-value enum types to const for accountType and assetType fields (improves type safety)
  • Added isPlatformAccount boolean field to PaymentInstructions for platform vs customer account identification
  • Maintained enum for PaymentSolanaWalletInfo.assetType (correctly supports USDC and USDT)
  • Maintained enum for PaymentSparkWalletInfo.assetType (correctly supports BTC and USDB)

The refactoring successfully reduces schema complexity while preserving functionality. All 16 files were properly updated with consistent changes, and both bundled outputs (root and Mintlify) reflect the modifications correctly.

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • The refactoring is well-executed with consistent changes across all 16 files. The schema simplification removes an unnecessary inheritance layer while preserving all functionality. Type safety improvements (enum to const) are correctly applied only to single-value cases. The bundled outputs are properly generated and synchronized.
  • No files require special attention

Important Files Changed

Filename Overview
openapi/components/schemas/common/PaymentInstructions.yaml Added isPlatformAccount boolean field to distinguish platform vs customer accounts
openapi/components/schemas/common/PaymentFboAccountInfo.yaml Removed PaymentAccountOrWalletInfo reference and inline-defined accountType as const FBO
openapi/components/schemas/common/PaymentLightningInvoiceInfo.yaml Removed inheritance, changed to standalone object with accountType as const instead of enum
openapi/components/schemas/common/PaymentTronWalletInfo.yaml Removed PaymentAccountOrWalletInfo reference, converted assetType from enum to const USDT
openapi/components/schemas/common/PaymentPolygonWalletInfo.yaml Removed PaymentAccountOrWalletInfo reference, converted assetType from enum to const USDC
openapi/components/schemas/common/PaymentBaseWalletInfo.yaml Removed PaymentAccountOrWalletInfo reference, converted assetType from enum to const USDC

Sequence Diagram

sequenceDiagram
    participant API as API Consumer
    participant PI as PaymentInstructions
    participant Old as PaymentAccountOrWalletInfo<br/>(Removed)
    participant New as Payment*Info Schemas
    participant Base as Base*Info Schemas
    
    Note over API,Base: Before: Two-Level Inheritance
    API->>PI: Request payment instructions
    PI->>Old: accountOrWalletInfo extends
    Old->>New: Payment schemas inherit
    New->>Base: Base schemas referenced
    Note over Old: Discriminator at intermediate layer
    
    Note over API,Base: After: Simplified Direct Inheritance
    API->>PI: Request payment instructions
    Note over PI: + isPlatformAccount field
    PI->>New: accountOrWalletInfo directly references
    New->>Base: Payment schemas extend base directly
    Note over PI: Discriminator moved to PaymentInstructions
    Note over New: accountType: const (was enum)<br/>assetType: const for single-asset wallets

Loading

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.

2 participants