@tap-payments/auth-jsconnect 2.0.54 → 2.0.55
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 +38 -0
- package/build/@types/app.js +5 -0
- package/build/@types/form.d.ts +2 -1
- package/build/api/entity.d.ts +1 -0
- package/build/api/entity.js +8 -1
- package/build/api/index.d.ts +6 -1
- package/build/api/index.js +3 -1
- package/build/api/init.d.ts +16 -0
- package/build/api/init.js +13 -0
- package/build/api/lead.d.ts +4 -1
- package/build/app/settings.d.ts +4 -8
- package/build/app/settings.js +28 -19
- package/build/assets/locales/ar.json +5 -1
- package/build/assets/locales/en.json +5 -1
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -2
- package/build/components/AnimationFlow/AnimationFlow.js +4 -4
- package/build/components/AnimationFlow/BottomSheet.d.ts +4 -1
- package/build/components/AnimationFlow/BottomSheet.js +23 -20
- package/build/components/AnimationFlow/Dialog.d.ts +4 -2
- package/build/components/AnimationFlow/Dialog.js +30 -7
- package/build/components/DatePicker/DatePicker.d.ts +2 -1
- package/build/components/DatePicker/DatePicker.js +9 -8
- package/build/components/LogoBadge/LogoBadge.js +3 -0
- package/build/components/SimpleList/SimpleList.d.ts +3 -1
- package/build/components/SimpleList/SimpleList.js +19 -2
- package/build/components/Slide/Slide.d.ts +1 -1
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +5 -1
- package/build/constants/app.d.ts +11 -0
- package/build/constants/app.js +33 -32
- package/build/constants/assets.d.ts +4 -0
- package/build/constants/assets.js +4 -0
- package/build/features/app/bank/bankStore.d.ts +3 -0
- package/build/features/app/bank/bankStore.js +33 -4
- package/build/features/app/brand/brandStore.d.ts +3 -2
- package/build/features/app/brand/brandStore.js +45 -24
- package/build/features/app/business/businessStore.d.ts +8 -0
- package/build/features/app/business/businessStore.js +166 -157
- package/build/features/app/connect/connectStore.js +2 -2
- package/build/features/app/connectExpress/connectExpressStore.js +4 -4
- package/build/features/app/entity/entityStore.d.ts +3 -0
- package/build/features/app/entity/entityStore.js +32 -3
- package/build/features/app/individual/individualStore.d.ts +5 -0
- package/build/features/app/individual/individualStore.js +76 -41
- package/build/features/app/tax/taxStore.d.ts +3 -0
- package/build/features/app/tax/taxStore.js +33 -4
- package/build/features/bank/Bank.js +3 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +9 -5
- package/build/features/bank/screens/Verify/Verify.js +1 -5
- package/build/features/brand/Brand.js +3 -4
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +8 -8
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +14 -5
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +8 -8
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +1 -1
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +5 -5
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +16 -10
- package/build/features/brand/screens/Verify/Verify.js +7 -20
- package/build/features/business/Business.js +3 -4
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +8 -8
- package/build/features/business/screens/Activities/ActivitiesList.js +6 -1
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +32 -8
- package/build/features/business/screens/BusinessType/EntityLicenseList.d.ts +9 -0
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +132 -0
- package/build/features/business/screens/BusinessType/EntityName.js +6 -6
- package/build/features/business/screens/BusinessType/LicenseList.d.ts +1 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +4 -16
- package/build/features/business/screens/BusinessType/LicenseNumber.d.ts +1 -2
- package/build/features/business/screens/BusinessType/LicenseNumber.js +4 -2
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +8 -8
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -5
- package/build/features/business/screens/IDBOD/DOB.js +1 -1
- package/build/features/connect/Connect.js +3 -4
- package/build/features/connect/screens/Individual/Email.js +10 -18
- package/build/features/connect/screens/Individual/MobileNumber.js +10 -6
- package/build/features/connect/screens/NID/DOB.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +3 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +1 -5
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
- package/build/features/connectExpress/screens/Mobile/Mobile.js +1 -2
- package/build/features/connectExpress/screens/NID/DOB.js +1 -1
- package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
- package/build/features/connectExpress/screens/NIDMissed/DOB.js +1 -1
- package/build/features/entity/Entity.js +3 -4
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +8 -8
- package/build/features/entity/screens/EntityCapital/ActivityList.js +6 -4
- package/build/features/entity/screens/EntityName/EntityName.js +11 -4
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +8 -8
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
- package/build/features/entity/screens/Verify/Verify.js +7 -20
- package/build/features/individual/Individual.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +6 -6
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +17 -9
- package/build/features/individual/screens/Verify/Verify.js +1 -5
- package/build/features/password/Password.js +3 -4
- package/build/features/shared/Address/CountryList.d.ts +7 -7
- package/build/features/shared/Address/InputSelect.d.ts +7 -7
- package/build/features/shared/Button/FlowsButtons.js +6 -0
- package/build/features/shared/Containers/FeatureContainer.d.ts +4 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -4
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Footer/PoweredByFooter.d.ts +9 -0
- package/build/features/shared/Footer/PoweredByFooter.js +36 -0
- package/build/features/shared/Footer/index.d.ts +3 -2
- package/build/features/shared/Footer/index.js +3 -2
- package/build/features/shared/Input/Input.d.ts +3 -3
- package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +2 -2
- package/build/features/signIn/SignIn.js +3 -4
- package/build/features/tax/Tax.js +3 -4
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +10 -6
- package/build/features/tax/screens/Verify/Verify.js +6 -22
- package/build/hooks/useAppConfig.js +5 -2
- package/build/utils/string.d.ts +2 -1
- package/build/utils/string.js +5 -0
- package/package.json +1 -1
|
@@ -57,12 +57,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import API from '../../../api';
|
|
60
|
-
import { BusinessType, FlowsTypes, DocumentPurpose } from '../../../@types';
|
|
61
|
-
import { BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
|
|
62
|
-
import { convertNumbers2English,
|
|
60
|
+
import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
|
|
61
|
+
import { BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
|
|
62
|
+
import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense } from '../../../utils';
|
|
63
63
|
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
64
64
|
export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
-
var payload, data, countryIso2, boardData, brandData, leadData, entity_activities, steps, brand, board_id, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, activityList;
|
|
65
|
+
var payload, data, countryIso2, boardData, brandData, leadData, entity_activities, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, activityList;
|
|
66
66
|
var _a;
|
|
67
67
|
return __generator(this, function (_b) {
|
|
68
68
|
switch (_b.label) {
|
|
@@ -81,7 +81,7 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
81
81
|
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
82
82
|
if (countryIso2)
|
|
83
83
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
84
|
-
if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3,
|
|
84
|
+
if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 20];
|
|
85
85
|
boardData = undefined;
|
|
86
86
|
brandData = undefined;
|
|
87
87
|
return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
|
|
@@ -96,8 +96,8 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
96
96
|
if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && !isKW(countryIso2)) {
|
|
97
97
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
98
98
|
}
|
|
99
|
-
if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3,
|
|
100
|
-
entity_activities = leadData.entity_activities, steps = leadData.steps, brand = leadData.brand, board_id = leadData.board_id;
|
|
99
|
+
if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 19];
|
|
100
|
+
entity_activities = leadData.entity_activities, steps = leadData.steps, brand = leadData.brand, board_id = leadData.board_id, business_id = leadData.business_id, entity = leadData.entity;
|
|
101
101
|
brandID = brand === null || brand === void 0 ? void 0 : brand.id;
|
|
102
102
|
hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
|
|
103
103
|
hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
|
|
@@ -121,15 +121,15 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
121
121
|
_b.label = 7;
|
|
122
122
|
case 7:
|
|
123
123
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
124
|
-
return [3,
|
|
124
|
+
return [3, 19];
|
|
125
125
|
case 8:
|
|
126
126
|
if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 9];
|
|
127
127
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
128
|
-
return [3,
|
|
128
|
+
return [3, 19];
|
|
129
129
|
case 9:
|
|
130
130
|
if (!hasBusinessCustomersCompleted) return [3, 10];
|
|
131
131
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
|
|
132
|
-
return [3,
|
|
132
|
+
return [3, 19];
|
|
133
133
|
case 10:
|
|
134
134
|
if (!hasBusinessCRActivitiesCompleted) return [3, 13];
|
|
135
135
|
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
@@ -139,31 +139,33 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
139
139
|
return [4, API.brandService.retrieveBrand(brandID)];
|
|
140
140
|
case 12:
|
|
141
141
|
brandData = _b.sent();
|
|
142
|
-
return [3,
|
|
142
|
+
return [3, 19];
|
|
143
143
|
case 13:
|
|
144
144
|
if (!hasBusinessCRInfoCompleted) return [3, 15];
|
|
145
145
|
return [4, API.brandService.retrieveBrand(brandID)];
|
|
146
146
|
case 14:
|
|
147
147
|
brandData = _b.sent();
|
|
148
148
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
|
|
149
|
-
return [3,
|
|
150
|
-
case 15:
|
|
151
|
-
if (!isSA(countryIso2)) return [3, 17];
|
|
152
|
-
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
149
|
+
return [3, 19];
|
|
150
|
+
case 15: return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
153
151
|
case 16:
|
|
154
152
|
_b.sent();
|
|
155
|
-
|
|
153
|
+
if (!isSA(countryIso2)) return [3, 18];
|
|
154
|
+
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
156
155
|
case 17:
|
|
157
|
-
|
|
156
|
+
_b.sent();
|
|
158
157
|
_b.label = 18;
|
|
159
|
-
case 18:
|
|
158
|
+
case 18:
|
|
159
|
+
thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
160
|
+
_b.label = 19;
|
|
161
|
+
case 19: return [2, {
|
|
160
162
|
data: data,
|
|
161
163
|
leadData: __assign(__assign({}, leadData), { flows: (boardData === null || boardData === void 0 ? void 0 : boardData.info) || [] }),
|
|
162
164
|
token: token,
|
|
163
165
|
brandData: (brandData === null || brandData === void 0 ? void 0 : brandData.brand) || {},
|
|
164
166
|
boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id
|
|
165
167
|
}];
|
|
166
|
-
case
|
|
168
|
+
case 20: return [2, { data: data, isRequireOTP: true, token: token }];
|
|
167
169
|
}
|
|
168
170
|
});
|
|
169
171
|
}); });
|
|
@@ -185,7 +187,7 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
|
|
|
185
187
|
});
|
|
186
188
|
}); });
|
|
187
189
|
export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
-
var _a, business, settings, isNID, responseBody, stepName, payload, data, brandData, leadData, brand, country_code, steps, board_id, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, entity_activities, activityList, boardResponse;
|
|
190
|
+
var _a, business, settings, isNID, responseBody, stepName, payload, data, brandData, leadData, brand, country_code, steps, board_id, business_id, entity, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, entity_activities, activityList, boardResponse;
|
|
189
191
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
190
192
|
return __generator(this, function (_j) {
|
|
191
193
|
switch (_j.label) {
|
|
@@ -211,7 +213,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
211
213
|
case 2:
|
|
212
214
|
leadData = (_j.sent()).data;
|
|
213
215
|
thunkApi.dispatch(updateStepName(stepName));
|
|
214
|
-
brand = leadData.brand, country_code = leadData.country_code, steps = leadData.steps, board_id = leadData.board_id;
|
|
216
|
+
brand = leadData.brand, country_code = leadData.country_code, steps = leadData.steps, board_id = leadData.board_id, business_id = leadData.business_id, entity = leadData.entity;
|
|
215
217
|
brandID = brand === null || brand === void 0 ? void 0 : brand.id;
|
|
216
218
|
countryIso2 = country_code;
|
|
217
219
|
if (countryIso2)
|
|
@@ -222,81 +224,88 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
222
224
|
hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
|
|
223
225
|
hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
|
|
224
226
|
isIdentityAuthStep = data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH;
|
|
225
|
-
if (!(
|
|
226
|
-
return [4, thunkApi.dispatch(
|
|
227
|
+
if (!(!isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 4];
|
|
228
|
+
return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
227
229
|
case 3:
|
|
228
230
|
_j.sent();
|
|
229
231
|
_j.label = 4;
|
|
230
232
|
case 4:
|
|
233
|
+
if (!(isSA(countryIso2) && !isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 6];
|
|
234
|
+
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
235
|
+
case 5:
|
|
236
|
+
_j.sent();
|
|
237
|
+
_j.label = 6;
|
|
238
|
+
case 6:
|
|
231
239
|
entity_activities = leadData.entity_activities;
|
|
232
|
-
if (!(!entity_activities && hasBusinessCRInfoCompleted && !hasBusinessCompleted)) return [3,
|
|
240
|
+
if (!(!entity_activities && hasBusinessCRInfoCompleted && !hasBusinessCompleted)) return [3, 8];
|
|
233
241
|
return [4, API.dataService.getActivities()];
|
|
234
|
-
case
|
|
242
|
+
case 7:
|
|
235
243
|
activityList = (_j.sent()).list;
|
|
236
244
|
leadData = __assign(__assign({}, leadData), { entity_activities: activityList });
|
|
237
|
-
_j.label =
|
|
238
|
-
case
|
|
239
|
-
if (!isNID) return [3,
|
|
245
|
+
_j.label = 8;
|
|
246
|
+
case 8:
|
|
247
|
+
if (!isNID) return [3, 9];
|
|
240
248
|
thunkApi.dispatch(handleNextScreenStep());
|
|
241
|
-
return [3,
|
|
242
|
-
case
|
|
243
|
-
if (!(isIdentityAuthStep && isKW(countryIso2))) return [3,
|
|
249
|
+
return [3, 22];
|
|
250
|
+
case 9:
|
|
251
|
+
if (!(isIdentityAuthStep && isKW(countryIso2))) return [3, 10];
|
|
244
252
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
|
|
245
|
-
return [3,
|
|
246
|
-
case
|
|
247
|
-
if (!hasBusinessCompleted) return [3,
|
|
248
|
-
if (!board_id) return [3,
|
|
253
|
+
return [3, 22];
|
|
254
|
+
case 10:
|
|
255
|
+
if (!hasBusinessCompleted) return [3, 14];
|
|
256
|
+
if (!board_id) return [3, 13];
|
|
249
257
|
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
250
|
-
case
|
|
258
|
+
case 11:
|
|
251
259
|
boardResponse = _j.sent();
|
|
252
260
|
leadData = __assign(__assign({}, leadData), { flows: (boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.info) || [] });
|
|
253
261
|
return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
|
|
254
|
-
case
|
|
262
|
+
case 12:
|
|
255
263
|
_j.sent();
|
|
256
|
-
_j.label =
|
|
257
|
-
case
|
|
264
|
+
_j.label = 13;
|
|
265
|
+
case 13:
|
|
258
266
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
259
|
-
return [3,
|
|
260
|
-
case
|
|
261
|
-
if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3,
|
|
267
|
+
return [3, 22];
|
|
268
|
+
case 14:
|
|
269
|
+
if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 15];
|
|
262
270
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
263
|
-
return [3,
|
|
264
|
-
case
|
|
265
|
-
if (!hasBusinessCustomersCompleted) return [3,
|
|
271
|
+
return [3, 22];
|
|
272
|
+
case 15:
|
|
273
|
+
if (!hasBusinessCustomersCompleted) return [3, 16];
|
|
266
274
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
|
|
267
|
-
return [3,
|
|
268
|
-
case
|
|
269
|
-
if (!hasBusinessCRActivitiesCompleted) return [3,
|
|
275
|
+
return [3, 22];
|
|
276
|
+
case 16:
|
|
277
|
+
if (!hasBusinessCRActivitiesCompleted) return [3, 19];
|
|
270
278
|
return [4, thunkApi.dispatch(retrieveDataList())];
|
|
271
|
-
case
|
|
279
|
+
case 17:
|
|
272
280
|
_j.sent();
|
|
273
281
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
|
|
274
282
|
return [4, API.brandService.retrieveBrand(brandID)];
|
|
275
|
-
case
|
|
283
|
+
case 18:
|
|
276
284
|
brandData = _j.sent();
|
|
277
|
-
return [3,
|
|
278
|
-
case
|
|
279
|
-
if (!hasBusinessCRInfoCompleted) return [3,
|
|
285
|
+
return [3, 22];
|
|
286
|
+
case 19:
|
|
287
|
+
if (!hasBusinessCRInfoCompleted) return [3, 21];
|
|
280
288
|
return [4, API.brandService.retrieveBrand(brandID)];
|
|
281
|
-
case
|
|
289
|
+
case 20:
|
|
282
290
|
brandData = _j.sent();
|
|
283
291
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
|
|
284
|
-
return [3,
|
|
285
|
-
case
|
|
292
|
+
return [3, 22];
|
|
293
|
+
case 21:
|
|
286
294
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
287
|
-
_j.label =
|
|
288
|
-
case
|
|
295
|
+
_j.label = 22;
|
|
296
|
+
case 22: return [2, { data: data, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
|
|
289
297
|
}
|
|
290
298
|
});
|
|
291
299
|
}); });
|
|
292
300
|
export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
293
|
-
var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess;
|
|
294
|
-
var
|
|
295
|
-
return __generator(this, function (
|
|
296
|
-
switch (
|
|
301
|
+
var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, isSuccess;
|
|
302
|
+
var _c, _d, _e, _f;
|
|
303
|
+
return __generator(this, function (_g) {
|
|
304
|
+
switch (_g.label) {
|
|
297
305
|
case 0:
|
|
298
306
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
299
307
|
responseBody = business.data.civilIdData.responseBody;
|
|
308
|
+
_b = business.data.verify.responseBody || {}, business_id = _b.business_id, entity = _b.entity;
|
|
300
309
|
expiry = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.expiry) || 120;
|
|
301
310
|
interval = 5;
|
|
302
311
|
maxCalls = Math.floor(expiry / interval);
|
|
@@ -304,29 +313,32 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
304
313
|
return [2, { response: null }];
|
|
305
314
|
}
|
|
306
315
|
count = 1;
|
|
307
|
-
|
|
316
|
+
_g.label = 1;
|
|
308
317
|
case 1:
|
|
309
|
-
if (!(count <= maxCalls)) return [3,
|
|
318
|
+
if (!(count <= maxCalls)) return [3, 8];
|
|
310
319
|
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
|
|
311
320
|
case 2:
|
|
312
|
-
data =
|
|
313
|
-
isSuccess = ((
|
|
314
|
-
if (!isSuccess) return [3,
|
|
315
|
-
|
|
316
|
-
(_e = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params);
|
|
317
|
-
return [4, sleep(3000)];
|
|
321
|
+
data = _g.sent();
|
|
322
|
+
isSuccess = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
|
|
323
|
+
if (!isSuccess) return [3, 5];
|
|
324
|
+
return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
318
325
|
case 3:
|
|
319
|
-
|
|
326
|
+
_g.sent();
|
|
327
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
328
|
+
(_f = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _f === void 0 ? void 0 : _f.call(params);
|
|
329
|
+
return [4, sleep(3000)];
|
|
330
|
+
case 4:
|
|
331
|
+
_g.sent();
|
|
320
332
|
thunkApi.dispatch(handleNextScreenStep());
|
|
321
333
|
return [2, { response: data }];
|
|
322
|
-
case
|
|
323
|
-
case 5:
|
|
324
|
-
_f.sent();
|
|
325
|
-
_f.label = 6;
|
|
334
|
+
case 5: return [4, sleep(interval * 1000)];
|
|
326
335
|
case 6:
|
|
336
|
+
_g.sent();
|
|
337
|
+
_g.label = 7;
|
|
338
|
+
case 7:
|
|
327
339
|
count++;
|
|
328
340
|
return [3, 1];
|
|
329
|
-
case
|
|
341
|
+
case 8: throw new Error('paci_verification_failed');
|
|
330
342
|
}
|
|
331
343
|
});
|
|
332
344
|
}); });
|
|
@@ -426,6 +438,19 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
|
|
|
426
438
|
}
|
|
427
439
|
});
|
|
428
440
|
}); });
|
|
441
|
+
export var retrieveAllEntityList = createAsyncThunk('retrieveAllEntityList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
442
|
+
var settings, data;
|
|
443
|
+
return __generator(this, function (_a) {
|
|
444
|
+
switch (_a.label) {
|
|
445
|
+
case 0:
|
|
446
|
+
settings = thunkApi.getState().settings;
|
|
447
|
+
return [4, API.entityService.retrieveAllEntities(params.businessId)];
|
|
448
|
+
case 1:
|
|
449
|
+
data = _a.sent();
|
|
450
|
+
return [2, { data: data, businessCountryCode: settings.data.businessCountry.iso2, entityId: params.entityId }];
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}); });
|
|
429
454
|
export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', function (boardID) { return __awaiter(void 0, void 0, void 0, function () {
|
|
430
455
|
var data;
|
|
431
456
|
var _a, _b;
|
|
@@ -435,30 +460,31 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
|
|
|
435
460
|
case 1:
|
|
436
461
|
data = _c.sent();
|
|
437
462
|
return [2, {
|
|
438
|
-
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact, individuals: data === null || data === void 0 ? void 0 : data.individuals })
|
|
463
|
+
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact, individuals: data === null || data === void 0 ? void 0 : data.individuals, board_id: data === null || data === void 0 ? void 0 : data.id })
|
|
439
464
|
}];
|
|
440
465
|
}
|
|
441
466
|
});
|
|
442
467
|
}); });
|
|
443
468
|
export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
444
|
-
var _a, settings, business, isNonSA, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, isFL, payload, data, entity_activities, list, accountBody, accountData, documentData, entityData, entityId, documentBody, payload_1;
|
|
469
|
+
var _a, settings, business, isNonSA, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, payload, data, entity_activities, list, accountBody, accountData, documentData, entityData, entityId, documentBody, payload_1;
|
|
445
470
|
var _b, _c, _d, _e;
|
|
446
471
|
return __generator(this, function (_f) {
|
|
447
472
|
switch (_f.label) {
|
|
448
473
|
case 0:
|
|
449
474
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
450
475
|
isNonSA = !isSA(settings.data.businessCountry.iso2);
|
|
451
|
-
selectedLicense = params.selectedLicense, licenseNumber = params.licenseNumber, entityLegalName = params.entityLegalName, certificateId = params.certificateId, articleId = params.articleId;
|
|
476
|
+
selectedLicense = params.selectedLicense, licenseNumber = params.licenseNumber, entityLegalName = params.entityLegalName, certificateId = params.certificateId, articleId = params.articleId, selectedEntityLicense = params.selectedEntityLicense;
|
|
452
477
|
isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
453
|
-
payload = {
|
|
454
|
-
|
|
478
|
+
payload = __assign(__assign(__assign(__assign(__assign({ id: ((_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.lead_id) || '' }, ((selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) &&
|
|
479
|
+
(isNonSA ? !isFL : true) && {
|
|
480
|
+
entity: { id: selectedEntityLicense.id }
|
|
481
|
+
})), (!(selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && {
|
|
455
482
|
license_number: isNonSA && isFL ? '' : licenseNumber,
|
|
456
|
-
license_type: isFL ?
|
|
457
|
-
business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
};
|
|
483
|
+
license_type: isFL ? LicenseType.FL : LicenseType.CR,
|
|
484
|
+
business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type
|
|
485
|
+
})), { step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO }), (isNonSA && {
|
|
486
|
+
business_name: isFL ? undefined : { ar: entityLegalName, en: entityLegalName }
|
|
487
|
+
})), { encryption_contract: ['license_number', 'business_type', 'license_type'] });
|
|
462
488
|
return [4, API.leadService.updateLead(payload)];
|
|
463
489
|
case 1:
|
|
464
490
|
data = _f.sent();
|
|
@@ -693,7 +719,7 @@ var initialState = {
|
|
|
693
719
|
},
|
|
694
720
|
nidData: {
|
|
695
721
|
nid: '',
|
|
696
|
-
dob:
|
|
722
|
+
dob: '',
|
|
697
723
|
type: ''
|
|
698
724
|
},
|
|
699
725
|
businessTypeData: {
|
|
@@ -755,7 +781,9 @@ export var businessSlice = createSlice({
|
|
|
755
781
|
state.data.otpData.isNID = false;
|
|
756
782
|
if (isRequireOTP)
|
|
757
783
|
return;
|
|
758
|
-
var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities,
|
|
784
|
+
var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_name = _d.business_name;
|
|
785
|
+
if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
|
|
786
|
+
state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
|
|
759
787
|
var issuingDate = ((_a = brandData === null || brandData === void 0 ? void 0 : brandData.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
|
|
760
788
|
if (issuingDate)
|
|
761
789
|
state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
|
|
@@ -766,37 +794,6 @@ export var businessSlice = createSlice({
|
|
|
766
794
|
});
|
|
767
795
|
state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
|
|
768
796
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
|
|
769
|
-
var license = (entity || {}).license;
|
|
770
|
-
if (license) {
|
|
771
|
-
var number_1 = license.number;
|
|
772
|
-
var _e = state.data.businessTypeData || {}, busResData = _e.responseBody, selectedLicense = _e.selectedLicense;
|
|
773
|
-
var licenseList = (busResData === null || busResData === void 0 ? void 0 : busResData.licenseList) || [];
|
|
774
|
-
var selectedLicenseData = selectedLicense;
|
|
775
|
-
if (number_1) {
|
|
776
|
-
var findLicense = licenseList.find(function (_a) {
|
|
777
|
-
var license = _a.license;
|
|
778
|
-
return license.number === number_1;
|
|
779
|
-
});
|
|
780
|
-
if (findLicense)
|
|
781
|
-
selectedLicenseData = findLicense;
|
|
782
|
-
else if (!findLicense && business_type === BusinessType.FL) {
|
|
783
|
-
selectedLicenseData = __assign(__assign({}, OTHER_FL_LICENSE), { legal_name: {
|
|
784
|
-
ar: number_1,
|
|
785
|
-
en: number_1
|
|
786
|
-
}, license: { number: number_1 } });
|
|
787
|
-
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { licenseList: __spreadArray([selectedLicenseData], licenseList, true) });
|
|
788
|
-
}
|
|
789
|
-
else {
|
|
790
|
-
selectedLicenseData = __assign(__assign({}, OTHER_CR_LICENSE), { legal_name: {
|
|
791
|
-
ar: number_1,
|
|
792
|
-
en: number_1
|
|
793
|
-
}, license: { number: number_1 } });
|
|
794
|
-
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { licenseList: __spreadArray([selectedLicenseData], licenseList, true) });
|
|
795
|
-
}
|
|
796
|
-
state.data.businessTypeData.licenseNumber = number_1;
|
|
797
|
-
}
|
|
798
|
-
state.data.businessTypeData.selectedLicense = __assign(__assign({}, selectedLicenseData), { type: business_type });
|
|
799
|
-
}
|
|
800
797
|
})
|
|
801
798
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
802
799
|
state.error = action.error.message;
|
|
@@ -831,7 +828,9 @@ export var businessSlice = createSlice({
|
|
|
831
828
|
state.data.otpData = formData;
|
|
832
829
|
state.data.otpData.responseBody = data;
|
|
833
830
|
state.data.verify.responseBody = __assign(__assign(__assign({}, leadData), state.data.verify.responseBody), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
|
|
834
|
-
var _d = leadData || {}, entity = _d.entity, entity_activities = _d.entity_activities,
|
|
831
|
+
var _d = leadData || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_name = _d.business_name;
|
|
832
|
+
if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
|
|
833
|
+
state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
|
|
835
834
|
var issuingDate = ((_a = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
|
|
836
835
|
if (issuingDate)
|
|
837
836
|
state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
|
|
@@ -842,37 +841,6 @@ export var businessSlice = createSlice({
|
|
|
842
841
|
});
|
|
843
842
|
state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
|
|
844
843
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
|
|
845
|
-
var license = (entity || {}).license;
|
|
846
|
-
if (license) {
|
|
847
|
-
var number_2 = license.number;
|
|
848
|
-
var _e = state.data.businessTypeData || {}, busResData = _e.responseBody, selectedLicense = _e.selectedLicense;
|
|
849
|
-
var licenseList = (busResData === null || busResData === void 0 ? void 0 : busResData.licenseList) || [];
|
|
850
|
-
var selectedLicenseData = selectedLicense;
|
|
851
|
-
if (number_2) {
|
|
852
|
-
var findLicense = licenseList.find(function (_a) {
|
|
853
|
-
var license = _a.license;
|
|
854
|
-
return license.number === number_2;
|
|
855
|
-
});
|
|
856
|
-
if (findLicense)
|
|
857
|
-
selectedLicenseData = findLicense;
|
|
858
|
-
else if (!findLicense && business_type === BusinessType.FL) {
|
|
859
|
-
selectedLicenseData = __assign(__assign({}, OTHER_FL_LICENSE), { legal_name: {
|
|
860
|
-
ar: number_2,
|
|
861
|
-
en: number_2
|
|
862
|
-
}, license: { number: number_2 } });
|
|
863
|
-
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { licenseList: __spreadArray([selectedLicenseData], licenseList, true) });
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
selectedLicenseData = __assign(__assign({}, OTHER_CR_LICENSE), { legal_name: {
|
|
867
|
-
ar: number_2,
|
|
868
|
-
en: number_2
|
|
869
|
-
}, license: { number: number_2 } });
|
|
870
|
-
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { licenseList: __spreadArray([selectedLicenseData], licenseList, true) });
|
|
871
|
-
}
|
|
872
|
-
state.data.businessTypeData.licenseNumber = number_2;
|
|
873
|
-
}
|
|
874
|
-
state.data.businessTypeData.selectedLicense = __assign(__assign({}, selectedLicenseData), { type: business_type });
|
|
875
|
-
}
|
|
876
844
|
})
|
|
877
845
|
.addCase(verifyLeadOTP.rejected, function (state, action) {
|
|
878
846
|
state.loading = false;
|
|
@@ -965,6 +933,7 @@ export var businessSlice = createSlice({
|
|
|
965
933
|
state.error = null;
|
|
966
934
|
state.loading = false;
|
|
967
935
|
var data = action.payload;
|
|
936
|
+
var entityLicenseList = (state.data.businessTypeData.responseBody || {}).entityLicenseList;
|
|
968
937
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
969
938
|
var licenseList = [];
|
|
970
939
|
if (!description) {
|
|
@@ -979,19 +948,59 @@ export var businessSlice = createSlice({
|
|
|
979
948
|
return __assign(__assign({}, item), { type: BusinessType.FL });
|
|
980
949
|
});
|
|
981
950
|
licenseList = __spreadArray(__spreadArray([], licenseList, true), mappedFL, true);
|
|
951
|
+
licenseList = licenseList.filter(function (_a) {
|
|
952
|
+
var license = _a.license;
|
|
953
|
+
return !(entityLicenseList || []).some(function (e) { return e.license.number === license.number; });
|
|
954
|
+
});
|
|
982
955
|
}
|
|
983
956
|
}
|
|
984
957
|
licenseList = __spreadArray(__spreadArray([], licenseList, true), [OTHER_CR_LICENSE, OTHER_FL_LICENSE], false);
|
|
985
958
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { licenseList: licenseList });
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
959
|
+
if (!(entityLicenseList === null || entityLicenseList === void 0 ? void 0 : entityLicenseList.length)) {
|
|
960
|
+
var selectedLicense = licenseList === null || licenseList === void 0 ? void 0 : licenseList[0];
|
|
961
|
+
var isOtherLicense_1 = ((_b = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _b === void 0 ? void 0 : _b.number) === 'other_fl' || ((_c = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _c === void 0 ? void 0 : _c.number) === 'other_cr';
|
|
962
|
+
state.data.businessTypeData.selectedLicense = selectedLicense;
|
|
963
|
+
if (!isOtherLicense_1)
|
|
964
|
+
state.data.businessTypeData.licenseNumber = ((_d = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _d === void 0 ? void 0 : _d.number) || '';
|
|
965
|
+
}
|
|
991
966
|
})
|
|
992
967
|
.addCase(retrieveEntityList.rejected, function (state, action) {
|
|
993
968
|
state.error = action.error.message;
|
|
994
969
|
state.loading = false;
|
|
970
|
+
})
|
|
971
|
+
.addCase(retrieveAllEntityList.pending, function (state) {
|
|
972
|
+
state.error = null;
|
|
973
|
+
state.loading = true;
|
|
974
|
+
})
|
|
975
|
+
.addCase(retrieveAllEntityList.fulfilled, function (state, action) {
|
|
976
|
+
var _a;
|
|
977
|
+
state.error = null;
|
|
978
|
+
state.loading = false;
|
|
979
|
+
var _b = action.payload, data = _b.data, businessCountryCode = _b.businessCountryCode, entityId = _b.entityId;
|
|
980
|
+
var isKWCountry = isKW(businessCountryCode);
|
|
981
|
+
var list = (data === null || data === void 0 ? void 0 : data.entities_info) || [];
|
|
982
|
+
if (isKWCountry) {
|
|
983
|
+
list = list.filter(function (l) { var _a; return ((_a = l.license) === null || _a === void 0 ? void 0 : _a.type) !== LicenseType.FL; });
|
|
984
|
+
}
|
|
985
|
+
var entityLicenseList = [];
|
|
986
|
+
if (list.length > 0) {
|
|
987
|
+
entityLicenseList = list.map(function (item) {
|
|
988
|
+
var _a;
|
|
989
|
+
return __assign(__assign({}, item), { type: ((_a = item.license) === null || _a === void 0 ? void 0 : _a.type) === LicenseType.FL ? BusinessType.FL : BusinessType.CR });
|
|
990
|
+
});
|
|
991
|
+
entityLicenseList = __spreadArray(__spreadArray([], entityLicenseList, true), [OTHER_ENTITY_LICENSE], false);
|
|
992
|
+
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entityLicenseList: entityLicenseList });
|
|
993
|
+
var findEntity = entityLicenseList.find(function (e) { return e.id === entityId; });
|
|
994
|
+
var selectedLicense = findEntity ? findEntity : entityLicenseList[0];
|
|
995
|
+
state.data.businessTypeData.selectedEntityLicense = selectedLicense;
|
|
996
|
+
state.data.businessTypeData.selectedLicense = selectedLicense;
|
|
997
|
+
if (!isOtherLicense(selectedLicense))
|
|
998
|
+
state.data.businessTypeData.licenseNumber = ((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
999
|
+
}
|
|
1000
|
+
})
|
|
1001
|
+
.addCase(retrieveAllEntityList.rejected, function (state, action) {
|
|
1002
|
+
state.error = action.error.message;
|
|
1003
|
+
state.loading = false;
|
|
995
1004
|
})
|
|
996
1005
|
.addCase(retrieveBoardDetails.pending, function (state) {
|
|
997
1006
|
state.error = null;
|
|
@@ -71,7 +71,7 @@ import { handleNextScreenStep } from '../../../app/settings';
|
|
|
71
71
|
import { CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, OTHER_BRAND } from '../../../constants';
|
|
72
72
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
73
73
|
import { AuthForType, FlowsTypes } from '../../../@types';
|
|
74
|
-
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList,
|
|
74
|
+
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep } from '../../../utils';
|
|
75
75
|
export var createMobileAuth = createAsyncThunk('createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
76
|
var settings, requestBody, data;
|
|
77
77
|
var _a, _b;
|
|
@@ -586,7 +586,7 @@ var initialState = {
|
|
|
586
586
|
},
|
|
587
587
|
nidData: {
|
|
588
588
|
nid: '',
|
|
589
|
-
dob:
|
|
589
|
+
dob: '',
|
|
590
590
|
type: ''
|
|
591
591
|
},
|
|
592
592
|
civilIdData: {
|
|
@@ -57,11 +57,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen } from '../../../app/settings';
|
|
60
|
-
import { FlowsTypes, AuthForType, BusinessType } from '../../../@types';
|
|
60
|
+
import { FlowsTypes, AuthForType, BusinessType, LicenseType } from '../../../@types';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
|
|
63
63
|
import { defaultCountry } from '../../../constants';
|
|
64
|
-
import { getIndividualName, capitalizeTheFirstLetterOfEachWord,
|
|
64
|
+
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA } from '../../../utils';
|
|
65
65
|
export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
66
|
var _a, settings, connectExpress, countryCode, showBoard, data, phone, status, board_id, board_info_id, isRegistered, _b, boardInfo, boardData, error_1;
|
|
67
67
|
var _c, _d;
|
|
@@ -701,7 +701,7 @@ export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDat
|
|
|
701
701
|
id: id || '',
|
|
702
702
|
brand: brandNameBody,
|
|
703
703
|
license_number: isNonSA && isFL ? '' : params.licenseNumber,
|
|
704
|
-
license_type: isFL ?
|
|
704
|
+
license_type: isFL ? LicenseType.FL : LicenseType.CR,
|
|
705
705
|
business_type: (_d = params.selectedLicense) === null || _d === void 0 ? void 0 : _d.type,
|
|
706
706
|
is_acknowledged: true,
|
|
707
707
|
terms_conditions_accepted: !isLeadIdPassed ? params.termAndConditionChecked : undefined,
|
|
@@ -733,7 +733,7 @@ var initialState = {
|
|
|
733
733
|
},
|
|
734
734
|
nidData: {
|
|
735
735
|
nid: '',
|
|
736
|
-
dob:
|
|
736
|
+
dob: '',
|
|
737
737
|
termAndConditionChecked: false
|
|
738
738
|
},
|
|
739
739
|
civilIdData: {
|
|
@@ -39,6 +39,9 @@ export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
39
39
|
};
|
|
40
40
|
formData: OTPFormValues;
|
|
41
41
|
}, OTPFormValues, {}>;
|
|
42
|
+
export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
|
|
43
|
+
flows: any;
|
|
44
|
+
}, void, {}>;
|
|
42
45
|
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
|
|
43
46
|
data: any;
|
|
44
47
|
}, string, {}>;
|