Skip to content

Commit

Permalink
Merge pull request #161 from Flutterwave/dev
Browse files Browse the repository at this point in the history
Pull changes from dev
  • Loading branch information
corneliusyaovi authored Sep 10, 2024
2 parents 89dafcc + 15ba877 commit 07e98fe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## 1.1.11 | 2024-09-10
Updated the `account_bank` field in all schema's.

### Version Changes
- [FIXED] Update validation (minLength & maxLength) for 'account_bank" parameter in the schema's.

## 1.1.10 | 2024-04-04
Updated the variable name "package" which happens to be a reserved word in JavaScript, and it is causing compatibility issues with certain bundlers.
Expand Down
2 changes: 1 addition & 1 deletion services/schema/auxillary.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const orderSchema = joi.object({

// resolve account details
const resolveSchema = joi.object({
account_bank: joi.string().length(3).required(),
account_bank: joi.string().min(3).max(11).required(),
account_number: joi.string().required(),
country: joi.string().uppercase().length(2).default('NG'),
type: joi.string(),
Expand Down
2 changes: 1 addition & 1 deletion services/schema/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const listSchema = joi.object({
.string()
.max(20)
.valid('daily', 'weekly', 'monthly', 'quarterly', 'yearly'),
account_bank: joi.string().length(3),
account_bank: joi.string().min(3).max(11).required(),
account_number: joi.string().trim().max(20),
bank_name: joi.string().trim().max(100),
split_value: joi.number().min(0).max(1),
Expand Down
6 changes: 3 additions & 3 deletions services/schema/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const bankChargeSchema = joi.object({
// create a beneficiary
const beneficiarySchema = joi.object({
account_number: joi.string().required(),
account_bank: joi.string().required(),
account_bank: joi.string().min(3).max(11).required(),
beneficiary_name: joi.string().required(),
currency: joi.string().uppercase().length(3),
bank_name: joi.string(),
Expand Down Expand Up @@ -413,7 +413,7 @@ const refundSchema = joi.object({

// create a subaccount
const subaccountSchema = joi.object({
account_bank: joi.string().min(3).max(6).required(),
account_bank: joi.string().min(3).max(11).required(),
account_number: joi.string().trim().max(20).required(),
business_name: joi.string().trim().max(100).required(),
split_value: joi.number().min(0).max(1).required(),
Expand Down Expand Up @@ -637,7 +637,7 @@ const tokenSchema = joi.object({

// charge bank accounts: base for USSD charge
const ussdChargeSchema = joi.object({
account_bank: joi.string().min(3).max(6).required(),
account_bank: joi.string().min(3).max(11).required(),
amount: joi.number().positive().required(),
email: joi.string().max(100).email().required(),
tx_ref: joi.string().trim().max(100).required(),
Expand Down

0 comments on commit 07e98fe

Please sign in to comment.