@tap-payments/auth-jsconnect 1.0.68 → 1.0.71
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/@types/app.d.ts +3 -3
- package/build/api/data.d.ts +1 -0
- package/build/api/data.js +5 -1
- package/build/api/index.d.ts +1 -0
- package/build/assets/locales/ar.json +2 -1
- package/build/assets/locales/en.json +2 -1
- package/build/components/SimpleList/SimpleList.js +3 -0
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/assets.d.ts +7 -0
- package/build/constants/assets.js +13 -6
- package/build/constants/dummy.d.ts +1 -1
- package/build/constants/dummy.js +6 -6
- package/build/features/app/business/businessStore.js +4 -2
- package/build/features/app/connect/connectStore.js +4 -2
- package/build/features/app/individual/individualStore.d.ts +8 -1
- package/build/features/app/individual/individualStore.js +85 -15
- package/build/features/bank/screens/BankDetails/BankName.js +18 -5
- package/build/features/bank/screens/BankDetails/IBAN.js +1 -8
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -3
- package/build/features/bank/screens/BankDetails/validation.js +1 -1
- package/build/features/bank/screens/Verify/Verify.js +3 -4
- package/build/features/business/screens/Activities/Activities.js +2 -3
- package/build/features/business/screens/Activities/ActivitiesList.js +2 -3
- package/build/features/business/screens/Activities/SalesChannels.js +2 -3
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -3
- package/build/features/business/screens/BusinessType/LicenseList.js +2 -3
- package/build/features/business/screens/Customers/CustomerLocations.js +2 -3
- package/build/features/business/screens/Customers/Customers.js +2 -3
- package/build/features/business/screens/Customers/ExpectedCustomers.js +2 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +2 -3
- package/build/features/business/screens/IDBOD/DOB.js +6 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +3 -8
- package/build/features/business/screens/OTP/OTP.js +3 -4
- package/build/features/business/screens/OTP/OTPInput.js +2 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/business/screens/Verify/Verify.js +3 -4
- package/build/features/connect/screens/Individual/Individual.js +2 -3
- package/build/features/connect/screens/Individual/MobileNumber.js +22 -8
- package/build/features/connect/screens/Merchant/BrandName.js +2 -3
- package/build/features/connect/screens/Merchant/Merchant.js +2 -3
- package/build/features/connect/screens/Mobile/Mobile.js +3 -4
- package/build/features/connect/screens/Mobile/MobileNumber.js +25 -9
- package/build/features/connect/screens/NID/DOB.js +2 -3
- package/build/features/connect/screens/NID/NID.js +3 -4
- package/build/features/connect/screens/OTP/OTP.js +2 -3
- package/build/features/connect/screens/OTP/OTPInput.js +2 -3
- package/build/features/individual/Individual.js +6 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +5 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +1 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +18 -12
- package/build/features/individual/screens/Verify/Verify.js +3 -4
- package/build/features/password/screens/Verify/Verify.js +3 -4
- package/build/features/shared/Button/SuccessButton.d.ts +9 -0
- package/build/features/shared/Button/SuccessButton.js +71 -0
- package/build/features/shared/Button/index.d.ts +2 -1
- package/build/features/shared/Button/index.js +2 -1
- package/build/features/shared/Footer/Footer.js +2 -3
- package/build/features/shared/Search/Search.d.ts +7 -0
- package/build/features/shared/Search/Search.js +25 -0
- package/build/features/shared/Search/index.d.ts +2 -0
- package/build/features/shared/Search/index.js +2 -0
- package/build/features/shared/SearchIcon/SearchIcon.d.ts +6 -0
- package/build/features/shared/SearchIcon/SearchIcon.js +26 -0
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -3
- package/build/features/tax/screens/Verify/Verify.js +3 -4
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
package/build/api/data.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ declare const dataService: {
|
|
|
3
3
|
getCustomerBases: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
getExpectedSales: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
5
|
getExpectedCustomerSales: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
getSourceOfIncome: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
7
|
};
|
|
7
8
|
export { dataService };
|
package/build/api/data.js
CHANGED
|
@@ -12,10 +12,14 @@ var getExpectedSales = function () {
|
|
|
12
12
|
var getExpectedCustomerSales = function () {
|
|
13
13
|
return instance.get("".concat(ENDPOINT_PATHS.EXPECTED_CUSTOMERS));
|
|
14
14
|
};
|
|
15
|
+
var getSourceOfIncome = function () {
|
|
16
|
+
return instance.get("".concat(ENDPOINT_PATHS.SOURCE_INCOME));
|
|
17
|
+
};
|
|
15
18
|
var dataService = {
|
|
16
19
|
getChannelsOfServices: getChannelsOfServices,
|
|
17
20
|
getCustomerBases: getCustomerBases,
|
|
18
21
|
getExpectedSales: getExpectedSales,
|
|
19
|
-
getExpectedCustomerSales: getExpectedCustomerSales
|
|
22
|
+
getExpectedCustomerSales: getExpectedCustomerSales,
|
|
23
|
+
getSourceOfIncome: getSourceOfIncome
|
|
20
24
|
};
|
|
21
25
|
export { dataService };
|
package/build/api/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ declare const API: {
|
|
|
50
50
|
getCustomerBases: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
51
51
|
getExpectedSales: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
52
52
|
getExpectedCustomerSales: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
53
|
+
getSourceOfIncome: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
56
|
export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody };
|
|
@@ -69,6 +69,9 @@ var ListItemStyled = styled(ListItem)(function (_a) {
|
|
|
69
69
|
function SimpleList(_a) {
|
|
70
70
|
var list = _a.list, listItemProps = _a.listItemProps, onSelectItem = _a.onSelectItem, renderItem = _a.renderItem, children = _a.children, searchKeyPath = _a.searchKeyPath, rest = __rest(_a, ["list", "listItemProps", "onSelectItem", "renderItem", "children", "searchKeyPath"]);
|
|
71
71
|
var _b = React.useState(list), items = _b[0], setItems = _b[1];
|
|
72
|
+
React.useEffect(function () {
|
|
73
|
+
setItems(list);
|
|
74
|
+
}, [list]);
|
|
72
75
|
var filterItems = function (arr, searchKey) {
|
|
73
76
|
return arr.filter(function (item) {
|
|
74
77
|
var searchValue = get(item, searchKeyPath || '') || '';
|
package/build/constants/api.d.ts
CHANGED
package/build/constants/api.js
CHANGED
|
@@ -18,6 +18,7 @@ var CHANNEL_PATH = '/channel';
|
|
|
18
18
|
var CUSTOMER_BASES_PATH = '/customerBases';
|
|
19
19
|
var SALES_PATH = '/sales';
|
|
20
20
|
var EXPECTED_CUSTOMERS_PATH = '/expectedCustomers';
|
|
21
|
+
var SOURCE_INCOME_PATH = '/v2/sourceOfIncome';
|
|
21
22
|
var FIREBASE_URL = 'https://goconnect-195cd-default-rtdb.asia-southeast1.firebasedatabase.app/sandbox/local.json';
|
|
22
23
|
export var ENDPOINT_PATHS = {
|
|
23
24
|
BASE_URL: API_BASE_URL,
|
|
@@ -39,6 +40,7 @@ export var ENDPOINT_PATHS = {
|
|
|
39
40
|
CUSTOMER_BASES: CUSTOMER_BASES_PATH,
|
|
40
41
|
SALES: SALES_PATH,
|
|
41
42
|
EXPECTED_CUSTOMERS: EXPECTED_CUSTOMERS_PATH,
|
|
43
|
+
SOURCE_INCOME: SOURCE_INCOME_PATH,
|
|
42
44
|
BANK: BANK_PATH,
|
|
43
45
|
IBAN_BANK: IBAN_PATH
|
|
44
46
|
};
|
|
@@ -35,6 +35,7 @@ export declare const ICONS_NAMES: {
|
|
|
35
35
|
ABSHER_LOGO: string;
|
|
36
36
|
EMAIL_ICON: string;
|
|
37
37
|
MOBILE_ICON: string;
|
|
38
|
+
SEARCH_ICON: string;
|
|
38
39
|
GMAIL_Filled_ICON: string;
|
|
39
40
|
GMAIL_White_ICON: string;
|
|
40
41
|
outlook_Filled_ICON: string;
|
|
@@ -42,15 +43,21 @@ export declare const ICONS_NAMES: {
|
|
|
42
43
|
Apple_Filled_ICON: string;
|
|
43
44
|
apple_white_icon: string;
|
|
44
45
|
tax_filled_icon: string;
|
|
46
|
+
tax_green_icon: string;
|
|
45
47
|
tax_white_icon: string;
|
|
46
48
|
bank_filled_icon: string;
|
|
49
|
+
bank_green_icon: string;
|
|
47
50
|
bank_white_icon: string;
|
|
48
51
|
individual_filled_icon: string;
|
|
52
|
+
individual_green_icon: string;
|
|
49
53
|
individual_white_icon: string;
|
|
50
54
|
password_filled_icon: string;
|
|
55
|
+
password_green_icon: string;
|
|
51
56
|
password_white_icon: string;
|
|
52
57
|
business_filled_icon: string;
|
|
58
|
+
business_green_icon: string;
|
|
53
59
|
business_white_icon: string;
|
|
54
60
|
Arrow_filled_right_icon: string;
|
|
61
|
+
Arrow_green_right_icon: string;
|
|
55
62
|
Arrow_white_right_icon: string;
|
|
56
63
|
};
|
|
@@ -35,22 +35,29 @@ export var ICONS_NAMES = {
|
|
|
35
35
|
ABSHER_LOGO: 'https://dash.b-cdn.net/icons/menu/Absher.svg',
|
|
36
36
|
EMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/email.png',
|
|
37
37
|
MOBILE_ICON: 'https://dash.b-cdn.net/icons/menu/mobile.svg',
|
|
38
|
+
SEARCH_ICON: 'https://dash.b-cdn.net/icons/menu/search-icon.svg',
|
|
38
39
|
GMAIL_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-filled.svg',
|
|
39
40
|
GMAIL_White_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-white.svg',
|
|
40
41
|
outlook_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Outlook-filled.svg',
|
|
41
42
|
outlook_White_ICON: 'https://dash.b-cdn.net/icons/menu/Outlook-white.svg',
|
|
42
43
|
Apple_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Apple-filled.svg',
|
|
43
44
|
apple_white_icon: 'https://dash.b-cdn.net/icons/menu/Apple-white.svg',
|
|
44
|
-
tax_filled_icon: 'https://dash.b-cdn.net/icons/menu/tax-filled.svg',
|
|
45
|
+
tax_filled_icon: 'https://dash.b-cdn.net/icons/menu/tax-filled-blue.svg',
|
|
46
|
+
tax_green_icon: 'https://dash.b-cdn.net/icons/menu/tax-filled-green.svg',
|
|
45
47
|
tax_white_icon: 'https://dash.b-cdn.net/icons/menu/tax-white.svg',
|
|
46
|
-
bank_filled_icon: 'https://dash.b-cdn.net/icons/menu/bank-filled.svg',
|
|
48
|
+
bank_filled_icon: 'https://dash.b-cdn.net/icons/menu/bank-filled-blue.svg',
|
|
49
|
+
bank_green_icon: 'https://dash.b-cdn.net/icons/menu/bank-filled-green.svg',
|
|
47
50
|
bank_white_icon: 'https://dash.b-cdn.net/icons/menu/bank-white.svg',
|
|
48
|
-
individual_filled_icon: 'https://dash.b-cdn.net/icons/menu/user-filled.svg',
|
|
51
|
+
individual_filled_icon: 'https://dash.b-cdn.net/icons/menu/user-filled-blue.svg',
|
|
52
|
+
individual_green_icon: 'https://dash.b-cdn.net/icons/menu/user-filled-green.svg',
|
|
49
53
|
individual_white_icon: 'https://dash.b-cdn.net/icons/menu/user-white.svg',
|
|
50
|
-
password_filled_icon: 'https://dash.b-cdn.net/icons/menu/password-filled.svg',
|
|
54
|
+
password_filled_icon: 'https://dash.b-cdn.net/icons/menu/password-filled-blue.svg',
|
|
55
|
+
password_green_icon: 'https://dash.b-cdn.net/icons/menu/password-filled-green.svg',
|
|
51
56
|
password_white_icon: 'https://dash.b-cdn.net/icons/menu/password-white.svg',
|
|
52
|
-
business_filled_icon: 'https://dash.b-cdn.net/icons/menu/business-filled.svg',
|
|
57
|
+
business_filled_icon: 'https://dash.b-cdn.net/icons/menu/business-filled-blue.svg',
|
|
58
|
+
business_green_icon: 'https://dash.b-cdn.net/icons/menu/business-filled-green.svg',
|
|
53
59
|
business_white_icon: 'https://dash.b-cdn.net/icons/menu/business-white.svg',
|
|
54
|
-
Arrow_filled_right_icon: 'https://dash.b-cdn.net/icons/menu/right-arrow-filled.svg',
|
|
60
|
+
Arrow_filled_right_icon: 'https://dash.b-cdn.net/icons/menu/right-arrow-filled-blue.svg',
|
|
61
|
+
Arrow_green_right_icon: 'https://dash.b-cdn.net/icons/menu/right-arrow-filled-green.svg',
|
|
55
62
|
Arrow_white_right_icon: 'https://dash.b-cdn.net/icons/menu/right-arrow-white.svg'
|
|
56
63
|
};
|
package/build/constants/dummy.js
CHANGED
|
@@ -6400,12 +6400,12 @@ export var SALES_CHANNELS = [
|
|
|
6400
6400
|
{ id: 5, title: 'Call Center', titleAr: 'مركز اتصال' }
|
|
6401
6401
|
];
|
|
6402
6402
|
export var SOURCE_OF_INCOME = [
|
|
6403
|
-
{ id: 1, titleAr: 'راتب', title: 'Salary' },
|
|
6404
|
-
{ id: 2, titleAr: 'تمويل', title: 'Investment' },
|
|
6405
|
-
{ id: 3, titleAr: 'ورث', title: 'Inheritance / inherit' },
|
|
6406
|
-
{ id: 4, titleAr: 'اسهم', title: 'Stocks' },
|
|
6407
|
-
{ id: 5, titleAr: 'تجارة', title: 'Trading' },
|
|
6408
|
-
{ id: 6, titleAr: 'غير ذلك', title: 'Other' }
|
|
6403
|
+
{ id: '1', titleAr: 'راتب', title: 'Salary' },
|
|
6404
|
+
{ id: '2', titleAr: 'تمويل', title: 'Investment' },
|
|
6405
|
+
{ id: '3', titleAr: 'ورث', title: 'Inheritance / inherit' },
|
|
6406
|
+
{ id: '4', titleAr: 'اسهم', title: 'Stocks' },
|
|
6407
|
+
{ id: '5', titleAr: 'تجارة', title: 'Trading' },
|
|
6408
|
+
{ id: '6', titleAr: 'غير ذلك', title: 'Other' }
|
|
6409
6409
|
];
|
|
6410
6410
|
export var BRAND_LIST = [
|
|
6411
6411
|
{
|
|
@@ -469,7 +469,9 @@ export var businessSlice = createSlice({
|
|
|
469
469
|
state.error = null;
|
|
470
470
|
state.customLoading = false;
|
|
471
471
|
var _a = action.payload, businessCountry = _a.businessCountry, countries = _a.countries;
|
|
472
|
-
state.data.countries = countries
|
|
472
|
+
state.data.countries = countries
|
|
473
|
+
.slice()
|
|
474
|
+
.sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
|
|
473
475
|
state.data.businessCountry = businessCountry || defaultCountry;
|
|
474
476
|
})
|
|
475
477
|
.addCase(getCountries.pending, function (state) {
|
|
@@ -527,7 +529,7 @@ export var businessSlice = createSlice({
|
|
|
527
529
|
var _a, _b;
|
|
528
530
|
if ((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend)
|
|
529
531
|
state.customLoading = true;
|
|
530
|
-
if ((_b = action.meta.arg) === null || _b === void 0 ? void 0 : _b.isResend)
|
|
532
|
+
if (!((_b = action.meta.arg) === null || _b === void 0 ? void 0 : _b.isResend))
|
|
531
533
|
state.loading = true;
|
|
532
534
|
state.error = null;
|
|
533
535
|
})
|
|
@@ -265,7 +265,7 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
265
265
|
switch (_m.label) {
|
|
266
266
|
case 0:
|
|
267
267
|
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
268
|
-
instagram = !!((_c = params.links) === null || _c === void 0 ? void 0 : _c.instagram) ? "".concat(INSTAGRAM_URL, "/").concat((_d = params.links) === null || _d === void 0 ? void 0 : _d.
|
|
268
|
+
instagram = !!((_c = params.links) === null || _c === void 0 ? void 0 : _c.instagram) ? "".concat(INSTAGRAM_URL, "/").concat((_d = params.links) === null || _d === void 0 ? void 0 : _d.instagram) : '';
|
|
269
269
|
twitter = !!((_e = params.links) === null || _e === void 0 ? void 0 : _e.twitter) ? "".concat(TWITTER_URL, "/").concat((_f = params.links) === null || _f === void 0 ? void 0 : _f.twitter) : '';
|
|
270
270
|
_b = connect.data, mobileData = _b.mobileData, nidData = _b.nidData, otpData = _b.otpData, brandData = _b.brandData;
|
|
271
271
|
isAbsher = otpData.isAbsher;
|
|
@@ -440,7 +440,9 @@ export var connectSlice = createSlice({
|
|
|
440
440
|
state.error = null;
|
|
441
441
|
state.customLoading = false;
|
|
442
442
|
var _a = action.payload, countries = _a.countries, businessCountry = _a.businessCountry;
|
|
443
|
-
state.data.countries = countries
|
|
443
|
+
state.data.countries = countries
|
|
444
|
+
.slice()
|
|
445
|
+
.sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
|
|
444
446
|
state.data.businessCountry = businessCountry || defaultCountry;
|
|
445
447
|
state.data.mobileData.countryCode = businessCountry || defaultCountry;
|
|
446
448
|
})
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
2
|
+
import { CountryCode, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
|
+
export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
|
+
businessCountry: any;
|
|
5
|
+
countries: any;
|
|
6
|
+
}, void, {}>;
|
|
3
7
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
8
|
data: any;
|
|
5
9
|
leadData: any;
|
|
6
10
|
token: string;
|
|
7
11
|
}, string, {}>;
|
|
12
|
+
export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
|
|
8
13
|
export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
9
14
|
data: any;
|
|
10
15
|
formData: {
|
|
@@ -23,6 +28,8 @@ declare type VerifyData = {
|
|
|
23
28
|
token: string;
|
|
24
29
|
};
|
|
25
30
|
export interface IndividualData {
|
|
31
|
+
businessCountry: CountryCode;
|
|
32
|
+
countries: Array<CountryCode>;
|
|
26
33
|
verify: ResponseData & VerifyData;
|
|
27
34
|
otpData: OTPFormValues & ResponseData;
|
|
28
35
|
individualData: IndividualExtraFormValues & ResponseData;
|
|
@@ -50,7 +50,23 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { removeRequestHeaders } from '../../../utils';
|
|
52
52
|
import { handleNextScreenStep } from '../../../app/settings';
|
|
53
|
-
import { INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
53
|
+
import { defaultCountry, INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
54
|
+
export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
+
var settings, countriesBody, businessCountry;
|
|
56
|
+
return __generator(this, function (_a) {
|
|
57
|
+
switch (_a.label) {
|
|
58
|
+
case 0:
|
|
59
|
+
settings = thunkApi.getState().settings;
|
|
60
|
+
return [4, API.countryService.getAllCountries()];
|
|
61
|
+
case 1:
|
|
62
|
+
countriesBody = (_a.sent()).data;
|
|
63
|
+
businessCountry = (countriesBody.list || []).find(function (country) {
|
|
64
|
+
return [country.iso2, country.iso3].includes(settings.data.appConfig.businessCountryCode.toUpperCase());
|
|
65
|
+
});
|
|
66
|
+
return [2, { businessCountry: businessCountry, countries: countriesBody.list }];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); });
|
|
54
70
|
export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
71
|
var payload, data, leadResponse;
|
|
56
72
|
return __generator(this, function (_a) {
|
|
@@ -76,6 +92,17 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
|
|
|
76
92
|
}
|
|
77
93
|
});
|
|
78
94
|
}); });
|
|
95
|
+
export var retrieveDataList = createAsyncThunk('retrieveDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
96
|
+
var sourceIncome;
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0: return [4, API.dataService.getSourceOfIncome()];
|
|
100
|
+
case 1:
|
|
101
|
+
sourceIncome = (_a.sent()).data;
|
|
102
|
+
return [2, sourceIncome];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}); });
|
|
79
106
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
107
|
var _a, individual, settings, responseBody, payload, data, steps, hasIndividualCompleted;
|
|
81
108
|
var _b, _c, _d, _e;
|
|
@@ -94,18 +121,19 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
94
121
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
95
122
|
case 1:
|
|
96
123
|
data = (_f.sent()).data;
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
124
|
+
if (!!data.errors) return [3, 4];
|
|
125
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
126
|
+
steps = (_e = individual.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.steps;
|
|
127
|
+
hasIndividualCompleted = Object.keys(steps).find(function (key) { return key === INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS; });
|
|
128
|
+
if (!hasIndividualCompleted) return [3, 2];
|
|
129
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_STEP'));
|
|
130
|
+
return [3, 4];
|
|
131
|
+
case 2: return [4, thunkApi.dispatch(retrieveDataList())];
|
|
132
|
+
case 3:
|
|
133
|
+
_f.sent();
|
|
134
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
|
|
135
|
+
_f.label = 4;
|
|
136
|
+
case 4: return [2, { data: data, formData: __assign({}, params) }];
|
|
109
137
|
}
|
|
110
138
|
});
|
|
111
139
|
}); });
|
|
@@ -120,10 +148,11 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
|
|
|
120
148
|
id: (_c = (_b = individual.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id,
|
|
121
149
|
employer_name: params.employerName,
|
|
122
150
|
employer_city: (_d = params.employerLocation) === null || _d === void 0 ? void 0 : _d.iso2,
|
|
123
|
-
source_income: [(_e = params.sourceIncome) === null || _e === void 0 ? void 0 : _e.
|
|
151
|
+
source_income: [(_e = params.sourceIncome) === null || _e === void 0 ? void 0 : _e.id],
|
|
124
152
|
actual_income: params.monthlyIncome,
|
|
125
153
|
is_relative_PEP: params.isPEP,
|
|
126
154
|
is_influencer: params.isInfluencer,
|
|
155
|
+
encryption_contract: ['employer_name', 'employer_city', 'actual_income', 'is_relative_PEP', 'is_influencer'],
|
|
127
156
|
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO
|
|
128
157
|
};
|
|
129
158
|
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
@@ -164,8 +193,9 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
|
|
|
164
193
|
var initialState = {
|
|
165
194
|
error: null,
|
|
166
195
|
loading: false,
|
|
167
|
-
customLoading: false,
|
|
168
196
|
data: {
|
|
197
|
+
countries: [],
|
|
198
|
+
businessCountry: defaultCountry,
|
|
169
199
|
verify: {
|
|
170
200
|
token: ''
|
|
171
201
|
},
|
|
@@ -198,6 +228,23 @@ export var individualSlice = createSlice({
|
|
|
198
228
|
},
|
|
199
229
|
extraReducers: function (builder) {
|
|
200
230
|
builder
|
|
231
|
+
.addCase(getCountries.fulfilled, function (state, action) {
|
|
232
|
+
state.error = null;
|
|
233
|
+
state.customLoading = false;
|
|
234
|
+
var _a = action.payload, countries = _a.countries, businessCountry = _a.businessCountry;
|
|
235
|
+
state.data.countries = countries
|
|
236
|
+
.slice()
|
|
237
|
+
.sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
|
|
238
|
+
state.data.businessCountry = businessCountry || defaultCountry;
|
|
239
|
+
})
|
|
240
|
+
.addCase(getCountries.pending, function (state) {
|
|
241
|
+
state.error = null;
|
|
242
|
+
state.customLoading = true;
|
|
243
|
+
})
|
|
244
|
+
.addCase(getCountries.rejected, function (state, action) {
|
|
245
|
+
state.error = action.error.message;
|
|
246
|
+
state.customLoading = false;
|
|
247
|
+
})
|
|
201
248
|
.addCase(verifyLeadToken.pending, function (state) {
|
|
202
249
|
state.error = null;
|
|
203
250
|
state.customLoading = true;
|
|
@@ -239,6 +286,29 @@ export var individualSlice = createSlice({
|
|
|
239
286
|
.addCase(verifyLeadOTP.rejected, function (state, action) {
|
|
240
287
|
state.loading = false;
|
|
241
288
|
state.error = action.error.message;
|
|
289
|
+
})
|
|
290
|
+
.addCase(retrieveDataList.pending, function (state) {
|
|
291
|
+
state.loading = true;
|
|
292
|
+
state.error = null;
|
|
293
|
+
})
|
|
294
|
+
.addCase(retrieveDataList.fulfilled, function (state, action) {
|
|
295
|
+
var _a, _b;
|
|
296
|
+
state.loading = false;
|
|
297
|
+
state.error = null;
|
|
298
|
+
var sourceIncome = action.payload;
|
|
299
|
+
var data = state.data.individualData.responseBody;
|
|
300
|
+
state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: sourceIncome || [] });
|
|
301
|
+
var selectedSourceIncome = sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome[0];
|
|
302
|
+
if (!!selectedSourceIncome)
|
|
303
|
+
state.data.individualData.sourceIncome = selectedSourceIncome;
|
|
304
|
+
var location = (_b = (_a = state.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.entity) === null || _b === void 0 ? void 0 : _b.country;
|
|
305
|
+
if (!!location) {
|
|
306
|
+
state.data.individualData.employerLocation = state.data.countries.find(function (country) { return country.iso2 === location; });
|
|
307
|
+
}
|
|
308
|
+
})
|
|
309
|
+
.addCase(retrieveDataList.rejected, function (state, action) {
|
|
310
|
+
state.loading = false;
|
|
311
|
+
state.error = action.error.message;
|
|
242
312
|
})
|
|
243
313
|
.addCase(updateIndividualInfo.pending, function (state) {
|
|
244
314
|
state.loading = true;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
13
|
import * as React from 'react';
|
|
3
14
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -10,10 +21,11 @@ import CheckIcon from '../../../shared/CheckIcon';
|
|
|
10
21
|
import { bankSelector } from '../../../app/bank/bankStore';
|
|
11
22
|
import { useAppSelector } from '../../../../hooks';
|
|
12
23
|
import { removeAllOtherThanAlphabetAndSpace } from '../../../../utils';
|
|
24
|
+
import Collapse from '../../../../components/Collapse';
|
|
13
25
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
14
26
|
var theme = _a.theme;
|
|
15
27
|
return ({
|
|
16
|
-
|
|
28
|
+
marginBlockStart: theme.spacing(3)
|
|
17
29
|
});
|
|
18
30
|
});
|
|
19
31
|
var InputStyled = styled(Input)(function () { return ({
|
|
@@ -25,22 +37,23 @@ var BankName = function () {
|
|
|
25
37
|
var _a, _b;
|
|
26
38
|
var t = useTranslation().t;
|
|
27
39
|
var _c = useFormContext(), setValue = _c.setValue, control = _c.control;
|
|
28
|
-
var
|
|
40
|
+
var data = useAppSelector(bankSelector).data;
|
|
29
41
|
var bankNameControl = useController({ name: 'bankName', control: control });
|
|
30
42
|
var bankNameValue = bankNameControl.field.value;
|
|
31
43
|
var hasError = !!((_a = bankNameControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message);
|
|
32
|
-
var bankName = (_b = data.bankData.responseBody) === null || _b === void 0 ? void 0 : _b.bank_name;
|
|
33
44
|
var clearValue = function () {
|
|
34
45
|
bankNameControl.field.onChange('');
|
|
35
46
|
};
|
|
36
47
|
React.useEffect(function () {
|
|
48
|
+
var _a;
|
|
49
|
+
var bankName = (_a = data.bankData.responseBody) === null || _a === void 0 ? void 0 : _a.bank_name;
|
|
37
50
|
setValue('bankName', bankName);
|
|
38
|
-
}, []);
|
|
51
|
+
}, [(_b = data.bankData.responseBody) === null || _b === void 0 ? void 0 : _b.bank_name]);
|
|
39
52
|
var handleBankChange = function (_a) {
|
|
40
53
|
var target = _a.target;
|
|
41
54
|
var value = removeAllOtherThanAlphabetAndSpace(target.value);
|
|
42
55
|
bankNameControl.field.onChange(value);
|
|
43
56
|
};
|
|
44
|
-
return (_jsx(FeatureStyled, { children: _jsx(InputStyled, { label: t('enter_bank_name'), placeholder: t('enter_bank_name_placeholder'), onChange: handleBankChange, value: bankNameValue, required: true,
|
|
57
|
+
return (_jsx(Collapse, __assign({ in: !!bankNameValue }, { children: _jsx(FeatureStyled, { children: _jsx(InputStyled, { label: t('enter_bank_name'), placeholder: t('enter_bank_name_placeholder'), onChange: handleBankChange, value: bankNameValue, required: true, readOnly: true, endAdornment: !hasError && bankNameValue ? _jsx(CheckIcon, {}) : bankNameValue && _jsx(ClearIcon, { onClick: clearValue }) }) }) })));
|
|
45
58
|
};
|
|
46
59
|
export default BankName;
|
|
@@ -40,7 +40,6 @@ import Input from '../../../shared/Input';
|
|
|
40
40
|
import { useTranslation } from 'react-i18next';
|
|
41
41
|
import { useController, useFormContext } from 'react-hook-form';
|
|
42
42
|
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
43
|
-
import { styled } from '@mui/material';
|
|
44
43
|
import { MAX_IBAN_VALUE } from '../../../../constants';
|
|
45
44
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
46
45
|
import { debounce } from 'lodash-es';
|
|
@@ -50,12 +49,6 @@ import axios from 'axios';
|
|
|
50
49
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
51
50
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
52
51
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
53
|
-
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
54
|
-
var theme = _a.theme;
|
|
55
|
-
return ({
|
|
56
|
-
marginBlockEnd: theme.spacing(3)
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
52
|
var cancelToken = null;
|
|
60
53
|
var IBAN = function (_a) {
|
|
61
54
|
var _b;
|
|
@@ -93,6 +86,6 @@ var IBAN = function (_a) {
|
|
|
93
86
|
var clearValue = function () {
|
|
94
87
|
ibanControl.field.onChange('');
|
|
95
88
|
};
|
|
96
|
-
return (_jsx(
|
|
89
|
+
return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_iban'), inputProps: { maxLength: MAX_IBAN_VALUE }, onChange: handleIbanChange, value: ibanValue, placeholder: t('enter_iban_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true, endAdornment: ibanChecking ? (_jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } })) : !error && ibanValue ? (_jsx(CheckIcon, {})) : (ibanValue && _jsx(ClearIcon, { onClick: clearValue })) }) }));
|
|
97
90
|
};
|
|
98
91
|
export default IBAN;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export declare const BankValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
-
bankName:
|
|
4
|
+
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
5
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
6
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
7
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
-
bankName:
|
|
8
|
+
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
9
9
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
10
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
11
11
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
|
-
bankName:
|
|
12
|
+
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
13
13
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
14
|
}>>>;
|
|
@@ -7,7 +7,7 @@ export var BankValidation = yup.object().shape({
|
|
|
7
7
|
.min(16, 'invalid_iban_format')
|
|
8
8
|
.max(34, 'invalid_iban_format')
|
|
9
9
|
.required('alert_iban'),
|
|
10
|
-
bankName: yup.string().
|
|
10
|
+
bankName: yup.string().optional(),
|
|
11
11
|
beneficiaryName: yup
|
|
12
12
|
.string()
|
|
13
13
|
.matches(REGEX_BENEFICIARY_NAME, 'beneficiary_name_invalid')
|
|
@@ -13,13 +13,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useAppDispatch } from '../../../../hooks';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import { useSelector } from 'react-redux';
|
|
17
16
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
18
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
18
|
import Box from '@mui/material/Box/Box';
|
|
20
19
|
import { styled } from '@mui/material/styles';
|
|
21
20
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
22
|
-
import { useLanguage } from '../../../../hooks';
|
|
21
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
23
22
|
import { maskPhone } from '../../../../utils';
|
|
24
23
|
import Form from '../../../../components/Form';
|
|
25
24
|
import Text from '../../../../components/Text';
|
|
@@ -50,7 +49,7 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
50
49
|
var VerifyNumber = function (_a) {
|
|
51
50
|
var _b, _c, _d;
|
|
52
51
|
var dispatch = useAppDispatch();
|
|
53
|
-
var _e =
|
|
52
|
+
var _e = useAppSelector(bankSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
54
53
|
var methods = useForm({
|
|
55
54
|
resolver: yupResolver(OTPValidation),
|
|
56
55
|
defaultValues: data.otpData,
|
|
@@ -73,6 +72,6 @@ var VerifyNumber = function (_a) {
|
|
|
73
72
|
};
|
|
74
73
|
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
75
74
|
var disabled = !methods.formState.isValid || !!error || !phone;
|
|
76
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled,
|
|
75
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
76
|
};
|
|
78
77
|
export default React.memo(VerifyNumber);
|
|
@@ -11,11 +11,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useSelector } from 'react-redux';
|
|
15
14
|
import { styled } from '@mui/material/styles';
|
|
16
15
|
import ActivitiesList from './ActivitiesList';
|
|
17
16
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
18
|
-
import { useAppDispatch, useLanguage } from '../../../../hooks';
|
|
17
|
+
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
19
18
|
import Form from '../../../../components/Form';
|
|
20
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
21
20
|
import { useTranslation } from 'react-i18next';
|
|
@@ -37,7 +36,7 @@ var Activities = function () {
|
|
|
37
36
|
var dispatch = useAppDispatch();
|
|
38
37
|
var isAr = useLanguage().isAr;
|
|
39
38
|
var t = useTranslation().t;
|
|
40
|
-
var _c =
|
|
39
|
+
var _c = useAppSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
41
40
|
var activitiesData = data.activitiesData;
|
|
42
41
|
var methods = useForm({
|
|
43
42
|
resolver: yupResolver(ActivitiesValidationSchema),
|
|
@@ -31,14 +31,13 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
31
31
|
};
|
|
32
32
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
33
33
|
import * as React from 'react';
|
|
34
|
-
import { useSelector } from 'react-redux';
|
|
35
34
|
import Box from '@mui/material/Box';
|
|
36
35
|
import { alpha, styled } from '@mui/material/styles';
|
|
37
36
|
import Text from '../../../../components/Text';
|
|
38
37
|
import Input from '../../../../components/Input';
|
|
39
38
|
import { useTranslation } from 'react-i18next';
|
|
40
39
|
import { useController, useFormContext } from 'react-hook-form';
|
|
41
|
-
import { useLanguage } from '../../../../hooks';
|
|
40
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
42
41
|
import { BusinessType } from '../../../../@types';
|
|
43
42
|
import Collapse from '../../../../components/Collapse';
|
|
44
43
|
import SimpleList from '../../../../components/SimpleList';
|
|
@@ -83,7 +82,7 @@ var ActivitiesList = function (_a) {
|
|
|
83
82
|
var t = useTranslation().t;
|
|
84
83
|
var isAr = useLanguage().isAr;
|
|
85
84
|
var control = useFormContext().control;
|
|
86
|
-
var data =
|
|
85
|
+
var data = useAppSelector(businessSelector).data;
|
|
87
86
|
var activitiesControl = useController({ name: 'activities', control: control });
|
|
88
87
|
var controlValue = activitiesControl.field.value;
|
|
89
88
|
var businessTypeData = data.businessTypeData;
|