Skip to content

Commit a03976d

Browse files
fix: Updated New Account Wallet API Call (#365)
* fix: updated new_account_wallet api call * fix: updated test cases for new_account_wallet --------- Co-authored-by: aliakbar-deriv <aliakbar.kondath@regentmarkets.com>
1 parent 50a18a5 commit a03976d

File tree

4 files changed

+107
-6
lines changed

4 files changed

+107
-6
lines changed

bom-core

lib/api/response/new_account_wallet_response_result.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class NewAccountWalletResponse extends NewAccountWalletResponseModel {
5151
newAccountWallet: newAccountWallet ?? this.newAccountWallet,
5252
);
5353
}
54-
5554
/// New account wallet model class.
5655
abstract class NewAccountWalletModel {
5756
/// Initializes New account wallet model class .
@@ -60,6 +59,7 @@ abstract class NewAccountWalletModel {
6059
required this.landingCompany,
6160
required this.clientId,
6261
this.currency,
62+
this.currencyType,
6363
this.landingCompanyShort,
6464
this.landingCompanyShortcode,
6565
});
@@ -76,6 +76,9 @@ abstract class NewAccountWalletModel {
7676
/// Currency of an account
7777
final String? currency;
7878

79+
/// Currency type against the currency
80+
final String? currencyType;
81+
7982
/// Landing company shortcode
8083
final String? landingCompanyShort;
8184

@@ -91,6 +94,7 @@ class NewAccountWallet extends NewAccountWalletModel {
9194
required super.landingCompany,
9295
required super.oauthToken,
9396
super.currency,
97+
super.currencyType,
9498
super.landingCompanyShort,
9599
super.landingCompanyShortcode,
96100
});
@@ -102,6 +106,7 @@ class NewAccountWallet extends NewAccountWalletModel {
102106
landingCompany: json['landing_company'],
103107
oauthToken: json['oauth_token'],
104108
currency: json['currency'],
109+
currencyType: json['currency_type'],
105110
landingCompanyShort: json['landing_company_short'],
106111
landingCompanyShortcode: json['landing_company_shortcode'],
107112
);
@@ -114,6 +119,7 @@ class NewAccountWallet extends NewAccountWalletModel {
114119
resultMap['landing_company'] = landingCompany;
115120
resultMap['oauth_token'] = oauthToken;
116121
resultMap['currency'] = currency;
122+
resultMap['currency_type'] = currencyType;
117123
resultMap['landing_company_short'] = landingCompanyShort;
118124
resultMap['landing_company_shortcode'] = landingCompanyShortcode;
119125

@@ -126,6 +132,7 @@ class NewAccountWallet extends NewAccountWalletModel {
126132
String? landingCompany,
127133
String? oauthToken,
128134
String? currency,
135+
String? currencyType,
129136
String? landingCompanyShort,
130137
String? landingCompanyShortcode,
131138
}) =>
@@ -134,6 +141,7 @@ class NewAccountWallet extends NewAccountWalletModel {
134141
landingCompany: landingCompany ?? this.landingCompany,
135142
oauthToken: oauthToken ?? this.oauthToken,
136143
currency: currency ?? this.currency,
144+
currencyType: currencyType ?? this.currencyType,
137145
landingCompanyShort: landingCompanyShort ?? this.landingCompanyShort,
138146
landingCompanyShortcode:
139147
landingCompanyShortcode ?? this.landingCompanyShortcode,

lib/basic_api/generated/new_account_wallet_send.dart

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ class NewAccountWalletRequest extends Request {
1616
this.addressLine2,
1717
this.addressPostcode,
1818
this.addressState,
19+
this.affiliateToken,
20+
this.callingCountryCode,
1921
this.citizen,
2022
this.clientType,
2123
required this.currency,
2224
this.dateOfBirth,
25+
required this.employmentStatus,
26+
this.fatcaDeclaration,
2327
required this.financialAssessment,
2428
this.firstName,
2529
this.landingCompanyShort,
@@ -28,9 +32,14 @@ class NewAccountWalletRequest extends Request {
2832
this.newAccountWallet = true,
2933
this.nonPepDeclaration,
3034
this.phone,
35+
this.placeOfBirth,
36+
required this.residence,
37+
this.residentSelfDeclaration,
3138
required this.salutation,
3239
required this.taxIdentificationNumber,
3340
required this.taxResidence,
41+
this.tinSkipped,
42+
required this.tncAcceptance,
3443
super.msgType = 'new_account_wallet',
3544
super.passthrough,
3645
super.reqId,
@@ -48,10 +57,16 @@ class NewAccountWalletRequest extends Request {
4857
addressLine2: json['address_line_2'] as String?,
4958
addressPostcode: json['address_postcode'] as String?,
5059
addressState: json['address_state'] as String?,
60+
affiliateToken: json['affiliate_token'] as String?,
61+
callingCountryCode: json['calling_country_code'] as String?,
5162
citizen: json['citizen'] as String?,
5263
clientType: json['client_type'] as String?,
5364
currency: json['currency'] as String?,
5465
dateOfBirth: json['date_of_birth'] as String?,
66+
employmentStatus: json['employment_status'] as String?,
67+
fatcaDeclaration: json['fatca_declaration'] == null
68+
? null
69+
: json['fatca_declaration'] == 1,
5570
financialAssessment:
5671
json['financial_assessment'] as Map<String, dynamic>?,
5772
firstName: json['first_name'] as String?,
@@ -63,9 +78,16 @@ class NewAccountWalletRequest extends Request {
6378
: json['new_account_wallet'] == 1,
6479
nonPepDeclaration: json['non_pep_declaration'] as int?,
6580
phone: json['phone'] as String?,
81+
placeOfBirth: json['place_of_birth'] as String?,
82+
residence: json['residence'] as String?,
83+
residentSelfDeclaration: json['resident_self_declaration'] as int?,
6684
salutation: json['salutation'] as String?,
6785
taxIdentificationNumber: json['tax_identification_number'] as String?,
6886
taxResidence: json['tax_residence'] as String?,
87+
tinSkipped:
88+
json['tin_skipped'] == null ? null : json['tin_skipped'] == 1,
89+
tncAcceptance:
90+
json['tnc_acceptance'] == null ? null : json['tnc_acceptance'] == 1,
6991
passthrough: json['passthrough'] as Map<String, dynamic>?,
7092
reqId: json['req_id'] as int?,
7193
);
@@ -94,6 +116,12 @@ class NewAccountWalletRequest extends Request {
94116
/// [Optional] Possible value receive from `states_list` call.
95117
final String? addressState;
96118

119+
/// [Optional] Affiliate token, within 32 characters.
120+
final String? affiliateToken;
121+
122+
/// [Optional] The phone's calling country code. Don't include the `+` sign. Up to 4 digits.
123+
final String? callingCountryCode;
124+
97125
/// [Optional] Country of legal citizenship, 2-letter country code. Possible value receive from `residence_list` call.
98126
final String? citizen;
99127

@@ -106,19 +134,25 @@ class NewAccountWalletRequest extends Request {
106134
/// [Optional] Date of birth format: `yyyy-mm-dd`.
107135
final String? dateOfBirth;
108136

137+
/// Employment Status.
138+
final String? employmentStatus;
139+
140+
/// [Optional] Indicates client's self-declaration of FATCA.
141+
final bool? fatcaDeclaration;
142+
109143
/// Required for maltainvest
110144
final Map<String, dynamic>? financialAssessment;
111145

112-
/// [Optional] Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
146+
/// [Optional] Within 1-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
113147
final String? firstName;
114148

115149
/// [Optional] Set the landing company of the wallet. Default value is 'svg' if company not provided
116150
final String? landingCompanyShort;
117151

118-
/// [Optional] Within 2-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
152+
/// [Optional] Within 1-50 characters, use only letters, spaces, hyphens, full-stops or apostrophes.
119153
final String? lastName;
120154

121-
/// [Optional] The login id of the user. If left unspecified, it defaults to the initial authorized token's login id.
155+
/// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.
122156
final String? loginid;
123157

124158
/// Must be `true`
@@ -127,9 +161,18 @@ class NewAccountWalletRequest extends Request {
127161
/// [Optional] Indicates client's self-declaration of not being a PEP/RCA (Politically Exposed Person/Relatives and Close Associates).
128162
final int? nonPepDeclaration;
129163

130-
/// [Optional] Starting with `+` followed by 8-35 digits, allowing hyphens or space.
164+
/// [Optional] The phone's national format, don't include the `+` sign nor the calling country code. Up to 15 digits are allowed.
131165
final String? phone;
132166

167+
/// [Optional] Place of birth, 2-letter country code.
168+
final String? placeOfBirth;
169+
170+
/// 2-letter country code, possible value receive from `residence_list` call.
171+
final String? residence;
172+
173+
/// [Optional] Indicates client's self declaration for opening account under own initiative, must be 1
174+
final int? residentSelfDeclaration;
175+
133176
/// Accept any value in enum list.
134177
final String? salutation;
135178

@@ -139,6 +182,12 @@ class NewAccountWalletRequest extends Request {
139182
/// Residence for tax purpose. Comma separated iso country code if multiple jurisdictions. Only applicable for real money account. Required for `maltainvest` landing company.
140183
final String? taxResidence;
141184

185+
/// [Optional] Whether the client has skipped the TIN form. Only applicable for real money account.
186+
final bool? tinSkipped;
187+
188+
/// The tnc acceptance status of the user.
189+
final bool? tncAcceptance;
190+
142191
/// Converts this instance to JSON
143192
@override
144193
Map<String, dynamic> toJson() => <String, dynamic>{
@@ -154,10 +203,18 @@ class NewAccountWalletRequest extends Request {
154203
'address_line_2': addressLine2,
155204
'address_postcode': addressPostcode,
156205
'address_state': addressState,
206+
'affiliate_token': affiliateToken,
207+
'calling_country_code': callingCountryCode,
157208
'citizen': citizen,
158209
'client_type': clientType,
159210
'currency': currency,
160211
'date_of_birth': dateOfBirth,
212+
'employment_status': employmentStatus,
213+
'fatca_declaration': fatcaDeclaration == null
214+
? null
215+
: fatcaDeclaration!
216+
? 1
217+
: 0,
161218
'financial_assessment': financialAssessment,
162219
'first_name': firstName,
163220
'landing_company_short': landingCompanyShort,
@@ -170,9 +227,22 @@ class NewAccountWalletRequest extends Request {
170227
: 0,
171228
'non_pep_declaration': nonPepDeclaration,
172229
'phone': phone,
230+
'place_of_birth': placeOfBirth,
231+
'residence': residence,
232+
'resident_self_declaration': residentSelfDeclaration,
173233
'salutation': salutation,
174234
'tax_identification_number': taxIdentificationNumber,
175235
'tax_residence': taxResidence,
236+
'tin_skipped': tinSkipped == null
237+
? null
238+
: tinSkipped!
239+
? 1
240+
: 0,
241+
'tnc_acceptance': tncAcceptance == null
242+
? null
243+
: tncAcceptance!
244+
? 1
245+
: 0,
176246
'passthrough': passthrough,
177247
'req_id': reqId,
178248
};
@@ -188,10 +258,14 @@ class NewAccountWalletRequest extends Request {
188258
String? addressLine2,
189259
String? addressPostcode,
190260
String? addressState,
261+
String? affiliateToken,
262+
String? callingCountryCode,
191263
String? citizen,
192264
String? clientType,
193265
String? currency,
194266
String? dateOfBirth,
267+
String? employmentStatus,
268+
bool? fatcaDeclaration,
195269
Map<String, dynamic>? financialAssessment,
196270
String? firstName,
197271
String? landingCompanyShort,
@@ -200,9 +274,14 @@ class NewAccountWalletRequest extends Request {
200274
bool? newAccountWallet,
201275
int? nonPepDeclaration,
202276
String? phone,
277+
String? placeOfBirth,
278+
String? residence,
279+
int? residentSelfDeclaration,
203280
String? salutation,
204281
String? taxIdentificationNumber,
205282
String? taxResidence,
283+
bool? tinSkipped,
284+
bool? tncAcceptance,
206285
Map<String, dynamic>? passthrough,
207286
int? reqId,
208287
}) =>
@@ -215,10 +294,14 @@ class NewAccountWalletRequest extends Request {
215294
addressLine2: addressLine2 ?? this.addressLine2,
216295
addressPostcode: addressPostcode ?? this.addressPostcode,
217296
addressState: addressState ?? this.addressState,
297+
affiliateToken: affiliateToken ?? this.affiliateToken,
298+
callingCountryCode: callingCountryCode ?? this.callingCountryCode,
218299
citizen: citizen ?? this.citizen,
219300
clientType: clientType ?? this.clientType,
220301
currency: currency ?? this.currency,
221302
dateOfBirth: dateOfBirth ?? this.dateOfBirth,
303+
employmentStatus: employmentStatus ?? this.employmentStatus,
304+
fatcaDeclaration: fatcaDeclaration ?? this.fatcaDeclaration,
222305
financialAssessment: financialAssessment ?? this.financialAssessment,
223306
firstName: firstName ?? this.firstName,
224307
landingCompanyShort: landingCompanyShort ?? this.landingCompanyShort,
@@ -227,10 +310,16 @@ class NewAccountWalletRequest extends Request {
227310
newAccountWallet: newAccountWallet ?? this.newAccountWallet,
228311
nonPepDeclaration: nonPepDeclaration ?? this.nonPepDeclaration,
229312
phone: phone ?? this.phone,
313+
placeOfBirth: placeOfBirth ?? this.placeOfBirth,
314+
residence: residence ?? this.residence,
315+
residentSelfDeclaration:
316+
residentSelfDeclaration ?? this.residentSelfDeclaration,
230317
salutation: salutation ?? this.salutation,
231318
taxIdentificationNumber:
232319
taxIdentificationNumber ?? this.taxIdentificationNumber,
233320
taxResidence: taxResidence ?? this.taxResidence,
321+
tinSkipped: tinSkipped ?? this.tinSkipped,
322+
tncAcceptance: tncAcceptance ?? this.tncAcceptance,
234323
passthrough: passthrough ?? this.passthrough,
235324
reqId: reqId ?? this.reqId,
236325
);

test/api/account/new_account_wallet/new_account_wallet_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ void main() {
2222
salutation: '',
2323
taxIdentificationNumber: '',
2424
taxResidence: '',
25+
employmentStatus: '',
26+
residence: '',
27+
dateOfBirth: '',
28+
tncAcceptance: true,
2529
),
2630
);
2731

0 commit comments

Comments
 (0)