@tap-payments/auth-jsconnect 1.0.44 → 1.0.47
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 +7 -0
- package/build/@types/form.d.ts +2 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/auth.d.ts +0 -2
- package/build/api/lead.d.ts +3 -2
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/components/AnimationFlow/BottomSheet.js +3 -3
- package/build/components/Footer/Footer.js +5 -5
- package/build/constants/app.js +2 -2
- package/build/constants/dummy.d.ts +14 -0
- package/build/constants/dummy.js +29 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/business/businessStore.d.ts +3 -3
- package/build/features/app/business/businessStore.js +45 -52
- package/build/features/app/connect/connectStore.d.ts +35 -13
- package/build/features/app/connect/connectStore.js +160 -185
- package/build/features/bank/Bank.js +1 -1
- package/build/features/business/Business.js +2 -15
- package/build/features/connect/screens/Individual/Email.d.ts +3 -1
- package/build/features/connect/screens/Individual/Email.js +53 -5
- package/build/features/connect/screens/Individual/Individual.js +13 -9
- package/build/features/connect/screens/Individual/validation.d.ts +1 -1
- package/build/features/connect/screens/Individual/validation.js +7 -3
- package/build/features/connect/screens/Merchant/BrandList.d.ts +12 -0
- package/build/features/connect/screens/Merchant/BrandList.js +118 -0
- package/build/features/connect/screens/Merchant/BrandName.d.ts +4 -1
- package/build/features/connect/screens/Merchant/BrandName.js +56 -5
- package/build/features/connect/screens/Merchant/Merchant.js +14 -7
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +4 -1
- package/build/features/connect/screens/Merchant/SocialMedia.js +4 -3
- package/build/features/connect/screens/Merchant/TAC.d.ts +2 -1
- package/build/features/connect/screens/Merchant/TAC.js +2 -1
- package/build/features/connect/screens/Merchant/validation.d.ts +4 -4
- package/build/features/connect/screens/Merchant/validation.js +60 -56
- package/build/features/connect/screens/Mobile/Mobile.js +6 -1
- package/build/features/connect/screens/Mobile/validation.d.ts +1 -1
- package/build/features/connect/screens/Mobile/validation.js +7 -2
- package/build/features/connect/screens/Password/Password.js +5 -3
- package/build/features/individual/Individual.js +1 -1
- package/build/features/password/Password.js +1 -1
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/tax/Tax.js +2 -2
- package/package.json +1 -1
- package/build/hooks/useElementSizeById.d.ts +0 -6
- package/build/hooks/useElementSizeById.js +0 -12
package/build/@types/app.d.ts
CHANGED
package/build/@types/form.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Activity, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, SalesChannel } from './app';
|
|
1
|
+
import { Activity, BrandInfo, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, SalesChannel } from './app';
|
|
2
2
|
export declare type MobileFormValues = {
|
|
3
3
|
mobile: string | null;
|
|
4
4
|
countryCode: CountryCode;
|
|
@@ -27,6 +27,7 @@ export declare type BrandFormValues = {
|
|
|
27
27
|
instagram: string;
|
|
28
28
|
};
|
|
29
29
|
termAndConditionChecked: boolean;
|
|
30
|
+
brandList?: Array<BrandInfo>;
|
|
30
31
|
};
|
|
31
32
|
export declare type BusinessTypeFormValues = {
|
|
32
33
|
businessType: string;
|
package/build/@types/redux.d.ts
CHANGED
package/build/api/auth.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { DeviceInfo } from '../@types';
|
|
3
2
|
export declare type MobileCredential = {
|
|
4
3
|
code: string;
|
|
5
4
|
phone: string;
|
|
@@ -15,7 +14,6 @@ export declare type IDCredential = {
|
|
|
15
14
|
};
|
|
16
15
|
export declare type CreateAuthBody = {
|
|
17
16
|
user_credentail: MobileCredential | EmailCredential | IDCredential;
|
|
18
|
-
device_info: DeviceInfo;
|
|
19
17
|
sign_in: boolean;
|
|
20
18
|
step_name: string;
|
|
21
19
|
encryption_contract: Array<string>;
|
package/build/api/lead.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ declare type BrandInfo = {
|
|
|
35
35
|
};
|
|
36
36
|
export declare type UpdateLeadBody = {
|
|
37
37
|
step_name?: string;
|
|
38
|
+
lead_id: string;
|
|
38
39
|
encryption_contract?: Array<string>;
|
|
39
40
|
name?: Name;
|
|
40
41
|
contact?: Contact;
|
|
@@ -51,8 +52,8 @@ export declare type UpdateLeadBody = {
|
|
|
51
52
|
business_id?: string;
|
|
52
53
|
segment_id?: string;
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
license_number?: string;
|
|
56
|
+
license_type?: string;
|
|
56
57
|
is_acknowledged?: boolean;
|
|
57
58
|
terms_conditions_accepted?: boolean;
|
|
58
59
|
email_url?: string;
|
|
@@ -211,5 +211,7 @@
|
|
|
211
211
|
"or": "أو",
|
|
212
212
|
"next": "التالي",
|
|
213
213
|
"open_mail_box": "افتح البريد الإلكتروني",
|
|
214
|
-
"mobile_button_label": "المتابعة عن طريق رقم الجوال"
|
|
214
|
+
"mobile_button_label": "المتابعة عن طريق رقم الجوال",
|
|
215
|
+
"select_brand_label": "Brand List",
|
|
216
|
+
"choose_brand": "Choose Brand"
|
|
215
217
|
}
|
|
@@ -52,14 +52,14 @@ var BottomSheetStyled = styled(BottomSheet)(function (_a) {
|
|
|
52
52
|
});
|
|
53
53
|
var BottomSheetComponent = function (_a) {
|
|
54
54
|
var open = _a.open, children = _a.children, rest = __rest(_a, ["open", "children"]);
|
|
55
|
-
var getMinHeight = function () {
|
|
55
|
+
var getMinHeight = function (maxHeight) {
|
|
56
56
|
var element = document.getElementById('main-feature-container');
|
|
57
57
|
var height = element ? element.clientHeight + 30 : 0;
|
|
58
|
-
return height ||
|
|
58
|
+
return height || maxHeight * 0.7;
|
|
59
59
|
};
|
|
60
60
|
return (_jsx(BottomSheetStyled, __assign({ open: open, snapPoints: function (_a) {
|
|
61
61
|
var maxHeight = _a.maxHeight;
|
|
62
|
-
return [getMinHeight(), maxHeight * 0.95];
|
|
62
|
+
return [getMinHeight(maxHeight), maxHeight * 0.95];
|
|
63
63
|
} }, rest, { children: children })));
|
|
64
64
|
};
|
|
65
65
|
export default React.memo(BottomSheetComponent);
|
|
@@ -35,14 +35,14 @@ var FollowUsStyled = styled(Text)(function (_a) {
|
|
|
35
35
|
var theme = _a.theme;
|
|
36
36
|
return (__assign({}, theme.typography.caption));
|
|
37
37
|
});
|
|
38
|
-
var LanguageTextStyled = styled(Text)(function (_a) {
|
|
39
|
-
var theme = _a.theme;
|
|
40
|
-
return (__assign(__assign({}, theme.typography.caption), { paddingInlineStart: theme.spacing(0.625), cursor: 'pointer' }));
|
|
38
|
+
var LanguageTextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
39
|
+
var theme = _a.theme, isAr = _a.isAr;
|
|
40
|
+
return (__assign(__assign({}, theme.typography.caption), { paddingInlineStart: theme.spacing(0.625), cursor: 'pointer', paddingBlockStart: theme.spacing(isAr ? 0 : 0.25) }));
|
|
41
41
|
});
|
|
42
42
|
var TextStyled = styled(Text)(function (_a) {
|
|
43
43
|
var theme = _a.theme;
|
|
44
44
|
return ({
|
|
45
|
-
marginInline: theme.spacing(0.
|
|
45
|
+
marginInline: theme.spacing(0.625)
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
var IconStyled = styled(Icon)(function (_a) {
|
|
@@ -54,7 +54,7 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
54
54
|
var FooterComponent = function (_a) {
|
|
55
55
|
var language = _a.language, countryName = _a.countryName, countryFlag = _a.countryFlag, onSwitchLanguage = _a.onSwitchLanguage, rest = __rest(_a, ["language", "countryName", "countryFlag", "onSwitchLanguage"]);
|
|
56
56
|
var isAr = useLanguage().isAr;
|
|
57
|
-
return (_jsxs(FooterStyled, __assign({}, rest, { children: [_jsx(IconStyled, { src: countryFlag }), _jsxs(TextStyled, { children: [" ", countryName, " "] }), _jsx(TextStyled, { children: " | " }),
|
|
57
|
+
return (_jsxs(FooterStyled, __assign({}, rest, { children: [_jsx(IconStyled, { src: countryFlag }), _jsxs(TextStyled, { children: [" ", countryName, " "] }), _jsx(TextStyled, { children: " | " }), _jsx(LanguageTextStyled, __assign({ isAr: isAr, onClick: onSwitchLanguage }, { children: language }))] })));
|
|
58
58
|
};
|
|
59
59
|
FooterComponent.defaultProps = {
|
|
60
60
|
followUsTitle: 'follow_us',
|
package/build/constants/app.js
CHANGED
|
@@ -26,7 +26,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
name: 'CONNECT_OTP_STEP',
|
|
29
|
-
next: ['CONNECT_INDIVIDUAL_STEP', '
|
|
29
|
+
next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_MERCHANT_INFO_STEP'],
|
|
30
30
|
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP'],
|
|
31
31
|
order: 2
|
|
32
32
|
},
|
|
@@ -45,7 +45,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
45
45
|
{
|
|
46
46
|
name: 'CONNECT_MERCHANT_INFO_STEP',
|
|
47
47
|
next: 'CONNECT_THANK_YOU_STEP',
|
|
48
|
-
prev: ['CONNECT_INDIVIDUAL_STEP', '
|
|
48
|
+
prev: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_NID_STEP', 'CONNECT_MOBILE_STEP'],
|
|
49
49
|
order: 4
|
|
50
50
|
},
|
|
51
51
|
{
|
|
@@ -7,6 +7,13 @@ export declare const OTHER_LICENSE: {
|
|
|
7
7
|
number: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
+
export declare const OTHER_BRAND: {
|
|
11
|
+
id: string;
|
|
12
|
+
name: {
|
|
13
|
+
ar: string;
|
|
14
|
+
en: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
10
17
|
export declare const defaultCountry: {
|
|
11
18
|
created: number;
|
|
12
19
|
updated: number;
|
|
@@ -319,3 +326,10 @@ export declare const SOURCE_OF_INCOME: {
|
|
|
319
326
|
titleAr: string;
|
|
320
327
|
title: string;
|
|
321
328
|
}[];
|
|
329
|
+
export declare const BRAND_LIST: {
|
|
330
|
+
id: string;
|
|
331
|
+
name: {
|
|
332
|
+
ar: string;
|
|
333
|
+
en: string;
|
|
334
|
+
};
|
|
335
|
+
}[];
|
package/build/constants/dummy.js
CHANGED
|
@@ -7,6 +7,13 @@ export var OTHER_LICENSE = {
|
|
|
7
7
|
number: 'other'
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
+
export var OTHER_BRAND = {
|
|
11
|
+
id: 'other',
|
|
12
|
+
name: {
|
|
13
|
+
ar: 'other',
|
|
14
|
+
en: 'other'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
10
17
|
export var defaultCountry = {
|
|
11
18
|
created: 1577690965000,
|
|
12
19
|
updated: 1577691209000,
|
|
@@ -6408,3 +6415,25 @@ export var SOURCE_OF_INCOME = [
|
|
|
6408
6415
|
{ id: 5, titleAr: 'تجارة', title: 'Trading' },
|
|
6409
6416
|
{ id: 6, titleAr: 'غير ذلك', title: 'Other' }
|
|
6410
6417
|
];
|
|
6418
|
+
export var BRAND_LIST = [
|
|
6419
|
+
{
|
|
6420
|
+
id: '477222',
|
|
6421
|
+
name: { ar: 'brand test user1', en: 'brand test user1' }
|
|
6422
|
+
},
|
|
6423
|
+
{
|
|
6424
|
+
id: '477223',
|
|
6425
|
+
name: { ar: 'brand test user2', en: 'brand test user2' }
|
|
6426
|
+
},
|
|
6427
|
+
{
|
|
6428
|
+
id: '477224',
|
|
6429
|
+
name: { ar: 'brand test user3', en: 'brand test user' }
|
|
6430
|
+
},
|
|
6431
|
+
{
|
|
6432
|
+
id: '477225',
|
|
6433
|
+
name: { ar: 'brand test user4', en: 'brand test user4' }
|
|
6434
|
+
},
|
|
6435
|
+
{
|
|
6436
|
+
id: '477226',
|
|
6437
|
+
name: { ar: 'brand test user5', en: 'brand test user5' }
|
|
6438
|
+
}
|
|
6439
|
+
];
|
|
@@ -7,3 +7,4 @@ export var CR_NUMBER_LENGTH = 10;
|
|
|
7
7
|
export var SAUDI_NUMBER_LENGTH = 9;
|
|
8
8
|
export var REGEX_FULL_NAME = /^([a-zA-Z]{2,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-zA-Z.-]{1,}\s{1}[a-zA-Z]{1,})$/g;
|
|
9
9
|
export var REGEX_WEBSITE = /^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,63}(:[0-9]{1,5})?(\/.*)?$/;
|
|
10
|
+
export var REGEX_SAUDI_NUMBER = /^(05|5)([0-9]{1,})$/g;
|
|
@@ -47,9 +47,9 @@ export declare const updateActivitiesInfo: import("@reduxjs/toolkit").AsyncThunk
|
|
|
47
47
|
};
|
|
48
48
|
}, ActivitiesFormValues, {}>;
|
|
49
49
|
export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
customerBases: any;
|
|
51
|
+
expectedSales: any;
|
|
52
|
+
expectedCustomerSales: any;
|
|
53
53
|
}, void, {}>;
|
|
54
54
|
export declare const updateCustomersInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
55
55
|
data: any;
|
|
@@ -189,29 +189,26 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
|
|
|
189
189
|
});
|
|
190
190
|
}); });
|
|
191
191
|
export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
192
|
-
var _a, settings, business,
|
|
193
|
-
var _b, _c, _d
|
|
194
|
-
return __generator(this, function (
|
|
195
|
-
switch (
|
|
192
|
+
var _a, settings, business, payload, data;
|
|
193
|
+
var _b, _c, _d;
|
|
194
|
+
return __generator(this, function (_e) {
|
|
195
|
+
switch (_e.label) {
|
|
196
196
|
case 0:
|
|
197
197
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
198
|
-
headers = {
|
|
199
|
-
lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
|
|
200
|
-
device_identifier: (_d = (_c = settings.data.deviceInfo) === null || _c === void 0 ? void 0 : _c.browser) === null || _d === void 0 ? void 0 : _d.browser_id
|
|
201
|
-
};
|
|
202
198
|
payload = {
|
|
203
|
-
|
|
199
|
+
lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
|
|
200
|
+
license_number: params.businessType === BusinessType.FL ? params.flNumber : params.crNumber,
|
|
201
|
+
license_type: params.businessType === BusinessType.FL ? 'freelance' : 'commercial_registration',
|
|
204
202
|
business_type: params.businessType,
|
|
205
|
-
cr_number: params.crNumber,
|
|
206
203
|
step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO,
|
|
207
|
-
encryption_contract: ['
|
|
204
|
+
encryption_contract: ['license_number', 'business_type', 'license_type']
|
|
208
205
|
};
|
|
209
|
-
return [4, API.leadService.updateLead(payload
|
|
206
|
+
return [4, API.leadService.updateLead(payload)];
|
|
210
207
|
case 1:
|
|
211
|
-
data = (
|
|
208
|
+
data = (_e.sent()).data;
|
|
212
209
|
if (!data.errors) {
|
|
213
210
|
thunkApi.dispatch(handleNextScreenStep());
|
|
214
|
-
(
|
|
211
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
215
212
|
}
|
|
216
213
|
return [2, { data: data, formData: params }];
|
|
217
214
|
}
|
|
@@ -297,9 +294,9 @@ export var retrieveDataList = createAsyncThunk('retrieveDataList', function () {
|
|
|
297
294
|
case 3:
|
|
298
295
|
expectedCustomerSales = _a.sent();
|
|
299
296
|
return [2, {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
297
|
+
customerBases: customerBases === null || customerBases === void 0 ? void 0 : customerBases.data,
|
|
298
|
+
expectedSales: expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.data,
|
|
299
|
+
expectedCustomerSales: expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.data
|
|
303
300
|
}];
|
|
304
301
|
}
|
|
305
302
|
});
|
|
@@ -336,25 +333,22 @@ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', functio
|
|
|
336
333
|
});
|
|
337
334
|
}); });
|
|
338
335
|
export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
339
|
-
var _a, settings, business,
|
|
340
|
-
var _b, _c, _d, _e, _f
|
|
341
|
-
return __generator(this, function (
|
|
342
|
-
switch (
|
|
336
|
+
var _a, settings, business, payload, data;
|
|
337
|
+
var _b, _c, _d, _e, _f;
|
|
338
|
+
return __generator(this, function (_g) {
|
|
339
|
+
switch (_g.label) {
|
|
343
340
|
case 0:
|
|
344
341
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
345
|
-
headers = {
|
|
346
|
-
lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
|
|
347
|
-
device_identifier: (_d = (_c = settings.data.deviceInfo) === null || _c === void 0 ? void 0 : _c.browser) === null || _d === void 0 ? void 0 : _d.browser_id
|
|
348
|
-
};
|
|
349
342
|
payload = {
|
|
350
343
|
step_name: BUSINESS_STEP_NAMES.BUSINESS_SUCCESS,
|
|
344
|
+
lead_id: ((_b = business.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
|
|
351
345
|
encryption_contract: []
|
|
352
346
|
};
|
|
353
|
-
return [4, API.leadService.updateLead(payload
|
|
347
|
+
return [4, API.leadService.updateLead(payload)];
|
|
354
348
|
case 1:
|
|
355
|
-
data = (
|
|
356
|
-
(
|
|
357
|
-
(
|
|
349
|
+
data = (_g.sent()).data;
|
|
350
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
351
|
+
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
|
|
358
352
|
return [2, { response: data, formData: params }];
|
|
359
353
|
}
|
|
360
354
|
});
|
|
@@ -378,7 +372,7 @@ var initialState = {
|
|
|
378
372
|
type: ''
|
|
379
373
|
},
|
|
380
374
|
businessTypeData: {
|
|
381
|
-
businessType:
|
|
375
|
+
businessType: BusinessType.FL,
|
|
382
376
|
flNumber: '',
|
|
383
377
|
crNumber: ''
|
|
384
378
|
},
|
|
@@ -507,11 +501,12 @@ export var businessSlice = createSlice({
|
|
|
507
501
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
508
502
|
if (!description) {
|
|
509
503
|
var fl = data.fl, cr = data.cr;
|
|
510
|
-
if (Array.isArray(cr)) {
|
|
504
|
+
if (Array.isArray(cr) && cr.length > 0) {
|
|
511
505
|
state.data.crInfos = cr;
|
|
512
506
|
state.data.businessTypeData.businessType = BusinessType.CR;
|
|
507
|
+
return;
|
|
513
508
|
}
|
|
514
|
-
if (Array.isArray(fl)) {
|
|
509
|
+
if (Array.isArray(fl) && fl.length > 0) {
|
|
515
510
|
state.data.flInfos = fl;
|
|
516
511
|
state.data.businessTypeData.businessType = BusinessType.FL;
|
|
517
512
|
}
|
|
@@ -526,33 +521,34 @@ export var businessSlice = createSlice({
|
|
|
526
521
|
state.error = null;
|
|
527
522
|
})
|
|
528
523
|
.addCase(updateLeadBusinessType.fulfilled, function (state, action) {
|
|
529
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
524
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
530
525
|
state.loading = false;
|
|
531
526
|
state.error = null;
|
|
532
|
-
var
|
|
527
|
+
var _t = action.payload, data = _t.data, formData = _t.formData;
|
|
533
528
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
534
529
|
if (description) {
|
|
535
530
|
state.error = description;
|
|
536
531
|
return;
|
|
537
532
|
}
|
|
538
533
|
state.data.businessTypeData = formData;
|
|
539
|
-
|
|
540
|
-
state.data.businessInfo.
|
|
534
|
+
var isAr = i18n.dir() === 'rtl';
|
|
535
|
+
state.data.businessInfo.brandName = isAr ? (_c = (_b = data === null || data === void 0 ? void 0 : data.brand) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.ar : (_e = (_d = data === null || data === void 0 ? void 0 : data.brand) === null || _d === void 0 ? void 0 : _d.name) === null || _e === void 0 ? void 0 : _e.en;
|
|
536
|
+
state.data.businessInfo.licenseNumber = data === null || data === void 0 ? void 0 : data.license_number;
|
|
537
|
+
state.data.businessInfo.legalName = isAr ? (_g = (_f = data === null || data === void 0 ? void 0 : data.entity) === null || _f === void 0 ? void 0 : _f.legal_name) === null || _g === void 0 ? void 0 : _g.ar : (_j = (_h = data === null || data === void 0 ? void 0 : data.entity) === null || _h === void 0 ? void 0 : _h.legal_name) === null || _j === void 0 ? void 0 : _j.en;
|
|
538
|
+
if (!!((_l = (_k = data === null || data === void 0 ? void 0 : data.entity) === null || _k === void 0 ? void 0 : _k.license) === null || _l === void 0 ? void 0 : _l.issueDate))
|
|
539
|
+
state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_o = (_m = data === null || data === void 0 ? void 0 : data.entity) === null || _m === void 0 ? void 0 : _m.license) === null || _o === void 0 ? void 0 : _o.issueDate, 'iYYYY/iMM/iDD').format('YYYY-MM-DD'));
|
|
541
540
|
if (formData.businessType === BusinessType.CR) {
|
|
542
|
-
|
|
543
|
-
state.data.businessInfo.legalName = (_f = data === null || data === void 0 ? void 0 : data.license) === null || _f === void 0 ? void 0 : _f.crName;
|
|
544
|
-
state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_g = data === null || data === void 0 ? void 0 : data.license) === null || _g === void 0 ? void 0 : _g.issueDate, 'iYYYY/iMM/iDD').format('YYYY-MM-DD'));
|
|
545
|
-
var activities = (_j = (_h = data === null || data === void 0 ? void 0 : data.license) === null || _h === void 0 ? void 0 : _h.activities) === null || _j === void 0 ? void 0 : _j.isic;
|
|
541
|
+
var activities = ((_q = (_p = data === null || data === void 0 ? void 0 : data.license) === null || _p === void 0 ? void 0 : _p.activities) === null || _q === void 0 ? void 0 : _q.isic) || [];
|
|
546
542
|
var selectedActivity = activities === null || activities === void 0 ? void 0 : activities[0];
|
|
547
543
|
if (!!selectedActivity)
|
|
548
544
|
state.data.activitiesData.activities = [selectedActivity];
|
|
549
|
-
state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: activities
|
|
545
|
+
state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: activities });
|
|
550
546
|
return;
|
|
551
547
|
}
|
|
552
|
-
var category = (
|
|
548
|
+
var category = (_s = (_r = data === null || data === void 0 ? void 0 : data.license) === null || _r === void 0 ? void 0 : _r.License) === null || _s === void 0 ? void 0 : _s.Category;
|
|
553
549
|
if (!!category)
|
|
554
550
|
state.data.activitiesData.activities = [category];
|
|
555
|
-
state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: [category] });
|
|
551
|
+
state.data.businessTypeData.responseBody = __assign(__assign({}, data), { activities: !!category ? [category] : [] });
|
|
556
552
|
})
|
|
557
553
|
.addCase(updateLeadBusinessType.rejected, function (state, action) {
|
|
558
554
|
state.loading = false;
|
|
@@ -614,24 +610,21 @@ export var businessSlice = createSlice({
|
|
|
614
610
|
var _a, _b, _c;
|
|
615
611
|
state.loading = false;
|
|
616
612
|
state.error = null;
|
|
617
|
-
var _d = action.payload,
|
|
618
|
-
var description = (((_a =
|
|
619
|
-
((_b = expectedSalesData === null || expectedSalesData === void 0 ? void 0 : expectedSalesData.errors) === null || _b === void 0 ? void 0 : _b[0]) ||
|
|
620
|
-
((_c = expectedCustomerSalesData === null || expectedCustomerSalesData === void 0 ? void 0 : expectedCustomerSalesData.errors) === null || _c === void 0 ? void 0 : _c[0]) ||
|
|
621
|
-
{}).description;
|
|
613
|
+
var _d = action.payload, customerBases = _d.customerBases, expectedSales = _d.expectedSales, expectedCustomerSales = _d.expectedCustomerSales;
|
|
614
|
+
var description = (((_a = customerBases === null || customerBases === void 0 ? void 0 : customerBases.errors) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.errors) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.errors) === null || _c === void 0 ? void 0 : _c[0]) || {}).description;
|
|
622
615
|
if (description) {
|
|
623
616
|
state.error = description;
|
|
624
617
|
return;
|
|
625
618
|
}
|
|
626
619
|
var data = state.data.activitiesData.responseBody;
|
|
627
|
-
state.data.activitiesData.responseBody = __assign(__assign({}, data), { customerBases:
|
|
628
|
-
var selectedCustomerBase =
|
|
620
|
+
state.data.activitiesData.responseBody = __assign(__assign({}, data), { customerBases: customerBases || [], expectedSales: expectedSales || [], expectedCustomerSales: expectedCustomerSales || [] });
|
|
621
|
+
var selectedCustomerBase = customerBases === null || customerBases === void 0 ? void 0 : customerBases[0];
|
|
629
622
|
if (!!selectedCustomerBase)
|
|
630
623
|
state.data.customersData.customerLocations = [selectedCustomerBase];
|
|
631
|
-
var selectedExpectedSale =
|
|
624
|
+
var selectedExpectedSale = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales[(expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) - 1];
|
|
632
625
|
if (!!selectedExpectedSale)
|
|
633
626
|
state.data.customersData.expectedSalesRange = selectedExpectedSale;
|
|
634
|
-
var selectedExpectedCustomerSale =
|
|
627
|
+
var selectedExpectedCustomerSale = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales[(expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.length) - 1];
|
|
635
628
|
if (!!selectedExpectedCustomerSale)
|
|
636
629
|
state.data.customersData.expectedCustomers = selectedExpectedCustomerSale;
|
|
637
630
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ResponseData, CountryCode, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues
|
|
2
|
+
import { ResponseData, CountryCode, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues } from '../../../@types';
|
|
3
|
+
import { CancelToken } from 'axios';
|
|
3
4
|
export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
5
|
businessCountry: undefined;
|
|
5
6
|
countries: any;
|
|
@@ -25,15 +26,28 @@ export declare const createNIDAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
25
26
|
}, {}>;
|
|
26
27
|
export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
27
28
|
response: any;
|
|
28
|
-
leadResponse: any;
|
|
29
29
|
formData: OTPFormValues;
|
|
30
30
|
}, OTPFormValues, {}>;
|
|
31
|
-
export declare const
|
|
31
|
+
export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
32
32
|
response: any;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
33
|
+
formData: {
|
|
34
|
+
leadId: string;
|
|
35
|
+
stepName: string;
|
|
36
|
+
};
|
|
37
|
+
}, {
|
|
38
|
+
leadId: string;
|
|
39
|
+
stepName: string;
|
|
40
|
+
}, {}>;
|
|
41
|
+
export declare const createLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
42
|
+
response: any;
|
|
43
|
+
formData: {
|
|
44
|
+
individualId: string;
|
|
45
|
+
stepName: string;
|
|
46
|
+
};
|
|
47
|
+
}, {
|
|
48
|
+
individualId: string;
|
|
49
|
+
stepName: string;
|
|
50
|
+
}, {}>;
|
|
37
51
|
export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk<{
|
|
38
52
|
response: any;
|
|
39
53
|
formData: IndividualFormValues;
|
|
@@ -45,11 +59,21 @@ export declare const updateLeadBrand: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
45
59
|
export declare const checkEmailAvailability: import("@reduxjs/toolkit").AsyncThunk<{
|
|
46
60
|
response: any;
|
|
47
61
|
formData: string;
|
|
48
|
-
} | undefined,
|
|
62
|
+
} | undefined, {
|
|
63
|
+
email: string;
|
|
64
|
+
cancelToken: CancelToken;
|
|
65
|
+
onSuccess?: (() => void) | undefined;
|
|
66
|
+
}, {}>;
|
|
49
67
|
export declare const checkBrandNameAvailability: import("@reduxjs/toolkit").AsyncThunk<{
|
|
50
68
|
response: any;
|
|
51
|
-
formData:
|
|
52
|
-
|
|
69
|
+
formData: {
|
|
70
|
+
name: string;
|
|
71
|
+
};
|
|
72
|
+
} | undefined, {
|
|
73
|
+
name: string;
|
|
74
|
+
cancelToken: CancelToken;
|
|
75
|
+
onSuccess?: (() => void) | undefined;
|
|
76
|
+
}, {}>;
|
|
53
77
|
export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
54
78
|
response: any;
|
|
55
79
|
formData: void;
|
|
@@ -64,7 +88,6 @@ export interface ConnectData {
|
|
|
64
88
|
otpData: OTPFormValues & ResponseData & {
|
|
65
89
|
isAbsher: boolean;
|
|
66
90
|
};
|
|
67
|
-
passwordData: PasswordFormValues & ResponseData;
|
|
68
91
|
individualData: IndividualFormValues & ResponseData;
|
|
69
92
|
brandData: BrandFormValues & ResponseData;
|
|
70
93
|
}
|
|
@@ -76,11 +99,10 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectState
|
|
|
76
99
|
resetMobileScreen: (state: ConnectState) => void;
|
|
77
100
|
resetNIDScreen: (state: ConnectState) => void;
|
|
78
101
|
resetOTPScreen: (state: ConnectState) => void;
|
|
79
|
-
resetPasswordScreen: (state: ConnectState) => void;
|
|
80
102
|
resetIndividualScreen: (state: ConnectState) => void;
|
|
81
103
|
resetMerchantScreen: (state: ConnectState) => void;
|
|
82
104
|
}, "connect/store">;
|
|
83
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string
|
|
105
|
+
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
84
106
|
declare const _default: import("redux").Reducer<ConnectState, import("redux").AnyAction>;
|
|
85
107
|
export default _default;
|
|
86
108
|
export declare const connectSelector: (state: RootState) => ConnectState;
|