-
Notifications
You must be signed in to change notification settings - Fork 4
chore: Sync account schemas #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| type: object | ||
| required: | ||
| - accountType | ||
| - paymentRails | ||
| - iban | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - AED_ACCOUNT | ||
| paymentRails: | ||
| type: array | ||
| items: | ||
| type: string | ||
| enum: | ||
| - BANK_TRANSFER | ||
| iban: | ||
| type: string | ||
| description: The IBAN of the bank account | ||
| example: DE89370400440532013000 | ||
| minLength: 15 | ||
| maxLength: 34 | ||
| pattern: ^[A-Z]{2}[0-9]{2}[A-Za-z0-9]{11,30}$ | ||
| swiftBic: | ||
| type: string | ||
| description: The SWIFT/BIC code of the bank | ||
| example: DEUTDEFF | ||
| minLength: 8 | ||
| maxLength: 11 | ||
| pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| title: Individual Beneficiary | ||
| type: object | ||
| required: | ||
| - beneficiaryType | ||
| - fullName | ||
| properties: | ||
| beneficiaryType: | ||
| type: string | ||
| enum: | ||
| - INDIVIDUAL | ||
| fullName: | ||
| type: string | ||
| description: The full name of the beneficiary | ||
| birthDate: | ||
| type: string | ||
| description: The birth date of the beneficiary | ||
| nationality: | ||
| type: string | ||
| description: The nationality of the beneficiary | ||
| email: | ||
| type: string | ||
| description: The email of the beneficiary | ||
| phoneNumber: | ||
| type: string | ||
| description: The phone number of the beneficiary | ||
| registrationNumber: | ||
| type: string | ||
| description: The registration number of the beneficiary | ||
| countryOfResidence: | ||
| type: string | ||
| description: The country of residence of the beneficiary | ||
| address: | ||
| $ref: ./Address.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,13 +17,15 @@ properties: | |
| - FASTER_PAYMENTS | ||
| sortCode: | ||
| type: string | ||
| description: UK bank sort code (6 digits, may include hyphens) | ||
| example: '20-00-00' | ||
| pattern: '^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$' | ||
| description: The UK sort code | ||
| example: '123456' | ||
| minLength: 6 | ||
| maxLength: 6 | ||
| pattern: ^[0-9]{6}$ | ||
|
Comment on lines
18
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change: sort code pattern no longer accepts hyphenated format The previous pattern If the intent is to migrate all consumers to the plain-digit form, this is a backwards-incompatible API change that should be communicated to existing callers before the schema is deployed. Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/components/schemas/common/GbpAccountInfo.yaml
Line: 18-24
Comment:
**Breaking change: sort code pattern no longer accepts hyphenated format**
The previous pattern `^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$` accepted both `"123456"` and `"12-34-56"` (the traditional UK display format). The new pattern `^[0-9]{6}$` only accepts the six-digit form. Any existing API client that submits sort codes with hyphens will now receive a validation failure.
If the intent is to migrate all consumers to the plain-digit form, this is a backwards-incompatible API change that should be communicated to existing callers before the schema is deployed.
How can I resolve this? If you propose a fix, please make it concise.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we can support both we should, unless tazapay rejects sort codes with hyphens |
||
| accountNumber: | ||
| type: string | ||
| description: UK bank account number (8 digits) | ||
| example: '12345678' | ||
| minLength: 8 | ||
| maxLength: 8 | ||
| example: '12345678' | ||
| pattern: ^[0-9]{8}$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,10 @@ type: object | |
| required: | ||
| - accountType | ||
| - paymentRails | ||
| - bankCode | ||
| - bankName | ||
| - accountNumber | ||
| - swiftCode | ||
| - swiftBic | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking field rename: The required field previously named The same rename affects:
The standard migration path for a field rename is to first add the new Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/components/schemas/common/HkdAccountInfo.yaml
Line: 8
Comment:
**Breaking field rename: `swiftCode` → `swiftBic` across multiple schemas**
The required field previously named `swiftCode` has been renamed to `swiftBic` in this PR. This is a backwards-incompatible change: any existing client that submits a payload with the `swiftCode` key will now fail validation with a missing-required-field error, even if their SWIFT code value is perfectly valid.
The same rename affects:
- `openapi/components/schemas/common/IdrAccountInfo.yaml`
- `openapi/components/schemas/common/MyrAccountInfo.yaml`
- `openapi/components/schemas/common/SgdAccountInfo.yaml`
- `openapi/components/schemas/common/ThbAccountInfo.yaml`
- `openapi/components/schemas/common/VndAccountInfo.yaml`
The standard migration path for a field rename is to first add the new `swiftBic` field while keeping `swiftCode` as a deprecated-but-still-accepted field, deploy, backfill/migrate clients, and only then remove `swiftCode`.
How can I resolve this? If you propose a fix, please make it concise. |
||
| properties: | ||
| accountType: | ||
| type: string | ||
|
|
@@ -16,18 +17,27 @@ properties: | |
| type: string | ||
| enum: | ||
| - BANK_TRANSFER | ||
| bankCode: | ||
| type: string | ||
| description: The bank code | ||
| minLength: 3 | ||
| maxLength: 3 | ||
| pattern: ^[0-9]{3}$ | ||
| bankName: | ||
| type: string | ||
| description: Name of the bank | ||
| example: HSBC Hong Kong | ||
| description: The name of the bank | ||
| minLength: 1 | ||
| maxLength: 255 | ||
| accountNumber: | ||
| type: string | ||
| description: Hong Kong bank account number | ||
| minLength: 1 | ||
| maxLength: 34 | ||
| example: '123456789012' | ||
| swiftCode: | ||
| swiftBic: | ||
| type: string | ||
| description: SWIFT/BIC code (8 or 11 characters) | ||
| example: HSBCHKHHHKH | ||
| description: The SWIFT/BIC code of the bank | ||
| example: DEUTDEFF | ||
| minLength: 8 | ||
| maxLength: 11 | ||
| pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,11 @@ properties: | |
| type: string | ||
| enum: | ||
| - UPI | ||
| - IMPS | ||
|
Comment on lines
16
to
+17
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMPS rail added but no IMPS-specific fields The
A client selecting accountNumber:
type: string
description: Bank account number for IMPS transfers
ifscCode:
type: string
description: IFSC code for IMPS transfers
pattern: ^[A-Z]{4}0[A-Z0-9]{6}$If IMPS here means "UPI-over-IMPS" (i.e., the VPA is still the routing identifier and IMPS is just the settlement rail), the description of Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/components/schemas/common/InrAccountInfo.yaml
Line: 16-17
Comment:
**IMPS rail added but no IMPS-specific fields**
The `IMPS` payment rail has been added to `paymentRails` enum, but the schema only provides a `vpa` (UPI Virtual Payment Address) field. UPI and IMPS are distinct routing mechanisms:
- **UPI** routes payments via a VPA (e.g., `user@upi`)
- **IMPS** routes payments via bank account number + IFSC code
A client selecting `paymentRails: [IMPS]` has no fields in this schema to supply the required `accountNumber` and `ifscCode` identifiers. If the intent is to expose IMPS as a standalone payment rail (not as the underlying rail automatically selected by UPI), then the schema needs additional fields to support it — for example:
```yaml
accountNumber:
type: string
description: Bank account number for IMPS transfers
ifscCode:
type: string
description: IFSC code for IMPS transfers
pattern: ^[A-Z]{4}0[A-Z0-9]{6}$
```
If IMPS here means "UPI-over-IMPS" (i.e., the VPA is still the routing identifier and IMPS is just the settlement rail), the description of `vpa` and the enum label should be clarified to avoid confusion for API consumers.
How can I resolve this? If you propose a fix, please make it concise. |
||
| vpa: | ||
| type: string | ||
| description: The VPA of the bank | ||
| description: The UPI Virtual Payment Address | ||
| example: user@upi | ||
| minLength: 3 | ||
| maxLength: 255 | ||
| pattern: ^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9]+$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| title: AED Account | ||
| allOf: | ||
| - $ref: ./BasePaymentAccountInfo.yaml | ||
| - $ref: ./AedAccountInfo.yaml | ||
| - type: object | ||
| required: | ||
| - reference | ||
| properties: | ||
| reference: | ||
| type: string | ||
| description: Unique reference code that must be included with the payment to | ||
| properly credit it | ||
| example: UMA-Q12345-REF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading IBAN example for a UAE (AED) account
The example value
DE89370400440532013000is a German IBAN (country codeDE). For an AED (UAE Dirham) account, the example should use a UAE IBAN, which starts withAEand is 23 characters long (e.g.,AE070331234567890123456).The same German IBAN is also used as the example in
DkkAccountInfo.yaml— for DKK (Danish Krone) accounts, a Danish IBAN starting withDKwould be more representative.Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw I think this is a good one to fix