@tap-payments/auth-jsconnect 2.8.44-test → 2.8.45-beta
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/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/axios.js +1 -2
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +11 -3
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +161 -173
- package/build/features/app/board/boardStore.js +30 -52
- package/build/features/app/brand/brandStore.d.ts +33 -16
- package/build/features/app/brand/brandStore.js +204 -173
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +86 -69
- package/build/features/app/connectExpress/connectExpressStore.js +10 -18
- package/build/features/app/entity/entityStore.d.ts +35 -15
- package/build/features/app/entity/entityStore.js +228 -159
- package/build/features/app/individual/individualStore.d.ts +37 -21
- package/build/features/app/individual/individualStore.js +265 -253
- package/build/features/app/password/passwordStore.d.ts +23 -40
- package/build/features/app/password/passwordStore.js +233 -226
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -167
- package/build/features/bank/Bank.d.ts +0 -1
- package/build/features/bank/Bank.js +4 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +4 -12
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +4 -8
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
- package/build/features/brand/Brand.d.ts +0 -1
- package/build/features/brand/Brand.js +4 -7
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +1 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +1 -1
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +1 -1
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +4 -9
- package/build/features/business/screens/Activities/Activities.js +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +1 -1
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +1 -1
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/business/screens/Verify/Verify.js +1 -1
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +1 -2
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +1 -1
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
- package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/Mobile/Mobile.js +1 -1
- package/build/features/connectExpress/screens/NID/NID.js +1 -1
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +1 -1
- package/build/features/entity/screens/EntityName/EntityName.js +1 -1
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +7 -62
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.js +5 -11
- package/build/features/individual/screens/IndividualList/UserList.js +9 -13
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -4
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +0 -1
- package/build/features/password/Password.js +28 -75
- package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Button/FlowsButtons.js +3 -4
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
- package/build/features/signIn/SignIn.js +3 -12
- package/build/features/tax/Tax.d.ts +0 -1
- package/build/features/tax/Tax.js +4 -7
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useVerifyToken.d.ts +2 -5
- package/build/hooks/useVerifyToken.js +5 -10
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +1 -2
- package/build/utils/string.d.ts +2 -5
- package/build/utils/string.js +5 -34
- package/package.json +2 -2
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
- package/build/features/bank/screens/OperatorError/index.js +0 -2
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/board/screens/OperatorError/index.d.ts +0 -3
- package/build/features/board/screens/OperatorError/index.js +0 -2
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
- package/build/features/brand/screens/OperatorError/index.js +0 -2
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/business/screens/OperatorError/index.d.ts +0 -3
- package/build/features/business/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -31
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
- package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
- package/build/features/entity/screens/OperatorError/index.js +0 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -36
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
- package/build/features/individual/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/password/screens/OperatorError/index.d.ts +0 -3
- package/build/features/password/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
- package/build/features/signIn/screens/OperatorError/index.js +0 -2
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
- package/build/features/tax/screens/OperatorError/index.js +0 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -6
- package/build/hooks/useFormDirtyCheck.js +0 -29
|
@@ -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, entityData, entityTypes,
|
|
71
|
-
var
|
|
72
|
-
return __generator(this, function (
|
|
73
|
-
switch (
|
|
70
|
+
var payload, data, boardData, boardInfoData, entityData, entityTypes, individualData, countryIso2, publicKey, _b, board_id, board_info_id, _c, id_1, type_1, serviceCallBack, _d, boardRes, individualRes, entityId;
|
|
71
|
+
var _e, _f, _g, _h, _j, _k, _l;
|
|
72
|
+
return __generator(this, function (_m) {
|
|
73
|
+
switch (_m.label) {
|
|
74
74
|
case 0:
|
|
75
75
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
76
76
|
notification: {
|
|
@@ -79,47 +79,76 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
79
79
|
}));
|
|
80
80
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
81
81
|
case 1:
|
|
82
|
-
data = (
|
|
83
|
-
|
|
84
|
-
if (((
|
|
85
|
-
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
82
|
+
data = (_m.sent()).data;
|
|
83
|
+
countryIso2 = undefined;
|
|
84
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 10];
|
|
86
85
|
if (isInternally)
|
|
87
86
|
data.step_name = ENTITY_STEP_NAMES.ENTITY_INFO;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
88
|
+
countryIso2 = data.country_code;
|
|
89
|
+
if (countryIso2)
|
|
90
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
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) {
|
|
93
94
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return [
|
|
95
|
+
}
|
|
96
|
+
if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 10];
|
|
97
|
+
_b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id;
|
|
98
|
+
if (!board_id) return [3, 6];
|
|
99
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
98
100
|
case 2:
|
|
99
|
-
|
|
100
|
-
if (!
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
boardData = _m.sent();
|
|
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 = _m.sent();
|
|
106
|
+
_m.label = 4;
|
|
105
107
|
case 4:
|
|
106
|
-
|
|
107
|
-
|
|
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)];
|
|
108
111
|
case 5:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
_d = _m.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
113
|
+
boardData = boardRes;
|
|
114
|
+
individualData = individualRes;
|
|
115
|
+
_m.label = 6;
|
|
112
116
|
case 6:
|
|
113
|
-
|
|
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 = _m.sent();
|
|
122
|
+
_m.label = 8;
|
|
123
|
+
case 8:
|
|
124
|
+
if (!countryIso2 && ((_h = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _h === void 0 ? void 0 : _h.country)) {
|
|
125
|
+
countryIso2 = (_j = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _j === void 0 ? void 0 : _j.country;
|
|
126
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
127
|
+
}
|
|
128
|
+
return [4, API.entityService.retrieveEntityType()];
|
|
129
|
+
case 9:
|
|
130
|
+
entityTypes = _m.sent();
|
|
114
131
|
if (isInternally)
|
|
115
132
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
|
|
116
133
|
else
|
|
117
134
|
thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
|
|
118
|
-
|
|
119
|
-
case
|
|
135
|
+
_m.label = 10;
|
|
136
|
+
case 10: return [2, {
|
|
120
137
|
data: data,
|
|
121
|
-
|
|
122
|
-
|
|
138
|
+
individualData: individualData,
|
|
139
|
+
boardResponse: {
|
|
140
|
+
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
141
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
142
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
143
|
+
entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
144
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
145
|
+
name: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.names,
|
|
146
|
+
contact: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.contact,
|
|
147
|
+
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
148
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
149
|
+
entityTypes: entityTypes,
|
|
150
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
151
|
+
},
|
|
123
152
|
token: token
|
|
124
153
|
}];
|
|
125
154
|
}
|
|
@@ -144,112 +173,124 @@ export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thu
|
|
|
144
173
|
});
|
|
145
174
|
}); });
|
|
146
175
|
export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
|
-
var _a, entity, settings, responseBody, payload, data, _b,
|
|
148
|
-
var
|
|
149
|
-
return __generator(this, function (
|
|
150
|
-
switch (
|
|
176
|
+
var _a, entity, settings, responseBody, payload, data, boardData, entityData, entityTypes, boardInfoData, individualData, countryIso2, _b, board_id, board_info_id, config, country_code, publicKey, _c, id_2, type_2, serviceCallBack, _d, boardRes, individualRes, entityId;
|
|
177
|
+
var _e, _f, _g, _h, _j, _k, _l, _m;
|
|
178
|
+
return __generator(this, function (_o) {
|
|
179
|
+
switch (_o.label) {
|
|
151
180
|
case 0:
|
|
152
181
|
_a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
|
|
153
182
|
responseBody = entity.data.verify.responseBody;
|
|
154
183
|
payload = {
|
|
155
184
|
data: params.otp,
|
|
156
|
-
service_name: (
|
|
185
|
+
service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
|
|
157
186
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
158
187
|
step_name: ENTITY_STEP_NAMES.PHONE_AUTH,
|
|
159
188
|
encryption_contract: ['data']
|
|
160
189
|
};
|
|
161
190
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
162
191
|
case 1:
|
|
163
|
-
data = (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
_b = data || {},
|
|
167
|
-
entityData = undefined;
|
|
192
|
+
data = (_o.sent()).data;
|
|
193
|
+
countryIso2 = undefined;
|
|
194
|
+
if (!!data.errors) return [3, 10];
|
|
195
|
+
_b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id, config = _b.config, country_code = _b.country_code;
|
|
168
196
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
169
|
-
|
|
170
|
-
if (publicKey)
|
|
197
|
+
if (publicKey) {
|
|
171
198
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
172
|
-
|
|
199
|
+
}
|
|
200
|
+
if (country_code) {
|
|
201
|
+
countryIso2 = country_code;
|
|
173
202
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
174
|
-
|
|
175
|
-
return [
|
|
203
|
+
}
|
|
204
|
+
if (!board_id) return [3, 6];
|
|
205
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
176
206
|
case 2:
|
|
177
|
-
|
|
178
|
-
if (!
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
207
|
+
boardData = _o.sent();
|
|
208
|
+
if (!board_info_id) return [3, 4];
|
|
209
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
210
|
+
case 3:
|
|
211
|
+
boardInfoData = _o.sent();
|
|
212
|
+
_o.label = 4;
|
|
183
213
|
case 4:
|
|
184
|
-
|
|
185
|
-
|
|
214
|
+
_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;
|
|
215
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
|
|
216
|
+
return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
|
|
186
217
|
case 5:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
218
|
+
_d = _o.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
219
|
+
boardData = boardRes;
|
|
220
|
+
individualData = individualRes;
|
|
221
|
+
_o.label = 6;
|
|
191
222
|
case 6:
|
|
192
|
-
|
|
223
|
+
entityId = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.id;
|
|
224
|
+
if (!entityId) return [3, 8];
|
|
225
|
+
return [4, API.entityService.retrieveEntity(entityId)];
|
|
226
|
+
case 7:
|
|
227
|
+
entityData = _o.sent();
|
|
228
|
+
_o.label = 8;
|
|
229
|
+
case 8:
|
|
230
|
+
if (!countryIso2 && ((_h = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _h === void 0 ? void 0 : _h.country)) {
|
|
231
|
+
countryIso2 = entityData.entity.country;
|
|
232
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
233
|
+
}
|
|
234
|
+
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, { otp: params.otp });
|
|
235
|
+
return [4, API.entityService.retrieveEntityType()];
|
|
236
|
+
case 9:
|
|
237
|
+
entityTypes = _o.sent();
|
|
193
238
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
239
|
+
_o.label = 10;
|
|
240
|
+
case 10: return [2, {
|
|
241
|
+
data: data,
|
|
242
|
+
individualData: individualData,
|
|
243
|
+
boardResponse: {
|
|
244
|
+
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
245
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
246
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
247
|
+
entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
248
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
249
|
+
name: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.names,
|
|
250
|
+
contact: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.contact,
|
|
251
|
+
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
252
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
197
253
|
entityTypes: entityTypes,
|
|
198
|
-
|
|
199
|
-
}
|
|
254
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
255
|
+
},
|
|
256
|
+
formData: params
|
|
257
|
+
}];
|
|
200
258
|
}
|
|
201
259
|
});
|
|
202
260
|
}); });
|
|
203
261
|
export var retrieveBoardStatus = createAsyncThunk('entity/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
204
|
-
var entity,
|
|
205
|
-
return __generator(this, function (
|
|
206
|
-
switch (
|
|
262
|
+
var entity, board_id, data;
|
|
263
|
+
return __generator(this, function (_a) {
|
|
264
|
+
switch (_a.label) {
|
|
207
265
|
case 0:
|
|
208
266
|
entity = thunkApi.getState().entity;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
throw new Error('Internal server error');
|
|
212
|
-
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
213
|
-
return [4, Promise.all([
|
|
214
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
215
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
216
|
-
])];
|
|
267
|
+
board_id = (entity.data.verify.responseBody || {}).board_id;
|
|
268
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
217
269
|
case 1:
|
|
218
|
-
data =
|
|
270
|
+
data = _a.sent();
|
|
219
271
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
220
272
|
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
221
273
|
}
|
|
222
274
|
});
|
|
223
275
|
}); });
|
|
224
|
-
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (
|
|
225
|
-
var
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
|
|
237
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
238
|
-
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
239
|
-
case 2:
|
|
240
|
-
_b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
241
|
-
individualData = individualRes;
|
|
242
|
-
boardData = boardRes;
|
|
243
|
-
_f.label = 3;
|
|
244
|
-
case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData })];
|
|
245
|
-
}
|
|
246
|
-
});
|
|
276
|
+
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
277
|
+
var data;
|
|
278
|
+
var _a, _b;
|
|
279
|
+
return __generator(this, function (_c) {
|
|
280
|
+
switch (_c.label) {
|
|
281
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
282
|
+
case 1:
|
|
283
|
+
data = _c.sent();
|
|
284
|
+
return [2, {
|
|
285
|
+
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 })
|
|
286
|
+
}];
|
|
287
|
+
}
|
|
247
288
|
});
|
|
248
|
-
});
|
|
289
|
+
}); });
|
|
249
290
|
export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
|
|
250
291
|
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
251
292
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
252
|
-
var _b, settings, entity, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, data, documentResponse, document, documentBody, documentBody, list;
|
|
293
|
+
var _b, settings, entity, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, data, currencyData, documentResponse, document, documentBody, documentBody, list;
|
|
253
294
|
var _d, _e, _f;
|
|
254
295
|
return __generator(this, function (_g) {
|
|
255
296
|
switch (_g.label) {
|
|
@@ -298,19 +339,22 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
|
|
|
298
339
|
return [4, API.entityService.updateEntity(payload)];
|
|
299
340
|
case 1:
|
|
300
341
|
data = _g.sent();
|
|
342
|
+
return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
|
|
343
|
+
case 2:
|
|
344
|
+
currencyData = _g.sent();
|
|
301
345
|
documentResponse = undefined;
|
|
302
346
|
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.CR);
|
|
303
|
-
if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3,
|
|
304
|
-
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3,
|
|
347
|
+
if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3, 8];
|
|
348
|
+
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 4];
|
|
305
349
|
documentBody = {
|
|
306
350
|
id: document.id,
|
|
307
351
|
images: certificateId
|
|
308
352
|
};
|
|
309
353
|
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
310
|
-
case 2:
|
|
311
|
-
documentResponse = _g.sent();
|
|
312
|
-
return [3, 5];
|
|
313
354
|
case 3:
|
|
355
|
+
documentResponse = _g.sent();
|
|
356
|
+
return [3, 6];
|
|
357
|
+
case 4:
|
|
314
358
|
documentBody = {
|
|
315
359
|
entity_id: id || '',
|
|
316
360
|
documents: [
|
|
@@ -321,21 +365,21 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
|
|
|
321
365
|
]
|
|
322
366
|
};
|
|
323
367
|
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
324
|
-
case
|
|
368
|
+
case 5:
|
|
325
369
|
documentResponse = _g.sent();
|
|
326
|
-
_g.label =
|
|
327
|
-
case
|
|
328
|
-
case
|
|
370
|
+
_g.label = 6;
|
|
371
|
+
case 6: return [4, API.entityService.retrieveEntity(id)];
|
|
372
|
+
case 7:
|
|
329
373
|
data = _g.sent();
|
|
330
374
|
data.documentData = documentResponse;
|
|
331
|
-
_g.label =
|
|
332
|
-
case
|
|
333
|
-
case
|
|
375
|
+
_g.label = 8;
|
|
376
|
+
case 8: return [4, API.dataService.getActivitiesIsIc()];
|
|
377
|
+
case 9:
|
|
334
378
|
list = (_g.sent()).list;
|
|
335
379
|
data.activityList = list;
|
|
336
380
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
337
381
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
338
|
-
return [2, { data: data, formData: originalFormData }];
|
|
382
|
+
return [2, { data: data, formData: originalFormData, currencyData: currencyData }];
|
|
339
383
|
}
|
|
340
384
|
});
|
|
341
385
|
});
|
|
@@ -394,40 +438,39 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
|
|
|
394
438
|
});
|
|
395
439
|
});
|
|
396
440
|
export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
397
|
-
var _a, settings, entity, _b,
|
|
398
|
-
var _e, _f, _g, _h, _j, _k, _l
|
|
399
|
-
return __generator(this, function (
|
|
400
|
-
switch (
|
|
441
|
+
var _a, settings, entity, _b, id, infoId, _c, showBoard, mode, payload, data, boardInfoData;
|
|
442
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
443
|
+
return __generator(this, function (_m) {
|
|
444
|
+
switch (_m.label) {
|
|
401
445
|
case 0:
|
|
402
446
|
_a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
|
|
403
|
-
_b = entity.data.verify.responseBody || {},
|
|
447
|
+
_b = entity.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
|
|
404
448
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
405
|
-
if (!
|
|
449
|
+
if (!id)
|
|
406
450
|
return [2];
|
|
407
451
|
payload = {
|
|
408
452
|
lang: settings.data.language,
|
|
409
453
|
step_name: ENTITY_STEP_NAMES.ENTITY_SUCCESS,
|
|
410
|
-
id:
|
|
454
|
+
id: id
|
|
411
455
|
};
|
|
412
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
456
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
413
457
|
case 1:
|
|
414
|
-
data =
|
|
458
|
+
data = _m.sent();
|
|
415
459
|
if (!showBoard && mode === 'content') {
|
|
416
|
-
(
|
|
417
|
-
(
|
|
418
|
-
return [2, {
|
|
460
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
461
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
|
|
462
|
+
return [2, { response: __assign({}, data), formData: params }];
|
|
419
463
|
}
|
|
420
|
-
|
|
421
|
-
return [4, Promise.all([
|
|
422
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
423
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
424
|
-
])];
|
|
464
|
+
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
425
465
|
case 2:
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
466
|
+
boardInfoData = _m.sent();
|
|
467
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
468
|
+
case 3:
|
|
469
|
+
_m.sent();
|
|
470
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
471
|
+
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
429
472
|
thunkApi.dispatch(handleNextScreenStep());
|
|
430
|
-
return [2, {
|
|
473
|
+
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] }), formData: params }];
|
|
431
474
|
}
|
|
432
475
|
});
|
|
433
476
|
}); });
|
|
@@ -453,6 +496,7 @@ var initialState = {
|
|
|
453
496
|
uploadingArticle: false,
|
|
454
497
|
data: {
|
|
455
498
|
flowName: FlowsTypes.ENTITY,
|
|
499
|
+
currency: '',
|
|
456
500
|
verify: {
|
|
457
501
|
token: ''
|
|
458
502
|
},
|
|
@@ -507,22 +551,28 @@ export var entitySlice = createSlice({
|
|
|
507
551
|
state.customLoading = true;
|
|
508
552
|
})
|
|
509
553
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
510
|
-
var _a, _b, _c;
|
|
554
|
+
var _a, _b, _c, _d;
|
|
511
555
|
state.error = null;
|
|
512
556
|
state.customLoading = false;
|
|
513
|
-
var
|
|
514
|
-
|
|
557
|
+
var _e = action.payload, data = _e.data, token = _e.token, boardResponse = _e.boardResponse, individualData = _e.individualData;
|
|
558
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
559
|
+
if (description) {
|
|
560
|
+
state.error = description;
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, individualData: individualData });
|
|
515
564
|
state.data.verify.token = token;
|
|
565
|
+
var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
|
|
516
566
|
if (entity) {
|
|
517
|
-
var
|
|
567
|
+
var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
|
|
518
568
|
var legalName = legal_name;
|
|
519
569
|
var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
|
|
520
|
-
var unifiedNumber = (
|
|
570
|
+
var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
|
|
521
571
|
var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
|
|
522
572
|
var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
|
|
523
|
-
var
|
|
524
|
-
var entityIssueDate = (
|
|
525
|
-
var entityExpiredDate = (
|
|
573
|
+
var _h = capital || {}, paid = _h.paid, shares = _h.shares;
|
|
574
|
+
var entityIssueDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
|
|
575
|
+
var entityExpiredDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.expiry_date;
|
|
526
576
|
var issuingDate = void 0, expiryDate = undefined;
|
|
527
577
|
if (entityIssueDate) {
|
|
528
578
|
var date = new Date(entityIssueDate);
|
|
@@ -582,22 +632,28 @@ export var entitySlice = createSlice({
|
|
|
582
632
|
state.error = null;
|
|
583
633
|
})
|
|
584
634
|
.addCase(verifyEntityLeadOTP.fulfilled, function (state, action) {
|
|
585
|
-
var _a, _b, _c;
|
|
635
|
+
var _a, _b, _c, _d;
|
|
586
636
|
state.loading = false;
|
|
587
637
|
state.error = null;
|
|
588
|
-
var
|
|
638
|
+
var _e = action.payload, data = _e.data, boardResponse = _e.boardResponse, formData = _e.formData, individualData = _e.individualData;
|
|
639
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
640
|
+
if (description) {
|
|
641
|
+
state.error = description;
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
589
644
|
state.data.otpData = formData;
|
|
590
645
|
state.data.otpData.responseBody = data;
|
|
591
|
-
state.data.verify.responseBody = __assign(__assign(__assign({},
|
|
592
|
-
var
|
|
646
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { individualData: individualData });
|
|
647
|
+
var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
|
|
648
|
+
var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
|
|
593
649
|
var legalName = legal_name;
|
|
594
650
|
var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
|
|
595
|
-
var unifiedNumber = (
|
|
651
|
+
var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
|
|
596
652
|
var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
|
|
597
653
|
var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
|
|
598
|
-
var
|
|
599
|
-
var entityIssueDate = (
|
|
600
|
-
var entityExpiredDate = (
|
|
654
|
+
var _h = capital || {}, paid = _h.paid, shares = _h.shares;
|
|
655
|
+
var entityIssueDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
|
|
656
|
+
var entityExpiredDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.expiry_date;
|
|
601
657
|
var issuingDate, expiryDate = undefined;
|
|
602
658
|
if (entityIssueDate) {
|
|
603
659
|
var date = new Date(entityIssueDate);
|
|
@@ -639,10 +695,13 @@ export var entitySlice = createSlice({
|
|
|
639
695
|
state.error = null;
|
|
640
696
|
})
|
|
641
697
|
.addCase(updateEntityName.fulfilled, function (state, action) {
|
|
698
|
+
var _a;
|
|
642
699
|
state.loading = false;
|
|
643
700
|
state.error = null;
|
|
644
|
-
var
|
|
645
|
-
var
|
|
701
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
|
|
702
|
+
var _c = data || {}, activityList = _c.activityList, rest = __rest(_c, ["activityList"]);
|
|
703
|
+
if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
|
|
704
|
+
state.data.currency = currencyData.code.english;
|
|
646
705
|
state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined });
|
|
647
706
|
state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { rest: rest });
|
|
648
707
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: data === null || data === void 0 ? void 0 : data.entity, activityList: activityList });
|
|
@@ -675,7 +734,7 @@ export var entitySlice = createSlice({
|
|
|
675
734
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
676
735
|
state.error = null;
|
|
677
736
|
state.loading = false;
|
|
678
|
-
var data = action.payload || {};
|
|
737
|
+
var data = (action.payload || {}).data;
|
|
679
738
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
680
739
|
})
|
|
681
740
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -689,7 +748,7 @@ export var entitySlice = createSlice({
|
|
|
689
748
|
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
690
749
|
state.error = null;
|
|
691
750
|
state.loading = false;
|
|
692
|
-
var flows =
|
|
751
|
+
var flows = action.payload.flows;
|
|
693
752
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
694
753
|
})
|
|
695
754
|
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
@@ -700,8 +759,18 @@ export var entitySlice = createSlice({
|
|
|
700
759
|
var _a;
|
|
701
760
|
state.loading = false;
|
|
702
761
|
state.error = null;
|
|
703
|
-
var
|
|
704
|
-
|
|
762
|
+
var response = (action.payload || {}).response;
|
|
763
|
+
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
764
|
+
if (description) {
|
|
765
|
+
state.error = description;
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
var flows = response.flows;
|
|
769
|
+
var _b = state.data.verify.responseBody || {}, individuals = _b.individuals, individualData = _b.individualData;
|
|
770
|
+
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
771
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
772
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
773
|
+
}));
|
|
705
774
|
})
|
|
706
775
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
707
776
|
state.loading = true;
|