@tap-payments/auth-jsconnect 2.8.55-beta → 2.8.55-development
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 +1 -0
- package/build/@types/form.d.ts +1 -0
- package/build/@types/redux.d.ts +1 -0
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +12 -4
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +0 -2
- package/build/constants/app.js +0 -2
- package/build/features/app/bank/bankStore.d.ts +13 -18
- package/build/features/app/bank/bankStore.js +184 -165
- package/build/features/app/board/boardStore.js +52 -30
- package/build/features/app/brand/brandStore.d.ts +16 -33
- package/build/features/app/brand/brandStore.js +239 -242
- package/build/features/app/business/businessStore.d.ts +0 -5
- package/build/features/app/business/businessStore.js +76 -87
- package/build/features/app/connectExpress/connectExpressStore.d.ts +15 -6
- package/build/features/app/connectExpress/connectExpressStore.js +110 -52
- package/build/features/app/entity/entityStore.d.ts +20 -36
- package/build/features/app/entity/entityStore.js +196 -246
- package/build/features/app/individual/individualStore.d.ts +22 -38
- package/build/features/app/individual/individualStore.js +263 -266
- package/build/features/app/password/passwordStore.d.ts +40 -23
- package/build/features/app/password/passwordStore.js +226 -233
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +168 -147
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +13 -1
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/bank/Bank.d.ts +1 -0
- package/build/features/bank/Bank.js +7 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
- package/build/features/bank/screens/OperatorError/index.js +2 -0
- 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 +8 -4
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/board/screens/OperatorError/index.d.ts +3 -0
- package/build/features/board/screens/OperatorError/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -4
- package/build/features/brand/Brand.d.ts +1 -0
- package/build/features/brand/Brand.js +7 -4
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +49 -12
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
- 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 +23 -5
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +23 -7
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
- package/build/features/brand/screens/OperatorError/index.js +2 -0
- 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 +9 -4
- package/build/features/business/screens/Activities/Activities.js +12 -3
- package/build/features/business/screens/BusinessType/BusinessType.js +10 -2
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +12 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +6 -3
- package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/business/screens/OperatorError/index.d.ts +3 -0
- package/build/features/business/screens/OperatorError/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
- package/build/features/business/screens/Verify/Verify.js +13 -3
- package/build/features/connect/Connect.js +3 -2
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +9 -2
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +3 -1
- 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 +11 -8
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +2 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +5 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +9 -0
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +90 -0
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +6 -1
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +3 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +10 -0
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
- 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 +3 -1
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
- package/build/features/connectExpress/screens/Mobile/Mobile.js +9 -2
- 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/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +1 -0
- package/build/features/entity/Entity.js +7 -4
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +34 -10
- package/build/features/entity/screens/EntityName/EntityName.js +32 -15
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
- package/build/features/entity/screens/OperatorError/index.js +2 -0
- 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 +67 -7
- package/build/features/individual/Individual.d.ts +1 -0
- package/build/features/individual/Individual.js +7 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +14 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +76 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +3 -2
- package/build/features/individual/screens/IndividualList/Email.js +3 -2
- package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
- package/build/features/individual/screens/IndividualList/UserList.js +13 -9
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +4 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +76 -20
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
- package/build/features/individual/screens/OperatorError/index.js +2 -0
- 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 +1 -0
- package/build/features/password/Password.js +75 -28
- package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/password/screens/OperatorError/index.d.ts +3 -0
- package/build/features/password/screens/OperatorError/index.js +2 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
- 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 +13 -3
- package/build/features/shared/Containers/FeatureContainer.d.ts +1 -0
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +5 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
- package/build/features/signIn/SignIn.js +12 -3
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
- package/build/features/signIn/screens/OperatorError/index.js +2 -0
- package/build/features/tax/Tax.d.ts +1 -0
- package/build/features/tax/Tax.js +7 -4
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
- package/build/features/tax/screens/OperatorError/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/hooks/useVerifyToken.d.ts +5 -2
- package/build/hooks/useVerifyToken.js +10 -5
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +2 -1
- package/build/utils/string.d.ts +5 -2
- package/build/utils/string.js +34 -5
- package/package.json +2 -2
|
@@ -63,14 +63,14 @@ import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../..
|
|
|
63
63
|
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
64
|
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
65
65
|
import moment from 'moment';
|
|
66
|
-
import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency, removeAllCharsFromNumber, retrieveIndividualData } from '../../../utils';
|
|
66
|
+
import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency, removeAllCharsFromNumber, retrieveIndividualData, sendCustomEventToGTM } from '../../../utils';
|
|
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 _e, _f
|
|
72
|
-
return __generator(this, function (
|
|
73
|
-
switch (
|
|
70
|
+
var payload, data, entityData, entityTypes, _b, country_code, config, publicKey, _c, entity_id, boardId, data_1;
|
|
71
|
+
var _d, _e, _f;
|
|
72
|
+
return __generator(this, function (_g) {
|
|
73
|
+
switch (_g.label) {
|
|
74
74
|
case 0:
|
|
75
75
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
76
76
|
notification: {
|
|
@@ -79,76 +79,47 @@ 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 (
|
|
82
|
+
data = (_g.sent()).data;
|
|
83
|
+
entityTypes = undefined;
|
|
84
|
+
if (((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.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
|
+
_b = data || {}, country_code = _b.country_code, config = _b.config;
|
|
89
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
90
|
+
if (country_code)
|
|
91
|
+
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
92
|
+
if (publicKey)
|
|
94
93
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
94
|
+
if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 7];
|
|
95
|
+
_c = data || {}, entity_id = _c.entity_id, boardId = _c.id;
|
|
96
|
+
if (!!entity_id) return [3, 3];
|
|
97
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
100
98
|
case 2:
|
|
101
|
-
|
|
102
|
-
if (!
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
data_1 = _g.sent();
|
|
100
|
+
if (!((_e = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _e === void 0 ? void 0 : _e.id))
|
|
101
|
+
throw new Error('entity_id_missing');
|
|
102
|
+
entityData = data_1;
|
|
103
|
+
return [3, 5];
|
|
104
|
+
case 3: return [4, API.entityService.retrieveEntity(entity_id)];
|
|
107
105
|
case 4:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
|
|
106
|
+
entityData = _g.sent();
|
|
107
|
+
_g.label = 5;
|
|
111
108
|
case 5:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
individualData = individualRes;
|
|
115
|
-
_m.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 = _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
|
-
}
|
|
109
|
+
if (!country_code && ((_f = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _f === void 0 ? void 0 : _f.country))
|
|
110
|
+
thunkApi.dispatch(handleSetCountryByIso2(entityData.entity.country));
|
|
128
111
|
return [4, API.entityService.retrieveEntityType()];
|
|
129
|
-
case
|
|
130
|
-
entityTypes =
|
|
112
|
+
case 6:
|
|
113
|
+
entityTypes = _g.sent();
|
|
131
114
|
if (isInternally)
|
|
132
115
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
|
|
133
116
|
else
|
|
134
117
|
thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
|
|
135
|
-
|
|
136
|
-
case
|
|
118
|
+
_g.label = 7;
|
|
119
|
+
case 7: return [2, {
|
|
137
120
|
data: data,
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
},
|
|
121
|
+
entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
122
|
+
entityTypes: entityTypes,
|
|
152
123
|
token: token
|
|
153
124
|
}];
|
|
154
125
|
}
|
|
@@ -173,130 +144,119 @@ export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thu
|
|
|
173
144
|
});
|
|
174
145
|
}); });
|
|
175
146
|
export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
|
-
var _a, entity, settings, responseBody, payload, data,
|
|
177
|
-
var _e, _f, _g, _h
|
|
178
|
-
return __generator(this, function (
|
|
179
|
-
switch (
|
|
147
|
+
var _a, entity, settings, responseBody, payload, data, _b, entity_id, config, boardId, country_code, entityData, publicKey, countryIso2, data_2, entityTypes;
|
|
148
|
+
var _c, _d, _e, _f, _g, _h;
|
|
149
|
+
return __generator(this, function (_j) {
|
|
150
|
+
switch (_j.label) {
|
|
180
151
|
case 0:
|
|
181
152
|
_a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
|
|
182
153
|
responseBody = entity.data.verify.responseBody;
|
|
183
154
|
payload = {
|
|
184
155
|
data: params.otp,
|
|
185
|
-
service_name: (
|
|
156
|
+
service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
|
|
186
157
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
187
158
|
step_name: ENTITY_STEP_NAMES.PHONE_AUTH,
|
|
188
159
|
encryption_contract: ['data']
|
|
189
160
|
};
|
|
190
161
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
191
162
|
case 1:
|
|
192
|
-
data = (
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
_b = data || {},
|
|
163
|
+
data = (_j.sent()).data;
|
|
164
|
+
if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
165
|
+
throw new Error(data.errors[0].description);
|
|
166
|
+
_b = data || {}, entity_id = _b.entity_id, config = _b.config, boardId = _b.id, country_code = _b.country_code;
|
|
167
|
+
entityData = undefined;
|
|
196
168
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
197
|
-
|
|
169
|
+
countryIso2 = country_code || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
|
|
170
|
+
if (publicKey)
|
|
198
171
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
199
|
-
|
|
200
|
-
if (country_code) {
|
|
201
|
-
countryIso2 = country_code;
|
|
172
|
+
if (countryIso2)
|
|
202
173
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
174
|
+
if (!!entity_id) return [3, 3];
|
|
175
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
206
176
|
case 2:
|
|
207
|
-
|
|
208
|
-
if (!
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
177
|
+
data_2 = _j.sent();
|
|
178
|
+
if (!((_e = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _e === void 0 ? void 0 : _e.id))
|
|
179
|
+
throw new Error('entity_id_missing');
|
|
180
|
+
entityData = data_2;
|
|
181
|
+
return [3, 5];
|
|
182
|
+
case 3: return [4, API.entityService.retrieveEntity(entity_id)];
|
|
213
183
|
case 4:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
|
|
184
|
+
entityData = _j.sent();
|
|
185
|
+
_j.label = 5;
|
|
217
186
|
case 5:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
_o.label = 6;
|
|
222
|
-
case 6:
|
|
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 });
|
|
187
|
+
if (!countryIso2 && ((_f = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _f === void 0 ? void 0 : _f.country))
|
|
188
|
+
thunkApi.dispatch(handleSetCountryByIso2(entityData.entity.country));
|
|
189
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
|
|
235
190
|
return [4, API.entityService.retrieveEntityType()];
|
|
236
|
-
case
|
|
237
|
-
entityTypes =
|
|
191
|
+
case 6:
|
|
192
|
+
entityTypes = _j.sent();
|
|
238
193
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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,
|
|
194
|
+
return [2, {
|
|
195
|
+
data: data,
|
|
196
|
+
entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
253
197
|
entityTypes: entityTypes,
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
formData: params
|
|
257
|
-
}];
|
|
198
|
+
formData: params
|
|
199
|
+
}];
|
|
258
200
|
}
|
|
259
201
|
});
|
|
260
202
|
}); });
|
|
261
203
|
export var retrieveBoardStatus = createAsyncThunk('entity/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
262
|
-
var entity, board_id, data;
|
|
263
|
-
return __generator(this, function (
|
|
264
|
-
switch (
|
|
204
|
+
var entity, _a, board_id, board_info_id, recipient, _b, id, type, data;
|
|
205
|
+
return __generator(this, function (_c) {
|
|
206
|
+
switch (_c.label) {
|
|
265
207
|
case 0:
|
|
266
208
|
entity = thunkApi.getState().entity;
|
|
267
|
-
|
|
268
|
-
|
|
209
|
+
_a = entity.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
|
|
210
|
+
if (!board_id || !board_info_id)
|
|
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
|
+
])];
|
|
269
217
|
case 1:
|
|
270
|
-
data =
|
|
218
|
+
data = (_c.sent())[0];
|
|
271
219
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
272
220
|
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
273
221
|
}
|
|
274
222
|
});
|
|
275
223
|
}); });
|
|
276
|
-
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (
|
|
277
|
-
var
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
224
|
+
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (_a) {
|
|
225
|
+
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
226
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
227
|
+
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
228
|
+
var _c, _d, _e;
|
|
229
|
+
return __generator(this, function (_f) {
|
|
230
|
+
switch (_f.label) {
|
|
231
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
232
|
+
case 1:
|
|
233
|
+
data = _f.sent();
|
|
234
|
+
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
235
|
+
boardData = data;
|
|
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
|
+
});
|
|
288
247
|
});
|
|
289
|
-
});
|
|
248
|
+
});
|
|
290
249
|
export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
|
|
291
|
-
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
250
|
+
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
292
251
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
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,
|
|
294
|
-
var _d, _e
|
|
295
|
-
return __generator(this, function (
|
|
296
|
-
switch (
|
|
252
|
+
var _b, settings, entity, entityRes, _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, entityData, documentData, activityList, entity_1, documentResponse, document, documentBody, documentBody, entity_2, list;
|
|
253
|
+
var _d, _e;
|
|
254
|
+
return __generator(this, function (_f) {
|
|
255
|
+
switch (_f.label) {
|
|
297
256
|
case 0:
|
|
298
257
|
_b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
|
|
299
|
-
|
|
258
|
+
entityRes = (entity.data.verify.responseBody || {}).entity;
|
|
259
|
+
_c = entityRes || {}, id = _c.id, data_status = _c.data_status, data_verification = _c.data_verification, documents = _c.documents;
|
|
300
260
|
issuingDate = formData.issuingDate, expiryDate = formData.expiryDate, licenseType = formData.licenseType, licenseNumber = formData.licenseNumber, articleId = formData.articleId, unifiedNumber = formData.unifiedNumber, legalName = formData.legalName, certificateId = formData.certificateId, entityType = formData.entityType;
|
|
301
261
|
issueDate = issuingDate && new Date(issuingDate).getTime();
|
|
302
262
|
expDate = expiryDate && new Date(expiryDate).getTime();
|
|
@@ -336,12 +296,14 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
|
|
|
336
296
|
'license.additional_info.unified_number',
|
|
337
297
|
'type'
|
|
338
298
|
] });
|
|
299
|
+
entityData = entityRes, activityList = undefined;
|
|
300
|
+
if (!isDirty) return [3, 2];
|
|
339
301
|
return [4, API.entityService.updateEntity(payload)];
|
|
340
302
|
case 1:
|
|
341
|
-
|
|
342
|
-
|
|
303
|
+
entity_1 = (_f.sent()).entity;
|
|
304
|
+
entityData = entity_1;
|
|
305
|
+
_f.label = 2;
|
|
343
306
|
case 2:
|
|
344
|
-
currencyData = _g.sent();
|
|
345
307
|
documentResponse = undefined;
|
|
346
308
|
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.CR);
|
|
347
309
|
if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3, 8];
|
|
@@ -352,7 +314,7 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
|
|
|
352
314
|
};
|
|
353
315
|
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
354
316
|
case 3:
|
|
355
|
-
documentResponse =
|
|
317
|
+
documentResponse = _f.sent();
|
|
356
318
|
return [3, 6];
|
|
357
319
|
case 4:
|
|
358
320
|
documentBody = {
|
|
@@ -366,44 +328,47 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
|
|
|
366
328
|
};
|
|
367
329
|
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
368
330
|
case 5:
|
|
369
|
-
documentResponse =
|
|
370
|
-
|
|
331
|
+
documentResponse = _f.sent();
|
|
332
|
+
_f.label = 6;
|
|
371
333
|
case 6: return [4, API.entityService.retrieveEntity(id)];
|
|
372
334
|
case 7:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
335
|
+
entity_2 = (_f.sent()).entity;
|
|
336
|
+
entityData = entity_2;
|
|
337
|
+
documentData = documentResponse;
|
|
338
|
+
_f.label = 8;
|
|
376
339
|
case 8: return [4, API.dataService.getActivitiesIsIc()];
|
|
377
340
|
case 9:
|
|
378
|
-
list = (
|
|
379
|
-
|
|
341
|
+
list = (_f.sent()).list;
|
|
342
|
+
activityList = list;
|
|
380
343
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
381
|
-
(
|
|
382
|
-
return [2, { data:
|
|
344
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, id);
|
|
345
|
+
return [2, { data: { entity: entityData, documentData: documentData, activityList: activityList }, formData: originalFormData }];
|
|
383
346
|
}
|
|
384
347
|
});
|
|
385
348
|
});
|
|
386
349
|
});
|
|
387
350
|
export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', function (_a, thunkApi) {
|
|
388
|
-
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
351
|
+
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
389
352
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
390
|
-
var _b, settings, entity, _c, id, data_status, entityActivities, isCapitalPaidNonEditable, isCapitalShareCountNonEditable, isCapitalShareValueNonEditable, isActivitiesNonEditable, capitalShareCount, capitalShareValue, activities, capitalPaid, hasCapitalShares, isCapitalNonEditable, removedActivities, payload_1, activityIds, payload,
|
|
391
|
-
var _d, _e
|
|
392
|
-
return __generator(this, function (
|
|
393
|
-
switch (
|
|
353
|
+
var _b, settings, entity, entityRes, _c, id, data_status, entityActivities, isCapitalPaidNonEditable, isCapitalShareCountNonEditable, isCapitalShareValueNonEditable, isActivitiesNonEditable, capitalShareCount, capitalShareValue, activities, capitalPaid, entityData, hasCapitalShares, isCapitalNonEditable, removedActivities, payload_1, activityIds, payload, entity_3;
|
|
354
|
+
var _d, _e;
|
|
355
|
+
return __generator(this, function (_f) {
|
|
356
|
+
switch (_f.label) {
|
|
394
357
|
case 0:
|
|
395
358
|
_b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
|
|
396
|
-
|
|
359
|
+
entityRes = (entity.data.verify.responseBody || {}).entity;
|
|
360
|
+
_c = entityRes || {}, id = _c.id, data_status = _c.data_status, entityActivities = _c.activities;
|
|
397
361
|
isCapitalPaidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'paid');
|
|
398
362
|
isCapitalShareCountNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'shares.count');
|
|
399
363
|
isCapitalShareValueNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'shares.value');
|
|
400
364
|
isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
|
|
401
365
|
capitalShareCount = formData.capitalShareCount, capitalShareValue = formData.capitalShareValue, activities = formData.activities, capitalPaid = formData.capitalPaid;
|
|
366
|
+
entityData = entityRes;
|
|
402
367
|
hasCapitalShares = capitalShareCount || capitalShareValue;
|
|
403
368
|
isCapitalNonEditable = (isCapitalPaidNonEditable && isCapitalShareCountNonEditable && isCapitalShareValueNonEditable) || (!capitalPaid && !hasCapitalShares);
|
|
404
369
|
removedActivities = (activities === null || activities === void 0 ? void 0 : activities.length) > 0 &&
|
|
405
370
|
(entityActivities || []).filter(function (entityActivity) { return !(activities || []).some(function (activity) { return activity.id === entityActivity.id; }); });
|
|
406
|
-
if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0)) return [3, 2];
|
|
371
|
+
if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0 && isDirty)) return [3, 2];
|
|
407
372
|
payload_1 = {
|
|
408
373
|
id: id,
|
|
409
374
|
activities: removedActivities.map(function (a) { return ({
|
|
@@ -412,8 +377,8 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
|
|
|
412
377
|
};
|
|
413
378
|
return [4, API.entityService.removeEntityActivities(payload_1)];
|
|
414
379
|
case 1:
|
|
415
|
-
|
|
416
|
-
|
|
380
|
+
_f.sent();
|
|
381
|
+
_f.label = 2;
|
|
417
382
|
case 2:
|
|
418
383
|
activityIds = (activities || []).map(function (_a) {
|
|
419
384
|
var id = _a.id;
|
|
@@ -427,50 +392,61 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
|
|
|
427
392
|
}
|
|
428
393
|
}))
|
|
429
394
|
}));
|
|
395
|
+
if (!isDirty) return [3, 4];
|
|
430
396
|
return [4, API.entityService.updateEntity(payload)];
|
|
431
397
|
case 3:
|
|
432
|
-
|
|
398
|
+
entity_3 = (_f.sent()).entity;
|
|
399
|
+
entityData = entity_3;
|
|
400
|
+
_f.label = 4;
|
|
401
|
+
case 4:
|
|
433
402
|
thunkApi.dispatch(handleNextScreenStep());
|
|
434
|
-
(
|
|
435
|
-
return [2, { data:
|
|
403
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, id);
|
|
404
|
+
return [2, { data: entityData, formData: originalFormData }];
|
|
436
405
|
}
|
|
437
406
|
});
|
|
438
407
|
});
|
|
439
408
|
});
|
|
440
409
|
export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
441
|
-
var _a, settings, entity, _b,
|
|
442
|
-
var
|
|
443
|
-
return __generator(this, function (
|
|
444
|
-
switch (
|
|
410
|
+
var _a, settings, entity, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
|
|
411
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
412
|
+
return __generator(this, function (_p) {
|
|
413
|
+
switch (_p.label) {
|
|
445
414
|
case 0:
|
|
446
415
|
_a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
|
|
447
|
-
_b = entity.data.verify.responseBody || {},
|
|
416
|
+
_b = entity.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
|
|
448
417
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
449
|
-
if (!
|
|
418
|
+
if (!board_id)
|
|
450
419
|
return [2];
|
|
451
420
|
payload = {
|
|
452
421
|
lang: settings.data.language,
|
|
453
422
|
step_name: ENTITY_STEP_NAMES.ENTITY_SUCCESS,
|
|
454
|
-
id:
|
|
423
|
+
id: board_id
|
|
455
424
|
};
|
|
456
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
425
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
|
|
457
426
|
case 1:
|
|
458
|
-
data =
|
|
427
|
+
data = _p.sent();
|
|
428
|
+
sendCustomEventToGTM({
|
|
429
|
+
event: 'Send Event',
|
|
430
|
+
event_category: 'Board Flows - Entity',
|
|
431
|
+
event_action: 'Entity Update Success Page',
|
|
432
|
+
event_label: settings.data.businessCountry.iso2
|
|
433
|
+
});
|
|
459
434
|
if (!showBoard && mode === 'content') {
|
|
460
|
-
(
|
|
461
|
-
(
|
|
462
|
-
return [2, {
|
|
435
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
436
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
|
|
437
|
+
return [2, { data: data }];
|
|
463
438
|
}
|
|
464
|
-
|
|
439
|
+
_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;
|
|
440
|
+
return [4, Promise.all([
|
|
441
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
442
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
443
|
+
])];
|
|
465
444
|
case 2:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
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 });
|
|
445
|
+
boardInfoStatusData = (_p.sent())[0];
|
|
446
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
|
|
447
|
+
(_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
|
|
472
448
|
thunkApi.dispatch(handleNextScreenStep());
|
|
473
|
-
return [2, {
|
|
449
|
+
return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
|
|
474
450
|
}
|
|
475
451
|
});
|
|
476
452
|
}); });
|
|
@@ -496,7 +472,6 @@ var initialState = {
|
|
|
496
472
|
uploadingArticle: false,
|
|
497
473
|
data: {
|
|
498
474
|
flowName: FlowsTypes.ENTITY,
|
|
499
|
-
currency: '',
|
|
500
475
|
verify: {
|
|
501
476
|
token: ''
|
|
502
477
|
},
|
|
@@ -551,28 +526,22 @@ export var entitySlice = createSlice({
|
|
|
551
526
|
state.customLoading = true;
|
|
552
527
|
})
|
|
553
528
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
554
|
-
var _a, _b, _c
|
|
529
|
+
var _a, _b, _c;
|
|
555
530
|
state.error = null;
|
|
556
531
|
state.customLoading = false;
|
|
557
|
-
var
|
|
558
|
-
|
|
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 });
|
|
532
|
+
var _d = action.payload, data = _d.data, token = _d.token, entity = _d.entityData, entityTypes = _d.entityTypes;
|
|
533
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes, board_id: data.id });
|
|
564
534
|
state.data.verify.token = token;
|
|
565
|
-
var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
|
|
566
535
|
if (entity) {
|
|
567
|
-
var
|
|
536
|
+
var _e = entity || {}, license = _e.license, type = _e.type, capital = _e.capital, activities = _e.activities, legal_name = _e.legal_name;
|
|
568
537
|
var legalName = legal_name;
|
|
569
538
|
var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
|
|
570
|
-
var unifiedNumber = (
|
|
539
|
+
var unifiedNumber = (_a = license === null || license === void 0 ? void 0 : license.additional_info) === null || _a === void 0 ? void 0 : _a.unified_number;
|
|
571
540
|
var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
|
|
572
541
|
var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
|
|
573
|
-
var
|
|
574
|
-
var entityIssueDate = (
|
|
575
|
-
var entityExpiredDate = (
|
|
542
|
+
var _f = capital || {}, paid = _f.paid, shares = _f.shares;
|
|
543
|
+
var entityIssueDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
|
|
544
|
+
var entityExpiredDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.expiry_date;
|
|
576
545
|
var issuingDate = void 0, expiryDate = undefined;
|
|
577
546
|
if (entityIssueDate) {
|
|
578
547
|
var date = new Date(entityIssueDate);
|
|
@@ -632,28 +601,22 @@ export var entitySlice = createSlice({
|
|
|
632
601
|
state.error = null;
|
|
633
602
|
})
|
|
634
603
|
.addCase(verifyEntityLeadOTP.fulfilled, function (state, action) {
|
|
635
|
-
var _a, _b, _c
|
|
604
|
+
var _a, _b, _c;
|
|
636
605
|
state.loading = false;
|
|
637
606
|
state.error = null;
|
|
638
|
-
var
|
|
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
|
-
}
|
|
607
|
+
var _d = action.payload, data = _d.data, entity = _d.entityData, entityTypes = _d.entityTypes, formData = _d.formData;
|
|
644
608
|
state.data.otpData = formData;
|
|
645
609
|
state.data.otpData.responseBody = data;
|
|
646
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody),
|
|
647
|
-
var
|
|
648
|
-
var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
|
|
610
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes });
|
|
611
|
+
var _e = entity || {}, license = _e.license, type = _e.type, capital = _e.capital, activities = _e.activities, legal_name = _e.legal_name;
|
|
649
612
|
var legalName = legal_name;
|
|
650
613
|
var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
|
|
651
|
-
var unifiedNumber = (
|
|
614
|
+
var unifiedNumber = (_a = license === null || license === void 0 ? void 0 : license.additional_info) === null || _a === void 0 ? void 0 : _a.unified_number;
|
|
652
615
|
var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
|
|
653
616
|
var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
|
|
654
|
-
var
|
|
655
|
-
var entityIssueDate = (
|
|
656
|
-
var entityExpiredDate = (
|
|
617
|
+
var _f = capital || {}, paid = _f.paid, shares = _f.shares;
|
|
618
|
+
var entityIssueDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
|
|
619
|
+
var entityExpiredDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.expiry_date;
|
|
657
620
|
var issuingDate, expiryDate = undefined;
|
|
658
621
|
if (entityIssueDate) {
|
|
659
622
|
var date = new Date(entityIssueDate);
|
|
@@ -695,18 +658,15 @@ export var entitySlice = createSlice({
|
|
|
695
658
|
state.error = null;
|
|
696
659
|
})
|
|
697
660
|
.addCase(updateEntityName.fulfilled, function (state, action) {
|
|
698
|
-
var _a;
|
|
699
661
|
state.loading = false;
|
|
700
662
|
state.error = null;
|
|
701
|
-
var
|
|
702
|
-
var
|
|
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;
|
|
663
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
664
|
+
var _b = data || {}, entity = _b.entity, activityList = _b.activityList, rest = __rest(_b, ["entity", "activityList"]);
|
|
705
665
|
state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined });
|
|
706
666
|
state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { rest: rest });
|
|
707
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity:
|
|
708
|
-
if (
|
|
709
|
-
state.data.entityCapitalData = __assign(__assign({}, state.data.entityCapitalData), { activities:
|
|
667
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity, activityList: activityList });
|
|
668
|
+
if (entity === null || entity === void 0 ? void 0 : entity.activities)
|
|
669
|
+
state.data.entityCapitalData = __assign(__assign({}, state.data.entityCapitalData), { activities: entity === null || entity === void 0 ? void 0 : entity.activities });
|
|
710
670
|
})
|
|
711
671
|
.addCase(updateEntityName.rejected, function (state, action) {
|
|
712
672
|
state.loading = false;
|
|
@@ -734,7 +694,7 @@ export var entitySlice = createSlice({
|
|
|
734
694
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
735
695
|
state.error = null;
|
|
736
696
|
state.loading = false;
|
|
737
|
-
var data =
|
|
697
|
+
var data = action.payload || {};
|
|
738
698
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
739
699
|
})
|
|
740
700
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -748,7 +708,7 @@ export var entitySlice = createSlice({
|
|
|
748
708
|
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
749
709
|
state.error = null;
|
|
750
710
|
state.loading = false;
|
|
751
|
-
var flows = action.payload.flows;
|
|
711
|
+
var flows = (action.payload || {}).flows;
|
|
752
712
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
753
713
|
})
|
|
754
714
|
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
@@ -759,18 +719,8 @@ export var entitySlice = createSlice({
|
|
|
759
719
|
var _a;
|
|
760
720
|
state.loading = false;
|
|
761
721
|
state.error = null;
|
|
762
|
-
var
|
|
763
|
-
|
|
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
|
-
}));
|
|
722
|
+
var _b = action.payload || {}, flows = _b.flows, data = _b.data;
|
|
723
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
|
|
774
724
|
})
|
|
775
725
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
776
726
|
state.loading = true;
|