@tap-payments/auth-jsconnect 2.0.124-test → 2.0.126-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/features/app/business/businessStore.js +1 -1
- package/build/features/app/connect/connectStore.js +60 -65
- package/build/features/app/individual/individualStore.d.ts +1 -0
- package/build/features/app/individual/individualStore.js +3 -2
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -4
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -4
- package/build/features/connect/screens/Individual/Individual.js +3 -1
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -4
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -4
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -4
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -4
- package/build/utils/array.d.ts +36 -0
- package/build/utils/array.js +32 -0
- package/package.json +1 -1
|
@@ -220,7 +220,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
220
220
|
hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
|
|
221
221
|
hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
|
|
222
222
|
isIdentityAuthStep = data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH;
|
|
223
|
-
if (!(isSA(countryIso2) && !isIdentityAuthStep)) return [3, 4];
|
|
223
|
+
if (!(isSA(countryIso2) && !isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 4];
|
|
224
224
|
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
225
225
|
case 3:
|
|
226
226
|
_j.sent();
|
|
@@ -72,7 +72,7 @@ import { FlowsTypes, AuthForType } from '../../../@types';
|
|
|
72
72
|
import API from '../../../api';
|
|
73
73
|
import { CONNECT_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_BRAND } from '../../../constants';
|
|
74
74
|
import { defaultCountry } from '../../../constants';
|
|
75
|
-
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, getEighteenYearsAgo, sleep, findCountryByIddPrefix, concatenateObjectValues, isTwitter, isWebsite } from '../../../utils';
|
|
75
|
+
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, getEighteenYearsAgo, sleep, findCountryByIddPrefix, concatenateObjectValues, isTwitter, isWebsite, fixBrandList } from '../../../utils';
|
|
76
76
|
export var createMobileAuth = createAsyncThunk('createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
77
77
|
var settings, requestBody, data;
|
|
78
78
|
var _a, _b;
|
|
@@ -226,7 +226,7 @@ export var resendOTPNID = createAsyncThunk('resendOTPNID', function (params, thu
|
|
|
226
226
|
});
|
|
227
227
|
}); });
|
|
228
228
|
export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
229
|
-
var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, individual_id, leadBody, leadResponse, _c, isNewUser, brands, err_1,
|
|
229
|
+
var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, individual_id, leadBody, leadResponse, _c, isNewUser, channels, brands, err_1, countryCode, contact, name, _d, phone, email, userInfoMissed;
|
|
230
230
|
var _e, _f, _g, _h;
|
|
231
231
|
return __generator(this, function (_j) {
|
|
232
232
|
switch (_j.label) {
|
|
@@ -272,24 +272,23 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
272
272
|
if ((_f = leadResponse.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
273
273
|
throw new Error(leadResponse.errors[0].description);
|
|
274
274
|
isNewUser = leadResponse.is_new_individual;
|
|
275
|
-
if (!!isNewUser) return [3,
|
|
276
|
-
|
|
275
|
+
if (!!isNewUser) return [3, 10];
|
|
276
|
+
return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
277
277
|
case 6:
|
|
278
|
-
_j.
|
|
279
|
-
|
|
278
|
+
channels = (_j.sent()).list;
|
|
279
|
+
leadResponse.channel_list = channels;
|
|
280
|
+
_j.label = 7;
|
|
280
281
|
case 7:
|
|
281
|
-
|
|
282
|
-
leadResponse.
|
|
283
|
-
return [3, 9];
|
|
282
|
+
_j.trys.push([7, 9, , 10]);
|
|
283
|
+
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
284
284
|
case 8:
|
|
285
|
+
brands = (_j.sent()).brands;
|
|
286
|
+
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
287
|
+
return [3, 10];
|
|
288
|
+
case 9:
|
|
285
289
|
err_1 = _j.sent();
|
|
286
|
-
return [3,
|
|
287
|
-
case 9: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
290
|
+
return [3, 10];
|
|
288
291
|
case 10:
|
|
289
|
-
channels = (_j.sent()).list;
|
|
290
|
-
leadResponse.channel_list = channels;
|
|
291
|
-
_j.label = 11;
|
|
292
|
-
case 11:
|
|
293
292
|
countryCode = settings.data.businessCountry;
|
|
294
293
|
contact = leadResponse.contact, name = leadResponse.name;
|
|
295
294
|
_d = contact || {}, phone = _d.phone, email = _d.email;
|
|
@@ -307,7 +306,7 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
307
306
|
});
|
|
308
307
|
}); });
|
|
309
308
|
export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
310
|
-
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, individual_id, leadBody, leadResponse, _b, isNewUser, countryCode, contact, name_1, _c, phone, email, userInfoMissed, brands, err_2
|
|
309
|
+
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, individual_id, leadBody, leadResponse, _b, isNewUser, countryCode, contact, name_1, _c, phone, email, userInfoMissed, channels, brands, err_2;
|
|
311
310
|
var _d, _e, _f, _g, _h;
|
|
312
311
|
return __generator(this, function (_j) {
|
|
313
312
|
switch (_j.label) {
|
|
@@ -320,15 +319,15 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
320
319
|
count = 1;
|
|
321
320
|
_j.label = 1;
|
|
322
321
|
case 1:
|
|
323
|
-
if (!(count <= maxCalls)) return [3,
|
|
322
|
+
if (!(count <= maxCalls)) return [3, 16];
|
|
324
323
|
if (thunkApi.signal.aborted) {
|
|
325
|
-
return [3,
|
|
324
|
+
return [3, 16];
|
|
326
325
|
}
|
|
327
326
|
return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
|
|
328
327
|
case 2:
|
|
329
328
|
authResponse = _j.sent();
|
|
330
329
|
isSuccess = ((_d = authResponse.status) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'success';
|
|
331
|
-
if (!isSuccess) return [3,
|
|
330
|
+
if (!isSuccess) return [3, 13];
|
|
332
331
|
return [4, ((_e = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params))];
|
|
333
332
|
case 3:
|
|
334
333
|
_j.sent();
|
|
@@ -355,24 +354,23 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
355
354
|
contact = leadResponse.contact, name_1 = leadResponse.name;
|
|
356
355
|
_c = contact || {}, phone = _c.phone, email = _c.email;
|
|
357
356
|
userInfoMissed = (!phone || !email || !name_1) && !isNewUser;
|
|
358
|
-
if (!!isNewUser) return [3,
|
|
359
|
-
|
|
357
|
+
if (!!isNewUser) return [3, 12];
|
|
358
|
+
return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
360
359
|
case 8:
|
|
361
|
-
_j.
|
|
362
|
-
|
|
360
|
+
channels = (_j.sent()).list;
|
|
361
|
+
leadResponse.channel_list = channels;
|
|
362
|
+
_j.label = 9;
|
|
363
363
|
case 9:
|
|
364
|
-
|
|
365
|
-
leadResponse.
|
|
366
|
-
return [3, 11];
|
|
364
|
+
_j.trys.push([9, 11, , 12]);
|
|
365
|
+
return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
|
|
367
366
|
case 10:
|
|
367
|
+
brands = (_j.sent()).brands;
|
|
368
|
+
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
369
|
+
return [3, 12];
|
|
370
|
+
case 11:
|
|
368
371
|
err_2 = _j.sent();
|
|
369
|
-
return [3,
|
|
370
|
-
case 11: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
|
|
372
|
+
return [3, 12];
|
|
371
373
|
case 12:
|
|
372
|
-
channels = (_j.sent()).list;
|
|
373
|
-
leadResponse.channel_list = channels;
|
|
374
|
-
_j.label = 13;
|
|
375
|
-
case 13:
|
|
376
374
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
377
375
|
countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
|
|
378
376
|
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, {});
|
|
@@ -382,14 +380,14 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
382
380
|
}
|
|
383
381
|
thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
|
|
384
382
|
return [2, { authResponse: authResponse, leadResponse: leadResponse, isNewUser: isNewUser, countryCode: countryCode, userInfoMissed: userInfoMissed }];
|
|
385
|
-
case
|
|
386
|
-
case
|
|
383
|
+
case 13: return [4, sleep(interval * 1000)];
|
|
384
|
+
case 14:
|
|
387
385
|
_j.sent();
|
|
388
|
-
_j.label =
|
|
389
|
-
case
|
|
386
|
+
_j.label = 15;
|
|
387
|
+
case 15:
|
|
390
388
|
count++;
|
|
391
389
|
return [3, 1];
|
|
392
|
-
case
|
|
390
|
+
case 16: throw new Error('paci_verification_failed');
|
|
393
391
|
}
|
|
394
392
|
});
|
|
395
393
|
}); });
|
|
@@ -434,13 +432,14 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
|
|
|
434
432
|
});
|
|
435
433
|
}); });
|
|
436
434
|
export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
437
|
-
var _a, settings, connect, responseBody, isNewBrand, brandName, salesChannels, selectedBrandItem, getAddress, channel_services, payload_1,
|
|
438
|
-
var _b, _c, _d, _e, _f
|
|
439
|
-
return __generator(this, function (
|
|
440
|
-
switch (
|
|
435
|
+
var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, brandNameBody, payload, lead, brandReqBody, brand;
|
|
436
|
+
var _b, _c, _d, _e, _f;
|
|
437
|
+
return __generator(this, function (_g) {
|
|
438
|
+
switch (_g.label) {
|
|
441
439
|
case 0:
|
|
442
440
|
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
443
441
|
responseBody = connect.data.otpData.responseBody;
|
|
442
|
+
leadBrandId = responseBody === null || responseBody === void 0 ? void 0 : responseBody.brand_id;
|
|
444
443
|
isNewBrand = params.isNewBrand, brandName = params.brandName, salesChannels = params.salesChannels, selectedBrandItem = params.selectedBrandItem;
|
|
445
444
|
getAddress = function (value, isTwitter, isWeb) {
|
|
446
445
|
if (isTwitter)
|
|
@@ -459,7 +458,8 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
459
458
|
})
|
|
460
459
|
};
|
|
461
460
|
});
|
|
462
|
-
if (!!isNewBrand) return [3,
|
|
461
|
+
if (!!isNewBrand) return [3, 4];
|
|
462
|
+
if (!(leadBrandId !== (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id))) return [3, 2];
|
|
463
463
|
payload_1 = {
|
|
464
464
|
brand: {
|
|
465
465
|
id: (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id) || ''
|
|
@@ -469,20 +469,22 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
469
469
|
};
|
|
470
470
|
return [4, API.leadService.updateLead(payload_1)];
|
|
471
471
|
case 1:
|
|
472
|
-
|
|
472
|
+
_g.sent();
|
|
473
|
+
_g.label = 2;
|
|
474
|
+
case 2:
|
|
473
475
|
brandReqBody_1 = {
|
|
474
|
-
id: (
|
|
476
|
+
id: (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id) || '',
|
|
475
477
|
channel_services: channel_services,
|
|
476
478
|
step_name: CONNECT_STEP_NAMES.UPDATE_BRAND_INFO
|
|
477
479
|
};
|
|
478
480
|
return [4, API.brandService.updateBrandInfo(brandReqBody_1)];
|
|
479
|
-
case
|
|
480
|
-
brand_1 =
|
|
481
|
+
case 3:
|
|
482
|
+
brand_1 = _g.sent();
|
|
481
483
|
thunkApi.dispatch(updateLeadSuccess());
|
|
482
484
|
thunkApi.dispatch(handleNextScreenStep());
|
|
483
|
-
(
|
|
485
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, params);
|
|
484
486
|
return [2, { response: brand_1, formData: params }];
|
|
485
|
-
case
|
|
487
|
+
case 4:
|
|
486
488
|
brandNameBody = {
|
|
487
489
|
name: {
|
|
488
490
|
en: brandName,
|
|
@@ -497,20 +499,20 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
497
499
|
encryption_contract: ['brand.name.en', 'brand.name.ar', 'brand.name.zh']
|
|
498
500
|
};
|
|
499
501
|
return [4, API.leadService.updateLead(payload)];
|
|
500
|
-
case
|
|
501
|
-
lead =
|
|
502
|
+
case 5:
|
|
503
|
+
lead = _g.sent();
|
|
502
504
|
brandReqBody = {
|
|
503
|
-
id: ((
|
|
505
|
+
id: ((_d = lead.brand) === null || _d === void 0 ? void 0 : _d.id) || '',
|
|
504
506
|
channel_services: channel_services,
|
|
505
507
|
term: ['agree'],
|
|
506
508
|
step_name: CONNECT_STEP_NAMES.UPDATE_BRAND_INFO
|
|
507
509
|
};
|
|
508
510
|
return [4, API.brandService.updateBrandInfo(brandReqBody)];
|
|
509
|
-
case
|
|
510
|
-
brand =
|
|
511
|
+
case 6:
|
|
512
|
+
brand = _g.sent();
|
|
511
513
|
thunkApi.dispatch(updateLeadSuccess());
|
|
512
514
|
thunkApi.dispatch(handleNextScreenStep());
|
|
513
|
-
(
|
|
515
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
|
|
514
516
|
return [2, { response: brand, formData: params }];
|
|
515
517
|
}
|
|
516
518
|
});
|
|
@@ -752,7 +754,7 @@ export var connectSlice = createSlice({
|
|
|
752
754
|
if ((brand_list === null || brand_list === void 0 ? void 0 : brand_list.length) > 0) {
|
|
753
755
|
var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
|
|
754
756
|
brandList = __spreadArray([], brand_list, true);
|
|
755
|
-
if (!isBrandExist)
|
|
757
|
+
if (!isBrandExist && brand)
|
|
756
758
|
brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: [] })], false);
|
|
757
759
|
brandList = __spreadArray(__spreadArray([], brandList, true), [OTHER_BRAND], false);
|
|
758
760
|
state.data.brandData.selectedBrandItem = brandList[0];
|
|
@@ -762,7 +764,7 @@ export var connectSlice = createSlice({
|
|
|
762
764
|
channel_list: channel_list
|
|
763
765
|
};
|
|
764
766
|
}
|
|
765
|
-
state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, name: name, contact: contact, userInfoMissed: userInfoMissed });
|
|
767
|
+
state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, brand_id: brand === null || brand === void 0 ? void 0 : brand.id, name: name, contact: contact, userInfoMissed: userInfoMissed });
|
|
766
768
|
})
|
|
767
769
|
.addCase(verifyPACI.rejected, function (state, action) {
|
|
768
770
|
state.loading = false;
|
|
@@ -796,7 +798,7 @@ export var connectSlice = createSlice({
|
|
|
796
798
|
if ((brand_list === null || brand_list === void 0 ? void 0 : brand_list.length) > 0) {
|
|
797
799
|
var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
|
|
798
800
|
brandList = __spreadArray([], brand_list, true);
|
|
799
|
-
if (!isBrandExist)
|
|
801
|
+
if (!isBrandExist && brand)
|
|
800
802
|
brandList = __spreadArray(__spreadArray([], brandList, true), [__assign(__assign({}, brand), { channel_services: [] })], false);
|
|
801
803
|
brandList = __spreadArray(__spreadArray([], brandList, true), [OTHER_BRAND], false);
|
|
802
804
|
state.data.brandData.selectedBrandItem = brandList[0];
|
|
@@ -806,7 +808,7 @@ export var connectSlice = createSlice({
|
|
|
806
808
|
channel_list: channel_list
|
|
807
809
|
};
|
|
808
810
|
}
|
|
809
|
-
state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, name: name, contact: contact, userInfoMissed: userInfoMissed });
|
|
811
|
+
state.data.otpData.responseBody = __assign(__assign({}, authResponse), { is_new_individual: is_new_individual, lead_id: id, brand_id: brand === null || brand === void 0 ? void 0 : brand.id, name: name, contact: contact, userInfoMissed: userInfoMissed });
|
|
810
812
|
})
|
|
811
813
|
.addCase(verifyAuth.pending, function (state) {
|
|
812
814
|
state.loading = true;
|
|
@@ -870,13 +872,6 @@ export var connectSlice = createSlice({
|
|
|
870
872
|
});
|
|
871
873
|
state.data.brandData.termAndConditionChecked = !!termAndCondition;
|
|
872
874
|
}
|
|
873
|
-
if (brand_list) {
|
|
874
|
-
var isBrandExist = brand_list.find(function (item) { return item.id === (brand === null || brand === void 0 ? void 0 : brand.id); });
|
|
875
|
-
state.data.brandData.responseBody = { brand_list: brand_list.concat(OTHER_BRAND) };
|
|
876
|
-
if (!isBrandExist)
|
|
877
|
-
state.data.brandData.responseBody.brand_list = brand_list.concat(__assign(__assign({}, brand), { channel_services: [] }), OTHER_BRAND);
|
|
878
|
-
state.data.brandData.selectedBrandItem = brand_list[0];
|
|
879
|
-
}
|
|
880
875
|
if (channel_list) {
|
|
881
876
|
state.data.brandData.responseBody = __assign(__assign({}, state.data.brandData.responseBody), { channel_list: channel_list });
|
|
882
877
|
}
|
|
@@ -251,6 +251,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
251
251
|
name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
|
|
252
252
|
contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
|
|
253
253
|
countries: countries,
|
|
254
|
+
countryCode: countryCode,
|
|
254
255
|
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
255
256
|
flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info)
|
|
256
257
|
},
|
|
@@ -433,7 +434,7 @@ export var individualSlice = createSlice({
|
|
|
433
434
|
state.data.otpData = formData;
|
|
434
435
|
state.data.otpData.responseBody = data;
|
|
435
436
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
|
|
436
|
-
var _c = boardResponse || {}, countries = _c.countries, user = _c.user;
|
|
437
|
+
var _c = boardResponse || {}, countries = _c.countries, user = _c.user, countryCode = _c.countryCode;
|
|
437
438
|
var _d = user || {}, source_income = _d.source_income, monthly_income = _d.monthly_income, occupation = _d.occupation, is_relative_PEP = _d.is_relative_PEP, is_influencer = _d.is_influencer;
|
|
438
439
|
var _e = state.data.individualData.responseBody || {}, sourceIncomeList = _e.sourceIncomeList, monthlyIncomeList = _e.monthlyIncomeList, occupationList = _e.occupationList;
|
|
439
440
|
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) ||
|
|
@@ -444,7 +445,7 @@ export var individualSlice = createSlice({
|
|
|
444
445
|
(monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList[2]);
|
|
445
446
|
if (!!selectedMonthlyIncome)
|
|
446
447
|
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
447
|
-
var code = user === null || user === void 0 ? void 0 : user.employer_country;
|
|
448
|
+
var code = (user === null || user === void 0 ? void 0 : user.employer_country) || countryCode;
|
|
448
449
|
if (!!code) {
|
|
449
450
|
var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
|
|
450
451
|
state.data.individualData.employerLocation = employerLocation;
|
|
@@ -62,7 +62,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
62
62
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
63
63
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
64
64
|
var identification = user.identification;
|
|
65
|
-
var maskedId =
|
|
65
|
+
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
66
66
|
var settings = useAppSelector(settingsSelector);
|
|
67
67
|
var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
|
|
68
68
|
var email = (contact || { email: '' }).email;
|
|
@@ -78,10 +78,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
78
78
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
79
79
|
individual_name: username.toLowerCase() + maskedId,
|
|
80
80
|
business_type: brandName,
|
|
81
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
81
|
+
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
82
82
|
bank_name: bankName,
|
|
83
|
-
iban: t('masking_symbols') + iban,
|
|
84
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
83
|
+
iban: iban ? t('masking_symbols') + iban : '',
|
|
84
|
+
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
85
85
|
});
|
|
86
86
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
87
87
|
var isIndividual = name === 'individual';
|
|
@@ -61,7 +61,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
61
61
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
62
62
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
63
63
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
64
|
-
var maskedId =
|
|
64
|
+
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
65
65
|
var settings = useAppSelector(settingsSelector);
|
|
66
66
|
var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
|
|
67
67
|
var email = (contact || { email: '' }).email;
|
|
@@ -77,10 +77,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
77
77
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
78
78
|
individual_name: username.toLowerCase() + maskedId,
|
|
79
79
|
business_type: brandName,
|
|
80
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
80
|
+
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
81
81
|
bank_name: bankName,
|
|
82
|
-
iban: t('masking_symbols') + iban,
|
|
83
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
82
|
+
iban: iban ? t('masking_symbols') + iban : '',
|
|
83
|
+
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
84
84
|
});
|
|
85
85
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
86
86
|
var isIndividual = name === 'individual';
|
|
@@ -43,7 +43,9 @@ import Collapse from '../../../../components/Collapse';
|
|
|
43
43
|
import { isKW } from '../../../../utils';
|
|
44
44
|
var FormStyled = styled(Form)(function () { return ({
|
|
45
45
|
display: 'flex',
|
|
46
|
-
flexDirection: 'column'
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
minHeight: '240px',
|
|
48
|
+
justifyContent: 'space-between'
|
|
47
49
|
}); });
|
|
48
50
|
var Individual = function (_a) {
|
|
49
51
|
var _b = React.useState(false), listActive = _b[0], setListActive = _b[1];
|
|
@@ -59,7 +59,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
59
59
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
60
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
61
|
var identification = (user || {}).identification;
|
|
62
|
-
var maskedId =
|
|
62
|
+
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
63
63
|
var settings = useAppSelector(settingsSelector);
|
|
64
64
|
var _g = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _g.contact, board_id = _g.board_id, board_info_id = _g.board_info_id;
|
|
65
65
|
var email = (contact || { email: '' }).email;
|
|
@@ -75,10 +75,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
75
75
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
76
76
|
individual_name: username.toLowerCase() + maskedId,
|
|
77
77
|
business_type: brandName,
|
|
78
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
78
|
+
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
79
79
|
bank_name: bankName,
|
|
80
|
-
iban: t('masking_symbols') + iban,
|
|
81
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
80
|
+
iban: iban ? t('masking_symbols') + iban : '',
|
|
81
|
+
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
82
82
|
});
|
|
83
83
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
84
84
|
var isIndividual = name === 'individual';
|
|
@@ -62,7 +62,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
62
62
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
63
63
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
64
64
|
var identification = (user || {}).identification;
|
|
65
|
-
var maskedId =
|
|
65
|
+
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
66
66
|
var settings = useAppSelector(settingsSelector);
|
|
67
67
|
var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
|
|
68
68
|
var email = (contact || { email: '' }).email;
|
|
@@ -78,10 +78,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
78
78
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
79
79
|
individual_name: username.toLowerCase() + maskedId,
|
|
80
80
|
business_type: brandName,
|
|
81
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
81
|
+
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
82
82
|
bank_name: bankName,
|
|
83
|
-
iban: t('masking_symbols') + iban,
|
|
84
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
83
|
+
iban: iban ? t('masking_symbols') + iban : '',
|
|
84
|
+
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
85
85
|
});
|
|
86
86
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
87
87
|
var isIndividual = name === 'individual';
|
|
@@ -62,7 +62,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
62
62
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
63
63
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
64
64
|
var identification = user.identification;
|
|
65
|
-
var maskedId =
|
|
65
|
+
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
66
66
|
var settings = useAppSelector(settingsSelector);
|
|
67
67
|
var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
|
|
68
68
|
var email = (contact || { email: '' }).email;
|
|
@@ -78,10 +78,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
78
78
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
79
79
|
individual_name: username.toLowerCase() + maskedId,
|
|
80
80
|
business_type: brandName,
|
|
81
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
81
|
+
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
82
82
|
bank_name: bankName,
|
|
83
|
-
iban: t('masking_symbols') + iban,
|
|
84
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
83
|
+
iban: iban ? t('masking_symbols') + iban : '',
|
|
84
|
+
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
85
85
|
});
|
|
86
86
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
87
87
|
var isIndividual = name === 'individual';
|
|
@@ -62,7 +62,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
62
62
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
63
63
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
64
64
|
var identification = user.identification;
|
|
65
|
-
var maskedId =
|
|
65
|
+
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
66
66
|
var settings = useAppSelector(settingsSelector);
|
|
67
67
|
var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
|
|
68
68
|
var email = (contact || { email: '' }).email;
|
|
@@ -78,10 +78,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
78
78
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
79
79
|
individual_name: username.toLowerCase() + maskedId,
|
|
80
80
|
business_type: brandName,
|
|
81
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
81
|
+
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
82
82
|
bank_name: bankName,
|
|
83
|
-
iban: t('masking_symbols') + iban,
|
|
84
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
83
|
+
iban: iban ? t('masking_symbols') + iban : '',
|
|
84
|
+
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
85
85
|
});
|
|
86
86
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
87
87
|
var isIndividual = name === 'individual';
|
package/build/utils/array.d.ts
CHANGED
|
@@ -23,3 +23,39 @@ export declare const mapSalesChannel: (salesChannel: Array<SaleChannel>) => {
|
|
|
23
23
|
} | undefined;
|
|
24
24
|
logo?: string | undefined;
|
|
25
25
|
}[];
|
|
26
|
+
export declare const mapBrandSalesChannel: (salesChannel: Array<SaleChannel>, brandSalesChannel: Array<SaleChannel>) => ({
|
|
27
|
+
sub: ({
|
|
28
|
+
id: string;
|
|
29
|
+
code: string;
|
|
30
|
+
name?: {
|
|
31
|
+
ar: string;
|
|
32
|
+
en: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
address?: string | undefined;
|
|
35
|
+
logo?: string | undefined;
|
|
36
|
+
} | undefined)[] | undefined;
|
|
37
|
+
id: string;
|
|
38
|
+
code: string;
|
|
39
|
+
name?: {
|
|
40
|
+
ar: string;
|
|
41
|
+
en: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
address?: string | undefined;
|
|
44
|
+
logo?: string | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
sub?: import("../@types").SubSaleChannel[] | undefined;
|
|
47
|
+
id: string;
|
|
48
|
+
code: string;
|
|
49
|
+
name?: {
|
|
50
|
+
ar: string;
|
|
51
|
+
en: string;
|
|
52
|
+
} | undefined;
|
|
53
|
+
address?: string | undefined;
|
|
54
|
+
logo?: string | undefined;
|
|
55
|
+
} | undefined)[];
|
|
56
|
+
export declare const removeDuplicationById: (items: Array<any>) => any[];
|
|
57
|
+
export declare const fixBrandList: (items: Array<{
|
|
58
|
+
channel_services: Array<SaleChannel>;
|
|
59
|
+
}>, salesChannel: Array<SaleChannel>) => {
|
|
60
|
+
channel_services: any[];
|
|
61
|
+
}[];
|
package/build/utils/array.js
CHANGED
|
@@ -89,3 +89,35 @@ export var mapSalesChannel = function (salesChannel) {
|
|
|
89
89
|
}));
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
|
+
export var mapBrandSalesChannel = function (salesChannel, brandSalesChannel) {
|
|
93
|
+
var findSalesChannel = function (id) { return salesChannel.find(function (item) { return item.id === id; }); };
|
|
94
|
+
var mapped = brandSalesChannel
|
|
95
|
+
.map(function (item) {
|
|
96
|
+
var _a;
|
|
97
|
+
var originalSalasChannel = findSalesChannel(item.id);
|
|
98
|
+
if (!originalSalasChannel)
|
|
99
|
+
return undefined;
|
|
100
|
+
var hasSub = item.sub && item.sub.length > 0;
|
|
101
|
+
if (hasSub)
|
|
102
|
+
return __assign(__assign({}, item), { sub: (_a = originalSalasChannel.sub) === null || _a === void 0 ? void 0 : _a.map(function (subItem) {
|
|
103
|
+
var _a;
|
|
104
|
+
var brandSubItem = (_a = item.sub) === null || _a === void 0 ? void 0 : _a.find(function (brandSub) { return brandSub.id === subItem.id; });
|
|
105
|
+
if (!brandSubItem)
|
|
106
|
+
return undefined;
|
|
107
|
+
return __assign(__assign({}, subItem), brandSubItem);
|
|
108
|
+
}).filter(Boolean) });
|
|
109
|
+
return __assign({}, item);
|
|
110
|
+
})
|
|
111
|
+
.filter(Boolean);
|
|
112
|
+
return mapped;
|
|
113
|
+
};
|
|
114
|
+
export var removeDuplicationById = function (items) {
|
|
115
|
+
return items.filter(function (item, index) {
|
|
116
|
+
return items.findIndex(function (i) { return i.id === item.id; }) === index;
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
export var fixBrandList = function (items, salesChannel) {
|
|
120
|
+
return items.map(function (item) {
|
|
121
|
+
return __assign(__assign({}, item), { channel_services: removeDuplicationById(mapBrandSalesChannel(salesChannel, item.channel_services || [])) });
|
|
122
|
+
});
|
|
123
|
+
};
|