fix(schema): change accountNumber from Int to String (ENG-291)#319
Open
fix(schema): change accountNumber from Int to String (ENG-291)#319
Conversation
Root cause: GraphQL Int is 32-bit signed (max 2,147,483,647). Jamaican bank account numbers can be 10+ digits, causing Int32 overflow → GraphQL type validation error → HTTP 400 on account upgrade step 4. Confirmed by ajemonx: 8-digit number worked (within Int32), longer number failed. Not a content-type issue. Changes: - BankAccountInput.accountNumber: GT.Int → GT.String - BankAccount (response type).accountNumber: GT.Int → GT.String - BankAccount domain type.accountNumber: number → string Bank account numbers are identifiers, not integers. String type: - Handles all Caribbean bank account lengths (8-16 digits) - Preserves leading zeros - No overflow risk Paired mobile fix: accountNumber: Number(x) → String cast removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Root Cause (confirmed by ajemonx)
HTTP 400 on account upgrade Step 4. Original hypothesis (image/jpg content type) was wrong — ajemonx confirmed the bug occurs with gallery photos too. The actual fix was changing the account number to 8 digits.
Real root cause:
accountNumberis typed asGT.Int(GraphQL 32-bit signed integer, max 2,147,483,647). Jamaican bank accounts can be 10–16 digits. Any number > 2,147,483,647 causes GraphQL type validation to reject the entire request with HTTP 400.8-digit number worked (max 99,999,999 — within Int32). Longer number failed.
Changes
BankAccountInput.accountNumber:GT.Int→GT.StringBankAccountresponse type.accountNumber:GT.Int→GT.StringBankAccountdomain type.accountNumber:number→stringBank account numbers are identifiers, not integers — String is the correct type.
Paired mobile fix
PR #607 on flash-mobile should also be updated:
accountNumber: Number(bankInfo.accountNumber)→ pass as string directly. I'll update that PR.Note
This is a backend schema change — requires Nick or Ben to review and merge before the mobile side can be updated.