@tap-payments/auth-jsconnect 2.8.58-development → 2.8.59-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/app.d.ts +0 -1
- package/build/@types/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- 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 +2 -0
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +165 -184
- 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 +242 -239
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +87 -76
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
- package/build/features/app/connectExpress/connectExpressStore.js +52 -110
- package/build/features/app/entity/entityStore.d.ts +36 -20
- package/build/features/app/entity/entityStore.js +246 -196
- package/build/features/app/individual/individualStore.d.ts +38 -22
- package/build/features/app/individual/individualStore.js +266 -263
- 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 -168
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +26 -4
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
- 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 +5 -18
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- 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/ActivitiesList.d.ts +35 -8
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +18 -5
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +7 -2
- 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 +5 -23
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- 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 +3 -12
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +1 -1
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +26 -4
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +36 -9
- package/build/features/business/screens/Customers/Customers.js +3 -12
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +18 -5
- package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -13
- package/build/features/business/screens/Verify/Verify.js +3 -13
- package/build/features/connect/Connect.js +2 -3
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
- 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 +8 -11
- 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 +1 -2
- 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/BusinessCountry/BusinessCountry.js +1 -7
- 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/CollectBusinessInfo/LicenseType.d.ts +26 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +7 -2
- 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/CreateAccountLoader/CreateAccountLoader.js +24 -14
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
- package/build/features/connectExpress/screens/NID/NID.js +1 -1
- package/build/features/connectExpress/screens/NID/TAC.d.ts +7 -2
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -2
- 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 +10 -34
- package/build/features/entity/screens/EntityName/EntityName.js +15 -32
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +35 -8
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +7 -67
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +26 -4
- 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.d.ts +2 -2
- package/build/features/individual/screens/IndividualList/IndividualList.js +5 -18
- 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/Gender.d.ts +26 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- 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 +1 -1
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Address/CountryList.d.ts +23 -7
- package/build/features/shared/Address/InputSelect.d.ts +23 -7
- package/build/features/shared/Button/FlowsButtons.js +3 -13
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/Input/Input.d.ts +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
- package/build/features/shared/UploadFile/FileUpload.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -2
- 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 +1 -1
- 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 -9
- 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/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/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 -14
- 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 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -71,113 +71,120 @@ import API from '../../../api';
|
|
|
71
71
|
import { FlowsTypes, IndividualGender, DocumentPurpose } from '../../../@types';
|
|
72
72
|
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
73
73
|
import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES, MONTHLY_INCOME_LIST } from '../../../constants';
|
|
74
|
-
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType, isOtherThanKWOrSA
|
|
74
|
+
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType, isOtherThanKWOrSA } from '../../../utils';
|
|
75
75
|
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
76
76
|
var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
|
|
77
77
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
-
var
|
|
79
|
-
var _e, _f, _g, _h;
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
78
|
+
var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, publicKey, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry, individuals, _c, is_authorized, data_state;
|
|
79
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
80
|
+
return __generator(this, function (_m) {
|
|
81
|
+
switch (_m.label) {
|
|
82
82
|
case 0:
|
|
83
|
-
settings = thunkApi.getState().settings;
|
|
84
83
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
85
84
|
notification: {
|
|
86
85
|
sms: false
|
|
87
86
|
}
|
|
88
87
|
}));
|
|
88
|
+
settings = thunkApi.getState().settings;
|
|
89
89
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
90
90
|
case 1:
|
|
91
|
-
data = (
|
|
92
|
-
|
|
91
|
+
data = (_m.sent()).data;
|
|
92
|
+
boardInfoStatus = undefined;
|
|
93
93
|
countries = settings.data.countries;
|
|
94
|
-
if (((
|
|
94
|
+
if (((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
95
95
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
96
96
|
if (isInternally)
|
|
97
97
|
data.step_name = INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (publicKey)
|
|
98
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
99
|
+
countryCode = data === null || data === void 0 ? void 0 : data.country_code;
|
|
100
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
101
|
+
}
|
|
102
|
+
publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
|
|
103
|
+
if (publicKey) {
|
|
104
104
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
105
|
-
|
|
106
|
-
return [
|
|
105
|
+
}
|
|
106
|
+
if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
|
|
107
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
|
|
108
|
+
return [3, 16];
|
|
107
109
|
case 2:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 15];
|
|
111
|
+
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
112
|
+
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
113
|
+
if (!(board_id && board_info_id)) return [3, 5];
|
|
114
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
113
115
|
case 3:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
boardInfoData = _m.sent();
|
|
117
|
+
notification = (boardInfoData || {}).notification;
|
|
118
|
+
_b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
|
|
119
|
+
if (!(id && type)) return [3, 5];
|
|
120
|
+
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
117
121
|
case 4:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (!!((_g = data === null || data === void 0 ? void 0 : data.recipient) === null || _g === void 0 ? void 0 : _g.id)) return [3, 6];
|
|
122
|
-
if (!(board_id && board_info_id)) return [3, 6];
|
|
123
|
-
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
122
|
+
data_1 = (_m.sent()).data;
|
|
123
|
+
individualData = data_1 || {};
|
|
124
|
+
_m.label = 5;
|
|
124
125
|
case 5:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (!(recipientData === null || recipientData === void 0 ? void 0 : recipientData.id))
|
|
128
|
-
throw new Error('individual_id_missing');
|
|
129
|
-
_j.label = 6;
|
|
126
|
+
if (!board_id) return [3, 7];
|
|
127
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
130
128
|
case 6:
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
boardData = _m.sent();
|
|
130
|
+
_m.label = 7;
|
|
133
131
|
case 7:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
if (!countryCode && ((_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country)) {
|
|
133
|
+
countryCode = boardData.entity.country;
|
|
134
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
135
|
+
}
|
|
136
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
|
|
137
|
+
if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 9];
|
|
138
|
+
return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id))];
|
|
138
139
|
case 8:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
case 9:
|
|
142
|
-
userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === id_1; });
|
|
143
|
-
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
144
|
-
return [3, 16];
|
|
140
|
+
_m.sent();
|
|
141
|
+
_m.label = 9;
|
|
142
|
+
case 9: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
145
143
|
case 10:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return [
|
|
144
|
+
boardInfoStatus = _m.sent();
|
|
145
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
146
|
+
return [3, 14];
|
|
149
147
|
case 11:
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
|
|
149
|
+
if (!birthCountry) return [3, 13];
|
|
150
|
+
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
152
151
|
case 12:
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
_m.sent();
|
|
153
|
+
_m.label = 13;
|
|
155
154
|
case 13:
|
|
156
|
-
birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
|
|
157
|
-
if (!birthCountry) return [3, 15];
|
|
158
|
-
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
159
|
-
case 14:
|
|
160
|
-
_j.sent();
|
|
161
|
-
_j.label = 15;
|
|
162
|
-
case 15:
|
|
163
155
|
if (isInternally)
|
|
164
156
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
165
157
|
else
|
|
166
158
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
167
|
-
|
|
168
|
-
case
|
|
169
|
-
case
|
|
159
|
+
_m.label = 14;
|
|
160
|
+
case 14: return [3, 16];
|
|
161
|
+
case 15:
|
|
170
162
|
if (isUpdatePhoneInfo) {
|
|
171
163
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
|
|
172
164
|
}
|
|
173
|
-
|
|
174
|
-
case
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
165
|
+
_m.label = 16;
|
|
166
|
+
case 16:
|
|
167
|
+
individuals = (boardData || {}).individuals;
|
|
168
|
+
_c = individualData || {}, is_authorized = _c.is_authorized, data_state = _c.data_state;
|
|
169
|
+
return [2, {
|
|
170
|
+
data: data,
|
|
171
|
+
boardResponse: {
|
|
172
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
173
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
174
|
+
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
175
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
176
|
+
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
177
|
+
name: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.names,
|
|
178
|
+
contact: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.contact,
|
|
179
|
+
individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
|
|
180
|
+
countries: countries,
|
|
181
|
+
countryCode: countryCode,
|
|
182
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
183
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
184
|
+
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
185
|
+
},
|
|
186
|
+
token: token
|
|
187
|
+
}];
|
|
181
188
|
}
|
|
182
189
|
});
|
|
183
190
|
});
|
|
@@ -390,141 +397,133 @@ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', fun
|
|
|
390
397
|
});
|
|
391
398
|
}); });
|
|
392
399
|
export var retrieveBoardStatus = createAsyncThunk('individual/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
393
|
-
var individual,
|
|
394
|
-
return __generator(this, function (
|
|
395
|
-
switch (
|
|
400
|
+
var individual, board_id, data;
|
|
401
|
+
return __generator(this, function (_a) {
|
|
402
|
+
switch (_a.label) {
|
|
396
403
|
case 0:
|
|
397
404
|
individual = thunkApi.getState().individual;
|
|
398
|
-
|
|
399
|
-
if (!board_id || !board_info_id)
|
|
400
|
-
throw new Error('Internal server error');
|
|
405
|
+
board_id = (individual.data.verify.responseBody || {}).board_id;
|
|
401
406
|
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
402
407
|
case 1:
|
|
403
|
-
data =
|
|
404
|
-
return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id })).unwrap()];
|
|
405
|
-
case 2:
|
|
406
|
-
_b.sent();
|
|
408
|
+
data = _a.sent();
|
|
407
409
|
thunkApi.dispatch(handlePrevScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
408
410
|
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
409
411
|
}
|
|
410
412
|
});
|
|
411
413
|
}); });
|
|
412
|
-
export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (
|
|
413
|
-
var
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
_c = _g.sent(), user = _c.user, data = __rest(_c, ["user"]);
|
|
425
|
-
if (!((individualData === null || individualData === void 0 ? void 0 : individualData.id) === (user === null || user === void 0 ? void 0 : user.id))) return [3, 2];
|
|
426
|
-
individualData = user;
|
|
427
|
-
return [3, 4];
|
|
428
|
-
case 2:
|
|
429
|
-
if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && id && type)) return [3, 4];
|
|
430
|
-
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: settings.data.businessCountry.iso2 })).unwrap()];
|
|
431
|
-
case 3:
|
|
432
|
-
data_3 = (_g.sent()).data;
|
|
433
|
-
individualData = data_3;
|
|
434
|
-
_g.label = 4;
|
|
435
|
-
case 4:
|
|
436
|
-
data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && (data === null || data === void 0 ? void 0 : data.individuals) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
|
|
437
|
-
return [2, {
|
|
438
|
-
data: __assign(__assign(__assign(__assign({}, data), { 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: (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_f = data === null || data === void 0 ? void 0 : data.user) === null || _f === void 0 ? void 0 : _f.contact }), (data_state && {
|
|
439
|
-
individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
|
|
440
|
-
})), { board_status: data === null || data === void 0 ? void 0 : data.status })
|
|
441
|
-
}];
|
|
442
|
-
}
|
|
443
|
-
});
|
|
414
|
+
export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
415
|
+
var _a, user, data;
|
|
416
|
+
var _b, _c;
|
|
417
|
+
return __generator(this, function (_d) {
|
|
418
|
+
switch (_d.label) {
|
|
419
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
420
|
+
case 1:
|
|
421
|
+
_a = _d.sent(), user = _a.user, data = __rest(_a, ["user"]);
|
|
422
|
+
return [2, {
|
|
423
|
+
data: __assign(__assign({}, data), { 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: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.contact, board_status: data === null || data === void 0 ? void 0 : data.status })
|
|
424
|
+
}];
|
|
425
|
+
}
|
|
444
426
|
});
|
|
445
|
-
});
|
|
427
|
+
}); });
|
|
446
428
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
447
|
-
var _a, individual, settings, responseBody,
|
|
448
|
-
var
|
|
449
|
-
return __generator(this, function (
|
|
450
|
-
switch (
|
|
429
|
+
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, publicKey, notification, _c, id, type, data_3, birthCountry, individuals, _d, is_authorized, data_state;
|
|
430
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
431
|
+
return __generator(this, function (_r) {
|
|
432
|
+
switch (_r.label) {
|
|
451
433
|
case 0:
|
|
452
434
|
_a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
|
|
453
435
|
responseBody = individual.data.verify.responseBody;
|
|
436
|
+
_b = responseBody || {}, board_id = _b.board_id, board_info_id = _b.board_info_id;
|
|
454
437
|
countries = settings.data.countries;
|
|
455
438
|
payload = {
|
|
456
439
|
data: params.otp,
|
|
457
|
-
service_name: (
|
|
440
|
+
service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
|
|
458
441
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
459
442
|
step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
|
|
460
443
|
encryption_contract: ['data']
|
|
461
444
|
};
|
|
462
445
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
463
446
|
case 1:
|
|
464
|
-
data = (
|
|
465
|
-
|
|
466
|
-
if ((
|
|
447
|
+
data = (_r.sent()).data;
|
|
448
|
+
countryCode = undefined;
|
|
449
|
+
if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
467
450
|
throw new Error(data.errors[0].description);
|
|
468
|
-
publicKey = (
|
|
469
|
-
|
|
470
|
-
if (publicKey)
|
|
451
|
+
publicKey = (_g = data === null || data === void 0 ? void 0 : data.config) === null || _g === void 0 ? void 0 : _g.public_key;
|
|
452
|
+
if (publicKey) {
|
|
471
453
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
if (!
|
|
478
|
-
return [4, API.boardService.
|
|
454
|
+
}
|
|
455
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
456
|
+
countryCode = data.country_code;
|
|
457
|
+
thunkApi.dispatch(handleSetCountryByIso2(data.country_code));
|
|
458
|
+
}
|
|
459
|
+
if (!board_id) return [3, 3];
|
|
460
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
479
461
|
case 2:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
if (!(recipientData === null || recipientData === void 0 ? void 0 : recipientData.id))
|
|
483
|
-
throw new Error('individual_id_missing');
|
|
484
|
-
_m.label = 3;
|
|
462
|
+
boardData = _r.sent();
|
|
463
|
+
_r.label = 3;
|
|
485
464
|
case 3:
|
|
486
|
-
|
|
487
|
-
|
|
465
|
+
if (!countryCode && ((_h = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _h === void 0 ? void 0 : _h.country)) {
|
|
466
|
+
countryCode = boardData.entity.country;
|
|
467
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
468
|
+
}
|
|
469
|
+
if (!(board_id && board_info_id)) return [3, 6];
|
|
470
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
488
471
|
case 4:
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
return [
|
|
472
|
+
boardInfoData = _r.sent();
|
|
473
|
+
notification = (boardInfoData || {}).notification;
|
|
474
|
+
_c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
475
|
+
if (!(id && type)) return [3, 6];
|
|
476
|
+
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
493
477
|
case 5:
|
|
494
|
-
|
|
495
|
-
|
|
478
|
+
data_3 = (_r.sent()).data;
|
|
479
|
+
individualData = data_3 || {};
|
|
480
|
+
_r.label = 6;
|
|
496
481
|
case 6:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
return [3, 13];
|
|
500
|
-
case 7:
|
|
482
|
+
if (countryCode)
|
|
483
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
501
484
|
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
|
|
502
|
-
if (!
|
|
503
|
-
return [4, thunkApi.dispatch(getIndividualList(
|
|
504
|
-
case
|
|
505
|
-
|
|
506
|
-
|
|
485
|
+
if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 8];
|
|
486
|
+
return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id))];
|
|
487
|
+
case 7:
|
|
488
|
+
_r.sent();
|
|
489
|
+
_r.label = 8;
|
|
490
|
+
case 8: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
507
491
|
case 9:
|
|
492
|
+
boardInfoStatus = _r.sent();
|
|
508
493
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
509
494
|
return [3, 13];
|
|
510
495
|
case 10:
|
|
511
|
-
birthCountry = ((
|
|
496
|
+
birthCountry = ((_l = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _l === void 0 ? void 0 : _l.country) || countryCode;
|
|
512
497
|
if (!birthCountry) return [3, 12];
|
|
513
498
|
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
514
499
|
case 11:
|
|
515
|
-
|
|
516
|
-
|
|
500
|
+
_r.sent();
|
|
501
|
+
_r.label = 12;
|
|
517
502
|
case 12:
|
|
518
503
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
519
|
-
|
|
504
|
+
_r.label = 13;
|
|
520
505
|
case 13:
|
|
521
|
-
(
|
|
506
|
+
(_o = (_m = settings.data.appConfig).onStepCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, settings.data.activeScreen.name, { otp: params.otp });
|
|
507
|
+
individuals = (boardData || {}).individuals;
|
|
508
|
+
_d = individualData || {}, is_authorized = _d.is_authorized, data_state = _d.data_state;
|
|
522
509
|
return [2, {
|
|
523
510
|
data: data,
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
511
|
+
boardResponse: {
|
|
512
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
513
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
514
|
+
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
515
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
516
|
+
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
517
|
+
name: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.names,
|
|
518
|
+
contact: (_q = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _q === void 0 ? void 0 : _q.contact,
|
|
519
|
+
individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
|
|
520
|
+
countries: countries,
|
|
521
|
+
countryCode: countryCode,
|
|
522
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
523
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
524
|
+
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
525
|
+
},
|
|
526
|
+
formData: __assign({}, params)
|
|
528
527
|
}];
|
|
529
528
|
}
|
|
530
529
|
});
|
|
@@ -562,20 +561,21 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
|
|
|
562
561
|
});
|
|
563
562
|
});
|
|
564
563
|
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
|
|
565
|
-
var formData = _a.formData, originalFormData = _a.originalFormData
|
|
564
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
566
565
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
567
|
-
var _b, settings, individual, _c,
|
|
566
|
+
var _b, settings, individual, _c, notification, user, entity, id, _d, objects, ids, countryCode, name, email, mobile, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, data, currencyData, _e, isUser, isBuyer, isUserORBuyerType;
|
|
568
567
|
var _f, _g, _h, _j, _k;
|
|
569
568
|
return __generator(this, function (_l) {
|
|
570
569
|
switch (_l.label) {
|
|
571
570
|
case 0:
|
|
572
571
|
_b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
|
|
573
|
-
_c = individual.data.verify.responseBody || {},
|
|
574
|
-
id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : recipient) || {}).id;
|
|
572
|
+
_c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, entity = _c.entity;
|
|
573
|
+
id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
|
|
574
|
+
_d = user || {}, objects = _d.objects, ids = _d.ids;
|
|
575
575
|
countryCode = (originalFormData || {}).countryCode;
|
|
576
576
|
name = formData.name, email = formData.email, mobile = formData.mobile, gender = formData.gender, nid = formData.nid, issuedCountry = formData.issuedCountry, expiryDate = formData.expiryDate, dob = formData.dob, placeOfBirthCountry = formData.placeOfBirthCountry, placeOfBirthCity = formData.placeOfBirthCity, nationality = formData.nationality;
|
|
577
577
|
code = entity === null || entity === void 0 ? void 0 : entity.country;
|
|
578
|
-
|
|
578
|
+
data_status = (user || {}).data_status;
|
|
579
579
|
userName = getUserNameObject(name);
|
|
580
580
|
identification_id_type = nid ? (nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA) : undefined;
|
|
581
581
|
if (isOtherThanKWOrSA(settings.data.businessCountry.iso2)) {
|
|
@@ -598,7 +598,7 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
598
598
|
hasContact = email || mobile;
|
|
599
599
|
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
600
600
|
hasIdentification = nid && (issuedCountry || identification_id_type || expiryDate);
|
|
601
|
-
hasBirth =
|
|
601
|
+
hasBirth = placeOfBirthCity || placeOfBirthCountry;
|
|
602
602
|
nameIsEditable = userName.first && !(isNameENNonEditable && isNameARNonEditable);
|
|
603
603
|
contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
|
|
604
604
|
? __assign({ email: isEmailNonEditable ? undefined : email }, (!(isMobileCountryNonEditable && isMobileNumberNonEditable) &&
|
|
@@ -644,14 +644,12 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
644
644
|
'date_of_birth',
|
|
645
645
|
'nationality'
|
|
646
646
|
], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
|
|
647
|
-
individualData = undefined;
|
|
648
|
-
if (!isDirty) return [3, 2];
|
|
649
647
|
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
650
648
|
case 1:
|
|
651
649
|
data = _l.sent();
|
|
652
|
-
|
|
653
|
-
_l.label = 2;
|
|
650
|
+
return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
|
|
654
651
|
case 2:
|
|
652
|
+
currencyData = _l.sent();
|
|
655
653
|
_e = getIndividualType(objects), isUser = _e.isUser, isBuyer = _e.isBuyer;
|
|
656
654
|
isUserORBuyerType = isUser || isBuyer;
|
|
657
655
|
if (!isUserORBuyerType) return [3, 4];
|
|
@@ -662,38 +660,35 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
662
660
|
case 4:
|
|
663
661
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
664
662
|
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
|
|
665
|
-
return [2, { data:
|
|
663
|
+
return [2, { data: data, formData: originalFormData, currencyData: currencyData }];
|
|
666
664
|
}
|
|
667
665
|
});
|
|
668
666
|
});
|
|
669
667
|
});
|
|
670
668
|
export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (_a, thunkApi) {
|
|
671
|
-
var formData = _a.formData, originalFormData = _a.originalFormData
|
|
669
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
672
670
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
673
|
-
var _b, settings, individual, _c,
|
|
671
|
+
var _b, settings, individual, _c, notification, user, id, _d, objects, ids, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, _e, isUser, isShareholder, isBoardMember, isBuyer, isCustomer, isUserORBuyerType, payload, requestBody, data, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, individualData;
|
|
674
672
|
var _f, _g;
|
|
675
673
|
return __generator(this, function (_h) {
|
|
676
674
|
switch (_h.label) {
|
|
677
675
|
case 0:
|
|
678
676
|
_b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
|
|
679
|
-
_c = individual.data.verify.responseBody || {},
|
|
680
|
-
id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : recipient) || {}).id;
|
|
677
|
+
_c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user;
|
|
678
|
+
id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
|
|
681
679
|
_d = user || {}, objects = _d.objects, ids = _d.ids;
|
|
682
|
-
|
|
683
|
-
occupation = formData.occupation, sourceIncome = formData.sourceIncome, monthlyIncome = formData.monthlyIncome, isPEP = formData.isPEP, isInfluencer = formData.isInfluencer, shareCount = formData.shareCount, shareValue = formData.shareValue, civilID = formData.civilID, signatureFileId = formData.signatureFileId, isAuthorized = formData.isAuthorized;
|
|
680
|
+
occupation = formData.occupation, sourceIncome = formData.sourceIncome, monthlyIncome = formData.monthlyIncome, isPEP = formData.isPEP, isInfluencer = formData.isInfluencer, shareCount = formData.shareCount, shareValue = formData.shareValue, civilID = formData.civilID, signatureFileId = formData.signatureFileId;
|
|
684
681
|
isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
|
|
685
682
|
isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
|
|
686
683
|
isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
|
|
687
684
|
isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
|
|
688
685
|
isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
|
|
689
|
-
isAuthorizedNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_authorized');
|
|
690
686
|
isSharesAvailable = shareCount || shareValue;
|
|
691
687
|
pepInfo = isPEPNonEditable || isPEP === null ? undefined : isPEP;
|
|
692
688
|
influencerInfo = isInfluencerNonEditable || isInfluencer === null ? undefined : isInfluencer;
|
|
693
689
|
occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { chapter: { id: occupation.id } };
|
|
694
690
|
sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
|
|
695
691
|
monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
|
|
696
|
-
isAuthorizedInfo = isAuthorizedNonEditable || isKWOrSAValue ? undefined : { is_authorized: isAuthorized };
|
|
697
692
|
userPayload = {
|
|
698
693
|
occupation: occupationInfo,
|
|
699
694
|
source_income: sourceIncomeInfo,
|
|
@@ -722,70 +717,58 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
|
|
|
722
717
|
isUserORBuyerType = isUser || isBuyer;
|
|
723
718
|
payload = userPayload;
|
|
724
719
|
if (objects === null || objects === void 0 ? void 0 : objects.length) {
|
|
725
|
-
payload = __assign(__assign(__assign(__assign(__assign(
|
|
720
|
+
payload = __assign(__assign(__assign(__assign(__assign({}, (isUser && payload)), (isShareholder && shareHolderPayload)), (isBoardMember && boardMemberPayload)), (isBuyer && buyerMemberPayload)), (isCustomer && {}));
|
|
726
721
|
}
|
|
722
|
+
requestBody = __assign(__assign({ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id] }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
|
|
723
|
+
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
724
|
+
case 1:
|
|
725
|
+
data = _h.sent();
|
|
727
726
|
businessCountry = settings.data.businessCountry;
|
|
728
727
|
hasCivilIdDocument = (civilID || []).length > 0;
|
|
729
728
|
hasSignatureDocument = (signatureFileId || []).length > 0;
|
|
730
|
-
isSendSignatureFile =
|
|
729
|
+
isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && isUserORBuyerType;
|
|
731
730
|
civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
|
|
732
731
|
signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
|
|
733
|
-
if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3,
|
|
732
|
+
if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 3];
|
|
734
733
|
documentBody = {
|
|
735
734
|
id: civilIdDocument.id,
|
|
736
735
|
images: civilID
|
|
737
736
|
};
|
|
738
737
|
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
739
|
-
case 1:
|
|
740
|
-
_h.sent();
|
|
741
|
-
_h.label = 2;
|
|
742
738
|
case 2:
|
|
743
|
-
|
|
739
|
+
_h.sent();
|
|
740
|
+
_h.label = 3;
|
|
741
|
+
case 3:
|
|
742
|
+
if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 5];
|
|
744
743
|
documentBody = {
|
|
745
744
|
id: signatureDocument.id,
|
|
746
745
|
images: signatureFileId
|
|
747
746
|
};
|
|
748
747
|
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
749
|
-
case 3:
|
|
750
|
-
_h.sent();
|
|
751
|
-
_h.label = 4;
|
|
752
748
|
case 4:
|
|
749
|
+
_h.sent();
|
|
750
|
+
_h.label = 5;
|
|
751
|
+
case 5:
|
|
753
752
|
documentsList = [];
|
|
754
753
|
if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
|
|
755
754
|
documentsList.push({ type: DocumentPurpose.IDENTITY_DOCUMENT, images: civilID });
|
|
756
755
|
if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
|
|
757
756
|
documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
|
|
758
|
-
if (!(documentsList.length > 0)) return [3,
|
|
757
|
+
if (!(documentsList.length > 0)) return [3, 7];
|
|
759
758
|
documentBody = {
|
|
760
759
|
individual_type_id: ((ids === null || ids === void 0 ? void 0 : ids.length) ? ids.find(function (i) { return i.includes('usr_'); }) : id) || '',
|
|
761
760
|
country: businessCountry.iso2,
|
|
762
761
|
documents: documentsList
|
|
763
762
|
};
|
|
764
763
|
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
765
|
-
case 5:
|
|
766
|
-
_h.sent();
|
|
767
|
-
_h.label = 6;
|
|
768
764
|
case 6:
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
if (!isDirty) return [3, 8];
|
|
772
|
-
return [4, API.individualService.updateMultipleIndividual(requestBody)];
|
|
765
|
+
_h.sent();
|
|
766
|
+
_h.label = 7;
|
|
773
767
|
case 7:
|
|
774
|
-
|
|
775
|
-
user_2 = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
|
|
776
|
-
individualData = user_2;
|
|
777
|
-
_h.label = 8;
|
|
778
|
-
case 8:
|
|
779
|
-
userListRes = userList || [];
|
|
780
|
-
if (!((user === null || user === void 0 ? void 0 : user.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id) && !(user === null || user === void 0 ? void 0 : user.is_authorized) && isAuthorized && (business === null || business === void 0 ? void 0 : business.id))) return [3, 10];
|
|
781
|
-
return [4, thunkApi.dispatch(getIndividualList(business === null || business === void 0 ? void 0 : business.id)).unwrap()];
|
|
782
|
-
case 9:
|
|
783
|
-
userListRes = _h.sent();
|
|
784
|
-
_h.label = 10;
|
|
785
|
-
case 10:
|
|
768
|
+
individualData = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
|
|
786
769
|
thunkApi.dispatch(handleNextScreenStep());
|
|
787
770
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
|
|
788
|
-
return [2, { data: data, formData: originalFormData, individualData: individualData
|
|
771
|
+
return [2, { data: data, formData: originalFormData, individualData: individualData }];
|
|
789
772
|
}
|
|
790
773
|
});
|
|
791
774
|
});
|
|
@@ -816,39 +799,49 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
|
|
|
816
799
|
});
|
|
817
800
|
});
|
|
818
801
|
export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
819
|
-
var _a, settings, individual, _b,
|
|
820
|
-
var _e, _f, _g, _h, _j, _k, _l, _m
|
|
821
|
-
return __generator(this, function (
|
|
822
|
-
switch (
|
|
802
|
+
var _a, settings, individual, _b, id, infoId, primaryUser, _c, showBoard, mode, payload, data, boardInfoStatus, individualDataRes, _d, is_authorized, userId, type;
|
|
803
|
+
var _e, _f, _g, _h, _j, _k, _l, _m;
|
|
804
|
+
return __generator(this, function (_o) {
|
|
805
|
+
switch (_o.label) {
|
|
823
806
|
case 0:
|
|
824
807
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
825
|
-
_b = individual.data.verify.responseBody || {},
|
|
808
|
+
_b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id, primaryUser = _b.primaryUser;
|
|
826
809
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
827
|
-
if (!
|
|
810
|
+
if (!id)
|
|
828
811
|
return [2];
|
|
829
812
|
payload = {
|
|
830
813
|
lang: settings.data.language,
|
|
831
|
-
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS
|
|
814
|
+
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS,
|
|
815
|
+
id: id
|
|
832
816
|
};
|
|
833
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
817
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
834
818
|
case 1:
|
|
835
|
-
data =
|
|
819
|
+
data = _o.sent();
|
|
836
820
|
if (!showBoard && mode === 'content') {
|
|
837
821
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
838
822
|
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
|
|
839
823
|
return [2, { response: __assign({}, data), formData: params }];
|
|
840
824
|
}
|
|
841
|
-
|
|
842
|
-
return [4, Promise.all([
|
|
843
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
844
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: iType })).unwrap()
|
|
845
|
-
])];
|
|
825
|
+
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
846
826
|
case 2:
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
827
|
+
boardInfoStatus = _o.sent();
|
|
828
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
829
|
+
case 3:
|
|
830
|
+
_o.sent();
|
|
831
|
+
individualDataRes = undefined;
|
|
832
|
+
_d = primaryUser || {}, is_authorized = _d.is_authorized, userId = _d.id, type = _d.object;
|
|
833
|
+
if (!!is_authorized) return [3, 5];
|
|
834
|
+
return [4, thunkApi
|
|
835
|
+
.dispatch(retrieveIndividualInfo({ id: userId, type: type, countryCode: settings.data.businessCountry.iso2 }))
|
|
836
|
+
.unwrap()];
|
|
837
|
+
case 4:
|
|
838
|
+
individualDataRes = _o.sent();
|
|
839
|
+
_o.label = 5;
|
|
840
|
+
case 5:
|
|
841
|
+
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, {});
|
|
842
|
+
(_m = (_l = settings.data.appConfig).onFlowCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, { data: data });
|
|
850
843
|
thunkApi.dispatch(handleNextScreenStep());
|
|
851
|
-
return [2, {
|
|
844
|
+
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params, individualData: individualDataRes === null || individualDataRes === void 0 ? void 0 : individualDataRes.data }];
|
|
852
845
|
}
|
|
853
846
|
});
|
|
854
847
|
}); });
|
|
@@ -870,9 +863,9 @@ var initialState = {
|
|
|
870
863
|
error: null,
|
|
871
864
|
loading: false,
|
|
872
865
|
cityLoading: false,
|
|
873
|
-
addOrRequestDetailLoading: false,
|
|
874
866
|
data: {
|
|
875
867
|
flowName: FlowsTypes.INDIVIDUAL,
|
|
868
|
+
currency: '',
|
|
876
869
|
verify: {
|
|
877
870
|
token: ''
|
|
878
871
|
},
|
|
@@ -910,8 +903,7 @@ var initialState = {
|
|
|
910
903
|
isPEP: null,
|
|
911
904
|
isInfluencer: null,
|
|
912
905
|
shareCount: '',
|
|
913
|
-
shareValue: ''
|
|
914
|
-
isAuthorized: false
|
|
906
|
+
shareValue: ''
|
|
915
907
|
}
|
|
916
908
|
}
|
|
917
909
|
};
|
|
@@ -946,8 +938,8 @@ export var individualSlice = createSlice({
|
|
|
946
938
|
})
|
|
947
939
|
.addCase(verifyToken.fulfilled, function (state, action) {
|
|
948
940
|
state.error = null;
|
|
949
|
-
var _a = action.payload, data = _a.data, token = _a.token,
|
|
950
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody),
|
|
941
|
+
var _a = action.payload, data = _a.data, token = _a.token, boardResponse = _a.boardResponse;
|
|
942
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
|
|
951
943
|
state.data.verify.token = token;
|
|
952
944
|
})
|
|
953
945
|
.addCase(verifyToken.rejected, function (state, action) {
|
|
@@ -987,31 +979,37 @@ export var individualSlice = createSlice({
|
|
|
987
979
|
state.error = null;
|
|
988
980
|
})
|
|
989
981
|
.addCase(verifyLeadOTP.fulfilled, function (state, action) {
|
|
982
|
+
var _a;
|
|
990
983
|
state.loading = false;
|
|
991
984
|
state.error = null;
|
|
992
|
-
var
|
|
985
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, boardResponse = _b.boardResponse;
|
|
986
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
987
|
+
if (description) {
|
|
988
|
+
state.error = description;
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
993
991
|
state.data.otpData = formData;
|
|
994
992
|
state.data.otpData.responseBody = data;
|
|
995
|
-
state.data.verify.responseBody = __assign(__assign(
|
|
993
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
|
|
996
994
|
})
|
|
997
995
|
.addCase(verifyLeadOTP.rejected, function (state, action) {
|
|
998
996
|
state.loading = false;
|
|
999
997
|
state.error = action.error.message;
|
|
1000
998
|
})
|
|
1001
999
|
.addCase(addDetailsAsync.pending, function (state) {
|
|
1002
|
-
state.
|
|
1000
|
+
state.loading = true;
|
|
1003
1001
|
state.error = null;
|
|
1004
1002
|
})
|
|
1005
1003
|
.addCase(addDetailsAsync.fulfilled, function (state, action) {
|
|
1006
1004
|
var _a, _b, _c, _d;
|
|
1007
|
-
state.
|
|
1005
|
+
state.loading = false;
|
|
1008
1006
|
state.error = null;
|
|
1009
1007
|
var _e = action.payload, userList = _e.userList, individualId = _e.individualId, countries = _e.countries;
|
|
1010
1008
|
var primaryUser = (state.data.verify.responseBody || {}).user;
|
|
1011
1009
|
var user = (userList || []).find(function (user) { return user.individual_id === individualId; });
|
|
1012
1010
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: userList });
|
|
1013
1011
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: userList, user: __assign(__assign({}, user), { is_authorized: (user === null || user === void 0 ? void 0 : user.is_authorized) !== undefined ? user === null || user === void 0 ? void 0 : user.is_authorized : primaryUser === null || primaryUser === void 0 ? void 0 : primaryUser.is_authorized }) });
|
|
1014
|
-
var _f = user || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares
|
|
1012
|
+
var _f = user || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares;
|
|
1015
1013
|
var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList;
|
|
1016
1014
|
var cityList = (state.data.verify.responseBody || {}).cityList;
|
|
1017
1015
|
if (user)
|
|
@@ -1069,19 +1067,17 @@ export var individualSlice = createSlice({
|
|
|
1069
1067
|
state.data.individualData.isPEP = is_relative_PEP;
|
|
1070
1068
|
if (is_influencer !== undefined)
|
|
1071
1069
|
state.data.individualData.isInfluencer = is_influencer;
|
|
1072
|
-
if (is_authorized !== undefined)
|
|
1073
|
-
state.data.individualData.isAuthorized = is_authorized;
|
|
1074
1070
|
})
|
|
1075
1071
|
.addCase(addDetailsAsync.rejected, function (state, action) {
|
|
1076
|
-
state.
|
|
1072
|
+
state.loading = false;
|
|
1077
1073
|
state.error = action.error.message;
|
|
1078
1074
|
})
|
|
1079
1075
|
.addCase(requestDetailsByEmail.pending, function (state) {
|
|
1080
|
-
state.
|
|
1076
|
+
state.loading = true;
|
|
1081
1077
|
state.error = null;
|
|
1082
1078
|
})
|
|
1083
1079
|
.addCase(requestDetailsByEmail.fulfilled, function (state, action) {
|
|
1084
|
-
state.
|
|
1080
|
+
state.loading = false;
|
|
1085
1081
|
state.error = null;
|
|
1086
1082
|
var _a = action.payload, data = _a.data, individualData = _a.individualData;
|
|
1087
1083
|
var userList = (state.data.verify.responseBody || {}).userList;
|
|
@@ -1094,7 +1090,7 @@ export var individualSlice = createSlice({
|
|
|
1094
1090
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { requestEmailData: data, userList: list });
|
|
1095
1091
|
})
|
|
1096
1092
|
.addCase(requestDetailsByEmail.rejected, function (state, action) {
|
|
1097
|
-
state.
|
|
1093
|
+
state.loading = false;
|
|
1098
1094
|
state.error = action.error.message;
|
|
1099
1095
|
})
|
|
1100
1096
|
.addCase(retrieveIndividualInfo.pending, function (state) {
|
|
@@ -1106,7 +1102,7 @@ export var individualSlice = createSlice({
|
|
|
1106
1102
|
var _e = action.payload, data = _e.data, countries = _e.countries;
|
|
1107
1103
|
var user = (state.data.verify.responseBody || {}).user;
|
|
1108
1104
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { primaryUser: data, user: __assign(__assign({}, data), { is_authorized: data.is_authorized !== undefined ? data.is_authorized : user === null || user === void 0 ? void 0 : user.is_authorized }) });
|
|
1109
|
-
var _f = data || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares
|
|
1105
|
+
var _f = data || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares;
|
|
1110
1106
|
var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList;
|
|
1111
1107
|
var cityList = (state.data.verify.responseBody || {}).cityList;
|
|
1112
1108
|
if (data)
|
|
@@ -1162,8 +1158,6 @@ export var individualSlice = createSlice({
|
|
|
1162
1158
|
state.data.individualData.occupation = selectedOccupation;
|
|
1163
1159
|
state.data.individualData.isPEP = is_relative_PEP;
|
|
1164
1160
|
state.data.individualData.isInfluencer = is_influencer;
|
|
1165
|
-
if (is_authorized !== undefined)
|
|
1166
|
-
state.data.individualData.isAuthorized = is_authorized;
|
|
1167
1161
|
})
|
|
1168
1162
|
.addCase(retrieveIndividualInfo.rejected, function (state, action) {
|
|
1169
1163
|
state.error = action.error.message;
|
|
@@ -1254,11 +1248,14 @@ export var individualSlice = createSlice({
|
|
|
1254
1248
|
state.error = null;
|
|
1255
1249
|
})
|
|
1256
1250
|
.addCase(updateIndividualPersonalInfo.fulfilled, function (state, action) {
|
|
1251
|
+
var _a;
|
|
1257
1252
|
state.loading = false;
|
|
1258
1253
|
state.error = null;
|
|
1259
|
-
var
|
|
1254
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
|
|
1260
1255
|
state.data.individualPersonalData = formData;
|
|
1261
1256
|
state.data.individualPersonalData.responseBody = data;
|
|
1257
|
+
if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
|
|
1258
|
+
state.data.currency = currencyData.code.english;
|
|
1262
1259
|
})
|
|
1263
1260
|
.addCase(updateIndividualPersonalInfo.rejected, function (state, action) {
|
|
1264
1261
|
state.loading = false;
|
|
@@ -1271,20 +1268,16 @@ export var individualSlice = createSlice({
|
|
|
1271
1268
|
.addCase(updateIndividualInfo.fulfilled, function (state, action) {
|
|
1272
1269
|
state.loading = false;
|
|
1273
1270
|
state.error = null;
|
|
1274
|
-
var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData
|
|
1275
|
-
state.data.individualData =
|
|
1271
|
+
var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData;
|
|
1272
|
+
state.data.individualData = formData;
|
|
1276
1273
|
state.data.individualData.responseBody = data;
|
|
1277
|
-
var
|
|
1278
|
-
var isSameUser = (user === null || user === void 0 ? void 0 : user.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id);
|
|
1279
|
-
var userInfo = __assign(__assign({}, user), (isSameUser && individualData && __assign({}, individualData)));
|
|
1280
|
-
if (isSameUser && !isKWOrSACountry)
|
|
1281
|
-
userInfo = __assign(__assign({}, user), { is_authorized: individualData.is_authorized });
|
|
1274
|
+
var userList = (state.data.verify.responseBody || {}).userList;
|
|
1282
1275
|
var list = userList || [];
|
|
1283
1276
|
list = list.map(function (user) {
|
|
1284
1277
|
var userInfo = user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id) ? individualData : user;
|
|
1285
1278
|
return userInfo;
|
|
1286
1279
|
});
|
|
1287
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), {
|
|
1280
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: list });
|
|
1288
1281
|
})
|
|
1289
1282
|
.addCase(updateIndividualInfo.rejected, function (state, action) {
|
|
1290
1283
|
state.loading = false;
|
|
@@ -1336,8 +1329,18 @@ export var individualSlice = createSlice({
|
|
|
1336
1329
|
var _a;
|
|
1337
1330
|
state.loading = false;
|
|
1338
1331
|
state.error = null;
|
|
1339
|
-
var _b = action.payload || {},
|
|
1340
|
-
|
|
1332
|
+
var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
|
|
1333
|
+
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
1334
|
+
if (description) {
|
|
1335
|
+
state.error = description;
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
var flows = response.flows;
|
|
1339
|
+
var individuals = (state.data.verify.responseBody || {}).individuals;
|
|
1340
|
+
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
1341
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (data_state && {
|
|
1342
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
1343
|
+
}));
|
|
1341
1344
|
})
|
|
1342
1345
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
1343
1346
|
state.loading = true;
|