@tap-payments/auth-jsconnect 2.8.2-test → 2.8.10-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/constants/app.js +2 -2
- package/build/features/app/auth/authStore.d.ts +24 -3
- package/build/features/app/auth/authStore.js +104 -15
- package/build/features/app/bank/bankStore.d.ts +14 -18
- package/build/features/app/bank/bankStore.js +163 -159
- package/build/features/app/brand/brandStore.d.ts +17 -31
- package/build/features/app/brand/brandStore.js +169 -196
- package/build/features/app/connectExpress/connectExpressStore.js +26 -14
- package/build/features/app/entity/entityStore.d.ts +16 -33
- package/build/features/app/entity/entityStore.js +131 -201
- package/build/features/app/tax/taxStore.d.ts +14 -7
- package/build/features/app/tax/taxStore.js +143 -132
- package/build/features/auth/screens/OTP/OTP.js +3 -0
- package/build/features/auth/screens/OTP/OTPInput.js +12 -2
- package/build/features/auth/screens/PreparingData/PreparingData.js +1 -1
- package/build/features/bank/screens/Verify/Verify.js +4 -4
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +1 -10
- package/build/features/tax/screens/Verify/Verify.js +4 -4
- package/package.json +1 -1
|
@@ -67,10 +67,10 @@ import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedVal
|
|
|
67
67
|
export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (_a, thunkApi) {
|
|
68
68
|
var token = _a.token, isInternally = _a.isInternally;
|
|
69
69
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
70
|
-
var payload, data,
|
|
71
|
-
var
|
|
72
|
-
return __generator(this, function (
|
|
73
|
-
switch (
|
|
70
|
+
var payload, data, entityData, entityTypes, countryIso2, publicKey, entity_id;
|
|
71
|
+
var _b, _c, _d;
|
|
72
|
+
return __generator(this, function (_e) {
|
|
73
|
+
switch (_e.label) {
|
|
74
74
|
case 0:
|
|
75
75
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
76
76
|
notification: {
|
|
@@ -79,74 +79,39 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
79
79
|
}));
|
|
80
80
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
81
81
|
case 1:
|
|
82
|
-
data = (
|
|
82
|
+
data = (_e.sent()).data;
|
|
83
83
|
countryIso2 = undefined;
|
|
84
|
-
if (
|
|
84
|
+
if (((_b = data === null || data === void 0 ? void 0 : data.errors) === null || _b === void 0 ? void 0 : _b.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
85
|
+
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
85
86
|
if (isInternally)
|
|
86
87
|
data.step_name = ENTITY_STEP_NAMES.ENTITY_INFO;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
|
|
93
|
-
if (publicKey) {
|
|
88
|
+
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
89
|
+
if (countryIso2)
|
|
90
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
91
|
+
publicKey = (_c = data === null || data === void 0 ? void 0 : data.config) === null || _c === void 0 ? void 0 : _c.public_key;
|
|
92
|
+
if (publicKey)
|
|
94
93
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return [4, API.
|
|
94
|
+
if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 4];
|
|
95
|
+
entity_id = (data || {}).entity_id;
|
|
96
|
+
if (!entity_id)
|
|
97
|
+
throw new Error('Internal server error');
|
|
98
|
+
return [4, API.entityService.retrieveEntity(entity_id)];
|
|
100
99
|
case 2:
|
|
101
|
-
|
|
102
|
-
if (!board_info_id) return [3, 4];
|
|
103
|
-
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
104
|
-
case 3:
|
|
105
|
-
boardInfoData = _l.sent();
|
|
106
|
-
_l.label = 4;
|
|
107
|
-
case 4:
|
|
108
|
-
_c = ((_f = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _f === void 0 ? void 0 : _f.recipient) || {}, id_1 = _c.id, type_1 = _c.type;
|
|
109
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
|
|
110
|
-
return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
|
|
111
|
-
case 5:
|
|
112
|
-
_d = _l.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
113
|
-
boardData = boardRes;
|
|
114
|
-
individualData = individualRes;
|
|
115
|
-
_l.label = 6;
|
|
116
|
-
case 6:
|
|
117
|
-
entityId = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.id;
|
|
118
|
-
if (!entityId) return [3, 8];
|
|
119
|
-
return [4, API.entityService.retrieveEntity(entityId)];
|
|
120
|
-
case 7:
|
|
121
|
-
entityData = _l.sent();
|
|
122
|
-
_l.label = 8;
|
|
123
|
-
case 8:
|
|
100
|
+
entityData = _e.sent();
|
|
124
101
|
if (!countryIso2) {
|
|
125
|
-
countryIso2 = (
|
|
102
|
+
countryIso2 = (_d = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _d === void 0 ? void 0 : _d.country;
|
|
126
103
|
if (countryIso2)
|
|
127
104
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
128
105
|
}
|
|
129
106
|
return [4, API.entityService.retrieveEntityType()];
|
|
130
|
-
case
|
|
131
|
-
entityTypes =
|
|
107
|
+
case 3:
|
|
108
|
+
entityTypes = _e.sent();
|
|
132
109
|
thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
|
|
133
|
-
|
|
134
|
-
case
|
|
110
|
+
_e.label = 4;
|
|
111
|
+
case 4: return [2, {
|
|
135
112
|
data: data,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
139
|
-
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
140
|
-
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
141
|
-
entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
142
|
-
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
143
|
-
name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
|
|
144
|
-
contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
|
|
145
|
-
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
146
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
147
|
-
entityTypes: entityTypes,
|
|
148
|
-
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
149
|
-
},
|
|
113
|
+
entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
114
|
+
entityTypes: entityTypes,
|
|
150
115
|
token: token
|
|
151
116
|
}];
|
|
152
117
|
}
|
|
@@ -171,112 +136,99 @@ export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thu
|
|
|
171
136
|
});
|
|
172
137
|
}); });
|
|
173
138
|
export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
174
|
-
var _a, entity, settings, responseBody, payload, data,
|
|
175
|
-
var
|
|
176
|
-
return __generator(this, function (
|
|
177
|
-
switch (
|
|
139
|
+
var _a, entity, settings, responseBody, payload, data, _b, entity_id, config, publicKey, entityData, entityTypes;
|
|
140
|
+
var _c, _d, _e, _f;
|
|
141
|
+
return __generator(this, function (_g) {
|
|
142
|
+
switch (_g.label) {
|
|
178
143
|
case 0:
|
|
179
144
|
_a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
|
|
180
145
|
responseBody = entity.data.verify.responseBody;
|
|
181
146
|
payload = {
|
|
182
147
|
data: params.otp,
|
|
183
|
-
service_name: (
|
|
148
|
+
service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
|
|
184
149
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
185
150
|
step_name: ENTITY_STEP_NAMES.PHONE_AUTH,
|
|
186
151
|
encryption_contract: ['data']
|
|
187
152
|
};
|
|
188
153
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
189
154
|
case 1:
|
|
190
|
-
data = (
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
_b = data || {},
|
|
155
|
+
data = (_g.sent()).data;
|
|
156
|
+
if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
157
|
+
throw new Error(data.errors[0].description);
|
|
158
|
+
_b = data || {}, entity_id = _b.entity_id, config = _b.config;
|
|
194
159
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
195
|
-
if (publicKey)
|
|
160
|
+
if (publicKey)
|
|
196
161
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return [4, API.
|
|
162
|
+
if (!entity_id)
|
|
163
|
+
throw new Error('Internal server error');
|
|
164
|
+
return [4, API.entityService.retrieveEntity(entity_id)];
|
|
200
165
|
case 2:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
204
|
-
case 3:
|
|
205
|
-
boardInfoData = _m.sent();
|
|
206
|
-
_m.label = 4;
|
|
207
|
-
case 4:
|
|
208
|
-
_c = ((_f = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _f === void 0 ? void 0 : _f.recipient) || {}, id_2 = _c.id, type_2 = _c.type;
|
|
209
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
|
|
210
|
-
return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
|
|
211
|
-
case 5:
|
|
212
|
-
_d = _m.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
213
|
-
boardData = boardRes;
|
|
214
|
-
individualData = individualRes;
|
|
215
|
-
_m.label = 6;
|
|
216
|
-
case 6:
|
|
217
|
-
entityId = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.id;
|
|
218
|
-
if (!entityId) return [3, 8];
|
|
219
|
-
return [4, API.entityService.retrieveEntity(entityId)];
|
|
220
|
-
case 7:
|
|
221
|
-
entityData = _m.sent();
|
|
222
|
-
_m.label = 8;
|
|
223
|
-
case 8:
|
|
224
|
-
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { otp: params.otp });
|
|
166
|
+
entityData = _g.sent();
|
|
167
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
|
|
225
168
|
return [4, API.entityService.retrieveEntityType()];
|
|
226
|
-
case
|
|
227
|
-
entityTypes =
|
|
169
|
+
case 3:
|
|
170
|
+
entityTypes = _g.sent();
|
|
228
171
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
individualData: individualData,
|
|
233
|
-
boardResponse: {
|
|
234
|
-
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
235
|
-
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
236
|
-
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
237
|
-
entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
238
|
-
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
239
|
-
name: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.names,
|
|
240
|
-
contact: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.contact,
|
|
241
|
-
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
242
|
-
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
172
|
+
return [2, {
|
|
173
|
+
data: data,
|
|
174
|
+
entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
243
175
|
entityTypes: entityTypes,
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
formData: params
|
|
247
|
-
}];
|
|
176
|
+
formData: params
|
|
177
|
+
}];
|
|
248
178
|
}
|
|
249
179
|
});
|
|
250
180
|
}); });
|
|
251
181
|
export var retrieveBoardStatus = createAsyncThunk('entity/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
252
|
-
var entity, board_id, data;
|
|
253
|
-
|
|
254
|
-
|
|
182
|
+
var entity, _a, board_id, board_info_id, _b, boardInfoData, data, _c, id, type;
|
|
183
|
+
var _d;
|
|
184
|
+
return __generator(this, function (_e) {
|
|
185
|
+
switch (_e.label) {
|
|
255
186
|
case 0:
|
|
256
187
|
entity = thunkApi.getState().entity;
|
|
257
|
-
|
|
258
|
-
|
|
188
|
+
_a = entity.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id;
|
|
189
|
+
if (!board_id || !board_info_id)
|
|
190
|
+
throw new Error('Internal server error');
|
|
191
|
+
return [4, Promise.all([
|
|
192
|
+
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
193
|
+
API.boardService.retrieveBoardInfoStatus(board_id)
|
|
194
|
+
])];
|
|
259
195
|
case 1:
|
|
260
|
-
|
|
196
|
+
_b = _e.sent(), boardInfoData = _b[0], data = _b[1];
|
|
197
|
+
_c = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id = _c.id, type = _c.type;
|
|
198
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()];
|
|
199
|
+
case 2:
|
|
200
|
+
_e.sent();
|
|
261
201
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
262
|
-
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
202
|
+
return [2, { data: boardInfoData, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
263
203
|
}
|
|
264
204
|
});
|
|
265
205
|
}); });
|
|
266
|
-
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
206
|
+
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (_a) {
|
|
207
|
+
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
208
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
209
|
+
var data, individualData, serviceCallBack, data_state;
|
|
210
|
+
var _b, _c, _d;
|
|
211
|
+
return __generator(this, function (_e) {
|
|
212
|
+
switch (_e.label) {
|
|
213
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
214
|
+
case 1:
|
|
215
|
+
data = _e.sent();
|
|
216
|
+
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
217
|
+
if (!(((_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.id) !== id)) return [3, 3];
|
|
218
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
219
|
+
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
220
|
+
case 2:
|
|
221
|
+
individualData = _e.sent();
|
|
222
|
+
_e.label = 3;
|
|
223
|
+
case 3:
|
|
224
|
+
data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
|
|
225
|
+
return [2, __assign(__assign(__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: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_d = data === null || data === void 0 ? void 0 : data.user) === null || _d === void 0 ? void 0 : _d.contact }), (individualData && { user: individualData })), (data_state && {
|
|
226
|
+
individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
|
|
227
|
+
}))];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
278
230
|
});
|
|
279
|
-
});
|
|
231
|
+
});
|
|
280
232
|
export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
|
|
281
233
|
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
282
234
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -428,39 +380,40 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
|
|
|
428
380
|
});
|
|
429
381
|
});
|
|
430
382
|
export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
431
|
-
var _a, settings, entity, _b,
|
|
432
|
-
var
|
|
433
|
-
return __generator(this, function (
|
|
434
|
-
switch (
|
|
383
|
+
var _a, settings, entity, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
|
|
384
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
385
|
+
return __generator(this, function (_p) {
|
|
386
|
+
switch (_p.label) {
|
|
435
387
|
case 0:
|
|
436
388
|
_a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
|
|
437
|
-
_b = entity.data.verify.responseBody || {},
|
|
389
|
+
_b = entity.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
|
|
438
390
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
439
|
-
if (!
|
|
391
|
+
if (!board_id)
|
|
440
392
|
return [2];
|
|
441
393
|
payload = {
|
|
442
394
|
lang: settings.data.language,
|
|
443
395
|
step_name: ENTITY_STEP_NAMES.ENTITY_SUCCESS,
|
|
444
|
-
id:
|
|
396
|
+
id: board_id
|
|
445
397
|
};
|
|
446
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
398
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
|
|
447
399
|
case 1:
|
|
448
|
-
data =
|
|
400
|
+
data = _p.sent();
|
|
449
401
|
if (!showBoard && mode === 'content') {
|
|
450
|
-
(
|
|
451
|
-
(
|
|
452
|
-
return [2, {
|
|
402
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
403
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
|
|
404
|
+
return [2, { data: data }];
|
|
453
405
|
}
|
|
454
|
-
|
|
406
|
+
_d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, type = _d.type;
|
|
407
|
+
return [4, Promise.all([
|
|
408
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
409
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
410
|
+
])];
|
|
455
411
|
case 2:
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
_m.sent();
|
|
460
|
-
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
461
|
-
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
412
|
+
boardInfoStatusData = (_p.sent())[0];
|
|
413
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
|
|
414
|
+
(_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
|
|
462
415
|
thunkApi.dispatch(handleNextScreenStep());
|
|
463
|
-
return [2, {
|
|
416
|
+
return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
|
|
464
417
|
}
|
|
465
418
|
});
|
|
466
419
|
}); });
|
|
@@ -541,28 +494,22 @@ export var entitySlice = createSlice({
|
|
|
541
494
|
state.customLoading = true;
|
|
542
495
|
})
|
|
543
496
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
544
|
-
var _a, _b, _c
|
|
497
|
+
var _a, _b, _c;
|
|
545
498
|
state.error = null;
|
|
546
499
|
state.customLoading = false;
|
|
547
|
-
var
|
|
548
|
-
|
|
549
|
-
if (description) {
|
|
550
|
-
state.error = description;
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, individualData: individualData });
|
|
500
|
+
var _d = action.payload, data = _d.data, token = _d.token, entity = _d.entityData, entityTypes = _d.entityTypes;
|
|
501
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes, board_id: data.id });
|
|
554
502
|
state.data.verify.token = token;
|
|
555
|
-
var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
|
|
556
503
|
if (entity) {
|
|
557
|
-
var
|
|
504
|
+
var _e = entity || {}, license = _e.license, type = _e.type, capital = _e.capital, activities = _e.activities, legal_name = _e.legal_name;
|
|
558
505
|
var legalName = legal_name;
|
|
559
506
|
var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
|
|
560
|
-
var unifiedNumber = (
|
|
507
|
+
var unifiedNumber = (_a = license === null || license === void 0 ? void 0 : license.additional_info) === null || _a === void 0 ? void 0 : _a.unified_number;
|
|
561
508
|
var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
|
|
562
509
|
var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
|
|
563
|
-
var
|
|
564
|
-
var entityIssueDate = (
|
|
565
|
-
var entityExpiredDate = (
|
|
510
|
+
var _f = capital || {}, paid = _f.paid, shares = _f.shares;
|
|
511
|
+
var entityIssueDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
|
|
512
|
+
var entityExpiredDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.expiry_date;
|
|
566
513
|
var issuingDate = void 0, expiryDate = undefined;
|
|
567
514
|
if (entityIssueDate) {
|
|
568
515
|
var date = new Date(entityIssueDate);
|
|
@@ -622,28 +569,22 @@ export var entitySlice = createSlice({
|
|
|
622
569
|
state.error = null;
|
|
623
570
|
})
|
|
624
571
|
.addCase(verifyEntityLeadOTP.fulfilled, function (state, action) {
|
|
625
|
-
var _a, _b, _c
|
|
572
|
+
var _a, _b, _c;
|
|
626
573
|
state.loading = false;
|
|
627
574
|
state.error = null;
|
|
628
|
-
var
|
|
629
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
630
|
-
if (description) {
|
|
631
|
-
state.error = description;
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
575
|
+
var _d = action.payload, data = _d.data, entity = _d.entityData, entityTypes = _d.entityTypes, formData = _d.formData;
|
|
634
576
|
state.data.otpData = formData;
|
|
635
577
|
state.data.otpData.responseBody = data;
|
|
636
|
-
state.data.verify.responseBody = __assign(__assign(
|
|
637
|
-
var
|
|
638
|
-
var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
|
|
578
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes });
|
|
579
|
+
var _e = entity || {}, license = _e.license, type = _e.type, capital = _e.capital, activities = _e.activities, legal_name = _e.legal_name;
|
|
639
580
|
var legalName = legal_name;
|
|
640
581
|
var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
|
|
641
|
-
var unifiedNumber = (
|
|
582
|
+
var unifiedNumber = (_a = license === null || license === void 0 ? void 0 : license.additional_info) === null || _a === void 0 ? void 0 : _a.unified_number;
|
|
642
583
|
var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
|
|
643
584
|
var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
|
|
644
|
-
var
|
|
645
|
-
var entityIssueDate = (
|
|
646
|
-
var entityExpiredDate = (
|
|
585
|
+
var _f = capital || {}, paid = _f.paid, shares = _f.shares;
|
|
586
|
+
var entityIssueDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
|
|
587
|
+
var entityExpiredDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.expiry_date;
|
|
647
588
|
var issuingDate, expiryDate = undefined;
|
|
648
589
|
if (entityIssueDate) {
|
|
649
590
|
var date = new Date(entityIssueDate);
|
|
@@ -724,7 +665,7 @@ export var entitySlice = createSlice({
|
|
|
724
665
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
725
666
|
state.error = null;
|
|
726
667
|
state.loading = false;
|
|
727
|
-
var data =
|
|
668
|
+
var data = action.payload || {};
|
|
728
669
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
729
670
|
})
|
|
730
671
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -738,29 +679,18 @@ export var entitySlice = createSlice({
|
|
|
738
679
|
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
739
680
|
state.error = null;
|
|
740
681
|
state.loading = false;
|
|
741
|
-
var
|
|
742
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
682
|
+
var _a = action.payload || {}, flows = _a.flows, data = _a.data;
|
|
683
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, notification: data === null || data === void 0 ? void 0 : data.notification });
|
|
743
684
|
})
|
|
744
685
|
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
745
686
|
state.error = action.error.message;
|
|
746
687
|
state.loading = false;
|
|
747
688
|
})
|
|
748
689
|
.addCase(updateBoardSuccess.fulfilled, function (state, action) {
|
|
749
|
-
var _a;
|
|
750
690
|
state.loading = false;
|
|
751
691
|
state.error = null;
|
|
752
|
-
var
|
|
753
|
-
|
|
754
|
-
if (description) {
|
|
755
|
-
state.error = description;
|
|
756
|
-
return;
|
|
757
|
-
}
|
|
758
|
-
var flows = response.flows;
|
|
759
|
-
var _b = state.data.verify.responseBody || {}, individuals = _b.individuals, individualData = _b.individualData;
|
|
760
|
-
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
761
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
762
|
-
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
763
|
-
}));
|
|
692
|
+
var _a = action.payload || {}, flows = _a.flows, data = _a.data;
|
|
693
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, notification: data === null || data === void 0 ? void 0 : data.notification });
|
|
764
694
|
})
|
|
765
695
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
766
696
|
state.loading = true;
|
|
@@ -6,8 +6,7 @@ interface VerifyLeadTokenProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
8
8
|
data: any;
|
|
9
|
-
|
|
10
|
-
boardResponse: any;
|
|
9
|
+
entityData: any;
|
|
11
10
|
token: string;
|
|
12
11
|
}, VerifyLeadTokenProps, {
|
|
13
12
|
state?: unknown;
|
|
@@ -32,6 +31,7 @@ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
32
31
|
rejectedMeta?: unknown;
|
|
33
32
|
}>;
|
|
34
33
|
export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
|
|
34
|
+
data: any;
|
|
35
35
|
flows: any;
|
|
36
36
|
}, void, {
|
|
37
37
|
state?: unknown;
|
|
@@ -43,9 +43,12 @@ export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
43
43
|
fulfilledMeta?: unknown;
|
|
44
44
|
rejectedMeta?: unknown;
|
|
45
45
|
}>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
type RetrieveBoardProps = {
|
|
47
|
+
boardId: string;
|
|
48
|
+
individualId: string;
|
|
49
|
+
individualType: string;
|
|
50
|
+
};
|
|
51
|
+
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<any, RetrieveBoardProps, {
|
|
49
52
|
state?: unknown;
|
|
50
53
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
51
54
|
extra?: unknown;
|
|
@@ -57,6 +60,7 @@ export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
57
60
|
}>;
|
|
58
61
|
export declare const verifyTaxLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
59
62
|
data: any;
|
|
63
|
+
entityData: any;
|
|
60
64
|
formData: OTPFormValues;
|
|
61
65
|
}, OTPFormValues, {
|
|
62
66
|
state?: unknown;
|
|
@@ -82,8 +86,11 @@ export declare const updateTaxInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
82
86
|
rejectedMeta?: unknown;
|
|
83
87
|
}>;
|
|
84
88
|
export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
data: any;
|
|
90
|
+
flows?: undefined;
|
|
91
|
+
} | {
|
|
92
|
+
data: any;
|
|
93
|
+
flows: any;
|
|
87
94
|
} | undefined, void, {
|
|
88
95
|
state?: unknown;
|
|
89
96
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|