@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
|
@@ -6,8 +6,7 @@ interface VerifyLeadTokenProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
8
8
|
data: any;
|
|
9
|
-
|
|
10
|
-
boardResponse: any;
|
|
9
|
+
entityData: any;
|
|
11
10
|
token: string;
|
|
12
11
|
}, VerifyLeadTokenProps, {
|
|
13
12
|
state?: unknown;
|
|
@@ -43,9 +42,12 @@ export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
43
42
|
fulfilledMeta?: unknown;
|
|
44
43
|
rejectedMeta?: unknown;
|
|
45
44
|
}>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
type RetrieveBoardProps = {
|
|
46
|
+
boardId: string;
|
|
47
|
+
individualId: string;
|
|
48
|
+
individualType: string;
|
|
49
|
+
};
|
|
50
|
+
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<any, RetrieveBoardProps, {
|
|
49
51
|
state?: unknown;
|
|
50
52
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
51
53
|
extra?: unknown;
|
|
@@ -57,6 +59,7 @@ export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
57
59
|
}>;
|
|
58
60
|
export declare const verifyTaxLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
59
61
|
data: any;
|
|
62
|
+
entityData: any;
|
|
60
63
|
formData: OTPFormValues;
|
|
61
64
|
}, OTPFormValues, {
|
|
62
65
|
state?: unknown;
|
|
@@ -82,8 +85,11 @@ export declare const updateTaxInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
82
85
|
rejectedMeta?: unknown;
|
|
83
86
|
}>;
|
|
84
87
|
export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
data: any;
|
|
89
|
+
flows?: undefined;
|
|
90
|
+
} | {
|
|
91
|
+
data: any;
|
|
92
|
+
flows: any;
|
|
87
93
|
} | undefined, void, {
|
|
88
94
|
state?: unknown;
|
|
89
95
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -55,10 +55,10 @@ import { getRecentDocumentBasedOnPurpose, hasNoneEditableValue, retrieveIndividu
|
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data,
|
|
59
|
-
var _d, _e
|
|
60
|
-
return __generator(this, function (
|
|
61
|
-
switch (
|
|
58
|
+
var payload, data, entityData, _b, config, country_code, entity_id, boardId, publicKey, data_1;
|
|
59
|
+
var _c, _d, _e;
|
|
60
|
+
return __generator(this, function (_f) {
|
|
61
|
+
switch (_f.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
64
64
|
notification: {
|
|
@@ -67,56 +67,48 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
|
|
|
67
67
|
}));
|
|
68
68
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
69
69
|
case 1:
|
|
70
|
-
data = (
|
|
71
|
-
|
|
72
|
-
if (((
|
|
70
|
+
data = (_f.sent()).data;
|
|
71
|
+
entityData = undefined;
|
|
72
|
+
if (((_c = data === null || data === void 0 ? void 0 : data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
73
73
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
74
74
|
if (isInternally)
|
|
75
75
|
data.step_name = TAX_STEP_NAMES.TAX_INFO;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (publicKey)
|
|
76
|
+
_b = data || {}, config = _b.config, country_code = _b.country_code, entity_id = _b.entity_id, boardId = _b.id;
|
|
77
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
78
|
+
if (publicKey)
|
|
79
79
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return [4, API.boardService.retrieveBoardInfo({ id: data.id, infoId: data.board_info_id })];
|
|
80
|
+
if (country_code)
|
|
81
|
+
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
82
|
+
if (!(data.step_name === TAX_STEP_NAMES.PHONE_AUTH)) return [3, 2];
|
|
83
|
+
thunkApi.dispatch(handleCurrentActiveScreen('TAX_VERIFY_STEP'));
|
|
84
|
+
return [3, 7];
|
|
86
85
|
case 2:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
case
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
if (!(data.step_name === TAX_STEP_NAMES.TAX_INFO)) return [3, 7];
|
|
87
|
+
if (!!entity_id) return [3, 4];
|
|
88
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
89
|
+
case 3:
|
|
90
|
+
data_1 = _f.sent();
|
|
91
|
+
if (!((_d = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _d === void 0 ? void 0 : _d.id))
|
|
92
|
+
throw new Error('entity_id_missing');
|
|
93
|
+
entityData = data_1;
|
|
94
|
+
return [3, 6];
|
|
95
|
+
case 4: return [4, API.entityService.retrieveEntity(entity_id)];
|
|
95
96
|
case 5:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
individualData = individualRes;
|
|
99
|
-
_j.label = 6;
|
|
97
|
+
entityData = _f.sent();
|
|
98
|
+
_f.label = 6;
|
|
100
99
|
case 6:
|
|
101
|
-
if (!
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
thunkApi.dispatch(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
return [2, {
|
|
115
|
-
data: data,
|
|
116
|
-
individualData: individualData,
|
|
117
|
-
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _h === void 0 ? void 0 : _h.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
|
|
118
|
-
token: token
|
|
119
|
-
}];
|
|
100
|
+
if (!country_code && ((_e = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _e === void 0 ? void 0 : _e.country))
|
|
101
|
+
thunkApi.dispatch(handleSetCountryByIso2(entityData.entity.country));
|
|
102
|
+
if (isInternally)
|
|
103
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP')); });
|
|
104
|
+
else
|
|
105
|
+
thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP'));
|
|
106
|
+
_f.label = 7;
|
|
107
|
+
case 7: return [2, {
|
|
108
|
+
data: data,
|
|
109
|
+
entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
110
|
+
token: token
|
|
111
|
+
}];
|
|
120
112
|
}
|
|
121
113
|
});
|
|
122
114
|
});
|
|
@@ -139,98 +131,139 @@ export var resendOTP = createAsyncThunk('resendOTPTax', function (params, thunkA
|
|
|
139
131
|
});
|
|
140
132
|
}); });
|
|
141
133
|
export var retrieveBoardStatus = createAsyncThunk('tax/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
142
|
-
var tax, board_id, data;
|
|
143
|
-
return __generator(this, function (
|
|
144
|
-
switch (
|
|
134
|
+
var tax, _a, board_id, board_info_id, recipient, _b, id, type, data;
|
|
135
|
+
return __generator(this, function (_c) {
|
|
136
|
+
switch (_c.label) {
|
|
145
137
|
case 0:
|
|
146
138
|
tax = thunkApi.getState().tax;
|
|
147
|
-
|
|
148
|
-
|
|
139
|
+
_a = tax.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
|
|
140
|
+
if (!board_id || !board_info_id)
|
|
141
|
+
throw new Error('Internal server error');
|
|
142
|
+
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
143
|
+
return [4, Promise.all([
|
|
144
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
145
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
146
|
+
])];
|
|
149
147
|
case 1:
|
|
150
|
-
data =
|
|
148
|
+
data = (_c.sent())[0];
|
|
151
149
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
152
150
|
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
153
151
|
}
|
|
154
152
|
});
|
|
155
153
|
}); });
|
|
156
|
-
export var
|
|
157
|
-
var
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return [
|
|
164
|
-
|
|
154
|
+
export var retrieveBoardDetails = createAsyncThunk('tax/retrieveBrandInfo', function (_a) {
|
|
155
|
+
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
156
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
157
|
+
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
158
|
+
var _c, _d, _e, _f;
|
|
159
|
+
return __generator(this, function (_g) {
|
|
160
|
+
switch (_g.label) {
|
|
161
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
162
|
+
case 1:
|
|
163
|
+
data = _g.sent();
|
|
164
|
+
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
165
|
+
boardData = data;
|
|
166
|
+
if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
|
|
167
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
168
|
+
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
169
|
+
case 2:
|
|
170
|
+
_b = _g.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
171
|
+
individualData = individualRes;
|
|
172
|
+
boardData = boardRes;
|
|
173
|
+
_g.label = 3;
|
|
174
|
+
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, vatID: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.vat_id, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.contact, user: individualData })];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
165
177
|
});
|
|
166
|
-
});
|
|
178
|
+
});
|
|
167
179
|
export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
168
|
-
var _a, tax, settings, responseBody, payload, data, publicKey;
|
|
169
|
-
var
|
|
170
|
-
return __generator(this, function (
|
|
171
|
-
switch (
|
|
180
|
+
var _a, tax, settings, responseBody, payload, data, _b, config, entity_id, boardId, country_code, entityData, publicKey, countryIso2, data_2;
|
|
181
|
+
var _c, _d, _e, _f, _g, _h;
|
|
182
|
+
return __generator(this, function (_j) {
|
|
183
|
+
switch (_j.label) {
|
|
172
184
|
case 0:
|
|
173
185
|
_a = thunkApi.getState(), tax = _a.tax, settings = _a.settings;
|
|
174
186
|
responseBody = tax.data.verify.responseBody;
|
|
175
187
|
payload = {
|
|
176
188
|
data: params.otp,
|
|
177
|
-
service_name: (
|
|
189
|
+
service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
|
|
178
190
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
179
191
|
step_name: TAX_STEP_NAMES.PHONE_AUTH,
|
|
180
192
|
encryption_contract: ['data']
|
|
181
193
|
};
|
|
182
194
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
183
195
|
case 1:
|
|
184
|
-
data = (
|
|
185
|
-
if ((
|
|
196
|
+
data = (_j.sent()).data;
|
|
197
|
+
if ((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
186
198
|
throw new Error(data.errors[0].description);
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
_b = data || {}, config = _b.config, entity_id = _b.entity_id, boardId = _b.id, country_code = _b.country_code;
|
|
200
|
+
entityData = undefined;
|
|
201
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
202
|
+
countryIso2 = country_code || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
|
|
203
|
+
if (publicKey)
|
|
189
204
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
190
|
-
|
|
191
|
-
|
|
205
|
+
if (countryIso2)
|
|
206
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
207
|
+
if (!!entity_id) return [3, 3];
|
|
208
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
209
|
+
case 2:
|
|
210
|
+
data_2 = _j.sent();
|
|
211
|
+
if (!((_e = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _e === void 0 ? void 0 : _e.id))
|
|
212
|
+
throw new Error('entity_id_missing');
|
|
213
|
+
entityData = data_2;
|
|
214
|
+
return [3, 5];
|
|
215
|
+
case 3: return [4, API.entityService.retrieveEntity(entity_id)];
|
|
216
|
+
case 4:
|
|
217
|
+
entityData = _j.sent();
|
|
218
|
+
_j.label = 5;
|
|
219
|
+
case 5:
|
|
220
|
+
if (!countryIso2 && ((_f = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _f === void 0 ? void 0 : _f.country))
|
|
221
|
+
thunkApi.dispatch(handleSetCountryByIso2(entityData.entity.country));
|
|
222
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
|
|
192
223
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP')); });
|
|
193
|
-
return [2, { data: data, formData: params }];
|
|
224
|
+
return [2, { data: data, entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity, formData: params }];
|
|
194
225
|
}
|
|
195
226
|
});
|
|
196
227
|
}); });
|
|
197
228
|
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (_a, thunkApi) {
|
|
198
|
-
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
229
|
+
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
199
230
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
-
var _b, settings, tax, _c, entity,
|
|
201
|
-
var
|
|
202
|
-
return __generator(this, function (
|
|
203
|
-
switch (
|
|
231
|
+
var _b, settings, tax, _c, entity, recipient, _d, id, data_status, documents, isTaxNumberNonEditable, isConfirmPolicyNonEditable, isDocumentsNonEditable, document, vatId, confirmPolicy, documentId, data, requestBody, documentBody, documentData, documentBody, documentData;
|
|
232
|
+
var _e, _f;
|
|
233
|
+
return __generator(this, function (_g) {
|
|
234
|
+
switch (_g.label) {
|
|
204
235
|
case 0:
|
|
205
236
|
_b = thunkApi.getState(), settings = _b.settings, tax = _b.tax;
|
|
206
|
-
_c = tax.data.verify.responseBody || {}, entity = _c.entity,
|
|
237
|
+
_c = tax.data.verify.responseBody || {}, entity = _c.entity, recipient = _c.recipient;
|
|
207
238
|
_d = entity || {}, id = _d.id, data_status = _d.data_status, documents = _d.documents;
|
|
208
239
|
isTaxNumberNonEditable = hasNoneEditableValue(data_status, 'tax_number');
|
|
209
240
|
isConfirmPolicyNonEditable = hasNoneEditableValue(data_status, 'is_vat_acknowledged');
|
|
210
241
|
isDocumentsNonEditable = hasNoneEditableValue(data_status, 'documents');
|
|
211
242
|
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.TAX_DOCUMENT);
|
|
212
243
|
vatId = formData.vatId, confirmPolicy = formData.confirmPolicy, documentId = formData.documentId;
|
|
244
|
+
data = entity || {};
|
|
213
245
|
requestBody = __assign(__assign({ id: id, vat_id: isTaxNumberNonEditable ? undefined : vatId }, (!isConfirmPolicyNonEditable && {
|
|
214
|
-
vat_acknowledged_by:
|
|
246
|
+
vat_acknowledged_by: recipient === null || recipient === void 0 ? void 0 : recipient.id,
|
|
215
247
|
is_vat_acknowledged: confirmPolicy
|
|
216
248
|
})), { step_name: TAX_STEP_NAMES.TAX_INFO });
|
|
249
|
+
if (!isDirty) return [3, 2];
|
|
217
250
|
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
218
251
|
case 1:
|
|
219
|
-
data =
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (!(!isDocumentsNonEditable && (documentId || []).length > 0)) return [3,
|
|
223
|
-
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3,
|
|
252
|
+
data = _g.sent();
|
|
253
|
+
_g.label = 2;
|
|
254
|
+
case 2:
|
|
255
|
+
if (!(!isDocumentsNonEditable && (documentId || []).length > 0)) return [3, 6];
|
|
256
|
+
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 4];
|
|
224
257
|
documentBody = {
|
|
225
258
|
id: document === null || document === void 0 ? void 0 : document.id,
|
|
226
259
|
images: documentId
|
|
227
260
|
};
|
|
228
|
-
_e = data;
|
|
229
261
|
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
230
|
-
case 2:
|
|
231
|
-
_e.documentData = _l.sent();
|
|
232
|
-
return [3, 5];
|
|
233
262
|
case 3:
|
|
263
|
+
documentData = _g.sent();
|
|
264
|
+
data = __assign(__assign({}, data), { documentData: documentData });
|
|
265
|
+
return [3, 6];
|
|
266
|
+
case 4:
|
|
234
267
|
documentBody = {
|
|
235
268
|
entity_id: id || '',
|
|
236
269
|
documents: [
|
|
@@ -240,55 +273,53 @@ export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (_a, thunk
|
|
|
240
273
|
}
|
|
241
274
|
]
|
|
242
275
|
};
|
|
243
|
-
_f = data;
|
|
244
276
|
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
245
|
-
case 4:
|
|
246
|
-
_f.documentData = _l.sent();
|
|
247
|
-
_l.label = 5;
|
|
248
277
|
case 5:
|
|
278
|
+
documentData = _g.sent();
|
|
279
|
+
data = __assign(__assign({}, data), { documentData: documentData });
|
|
280
|
+
_g.label = 6;
|
|
281
|
+
case 6:
|
|
249
282
|
thunkApi.dispatch(handleNextScreenStep());
|
|
250
|
-
(
|
|
283
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
|
|
251
284
|
return [2, { data: data, formData: originalFormData }];
|
|
252
285
|
}
|
|
253
286
|
});
|
|
254
287
|
});
|
|
255
288
|
});
|
|
256
289
|
export var updateLeadSuccess = createAsyncThunk('taxUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
257
|
-
var _a, settings, tax, _b,
|
|
258
|
-
var
|
|
259
|
-
return __generator(this, function (
|
|
260
|
-
switch (
|
|
290
|
+
var _a, settings, tax, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
|
|
291
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
292
|
+
return __generator(this, function (_p) {
|
|
293
|
+
switch (_p.label) {
|
|
261
294
|
case 0:
|
|
262
295
|
_a = thunkApi.getState(), settings = _a.settings, tax = _a.tax;
|
|
263
|
-
_b = tax.data.verify.responseBody || {},
|
|
296
|
+
_b = tax.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
|
|
264
297
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
265
|
-
if (!
|
|
298
|
+
if (!board_id)
|
|
266
299
|
return [2];
|
|
267
300
|
payload = {
|
|
268
301
|
lang: settings.data.language,
|
|
269
302
|
step_name: TAX_STEP_NAMES.TAX_SUCCESS
|
|
270
303
|
};
|
|
271
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
304
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
|
|
272
305
|
case 1:
|
|
273
|
-
data =
|
|
306
|
+
data = _p.sent();
|
|
274
307
|
if (!showBoard && mode === 'content') {
|
|
275
|
-
(
|
|
276
|
-
(
|
|
277
|
-
return [2, {
|
|
308
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
309
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
|
|
310
|
+
return [2, { data: data }];
|
|
278
311
|
}
|
|
279
|
-
|
|
312
|
+
_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;
|
|
313
|
+
return [4, Promise.all([
|
|
314
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
315
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
316
|
+
])];
|
|
280
317
|
case 2:
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
boardData = _o.sent();
|
|
285
|
-
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
286
|
-
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
318
|
+
boardInfoStatusData = (_p.sent())[0];
|
|
319
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
|
|
320
|
+
(_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
|
|
287
321
|
thunkApi.dispatch(handleNextScreenStep());
|
|
288
|
-
return [2, {
|
|
289
|
-
response: __assign(__assign({}, data), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [], user: boardData === null || boardData === void 0 ? void 0 : boardData.user, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _m === void 0 ? void 0 : _m.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, business: boardData === null || boardData === void 0 ? void 0 : boardData.business }),
|
|
290
|
-
formData: params
|
|
291
|
-
}];
|
|
322
|
+
return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
|
|
292
323
|
}
|
|
293
324
|
});
|
|
294
325
|
}); });
|
|
@@ -346,13 +377,13 @@ export var taxSlice = createSlice({
|
|
|
346
377
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
347
378
|
state.error = null;
|
|
348
379
|
state.customLoading = false;
|
|
349
|
-
var _a = action.payload, data = _a.data, token = _a.token,
|
|
350
|
-
var
|
|
351
|
-
state.data.verify.responseBody = __assign(__assign(
|
|
380
|
+
var _a = action.payload, data = _a.data, token = _a.token, entityData = _a.entityData;
|
|
381
|
+
var _b = entityData || {}, vat_id = _b.vat_id, is_vat_acknowledged = _b.is_vat_acknowledged;
|
|
382
|
+
state.data.verify.responseBody = __assign(__assign({}, data), { entity: entityData, board_id: data.id });
|
|
352
383
|
state.data.verify.token = token;
|
|
353
|
-
state.data.taxData.vatId =
|
|
354
|
-
if (
|
|
355
|
-
state.data.taxData.confirmPolicy =
|
|
384
|
+
state.data.taxData.vatId = vat_id;
|
|
385
|
+
if (is_vat_acknowledged)
|
|
386
|
+
state.data.taxData.confirmPolicy = is_vat_acknowledged;
|
|
356
387
|
})
|
|
357
388
|
.addCase(verifyLeadToken.pending, function (state) {
|
|
358
389
|
state.error = null;
|
|
@@ -386,9 +417,14 @@ export var taxSlice = createSlice({
|
|
|
386
417
|
.addCase(verifyTaxLeadOTP.fulfilled, function (state, action) {
|
|
387
418
|
state.loading = false;
|
|
388
419
|
state.error = null;
|
|
389
|
-
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
420
|
+
var _a = action.payload, data = _a.data, entityData = _a.entityData, formData = _a.formData;
|
|
390
421
|
state.data.otpData = formData;
|
|
391
422
|
state.data.otpData.responseBody = data;
|
|
423
|
+
var _b = entityData || {}, vat_id = _b.vat_id, is_vat_acknowledged = _b.is_vat_acknowledged;
|
|
424
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), data), { board_id: data.id, entity: entityData });
|
|
425
|
+
state.data.taxData.vatId = vat_id;
|
|
426
|
+
if (is_vat_acknowledged)
|
|
427
|
+
state.data.taxData.confirmPolicy = is_vat_acknowledged;
|
|
392
428
|
})
|
|
393
429
|
.addCase(verifyTaxLeadOTP.rejected, function (state, action) {
|
|
394
430
|
state.loading = false;
|
|
@@ -403,29 +439,24 @@ export var taxSlice = createSlice({
|
|
|
403
439
|
state.error = null;
|
|
404
440
|
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
405
441
|
state.data.taxData = formData;
|
|
442
|
+
state.data.taxData = __assign(__assign({}, formData), { documentId: undefined });
|
|
406
443
|
state.data.taxData.responseBody = data;
|
|
407
444
|
})
|
|
408
445
|
.addCase(updateTaxInfo.rejected, function (state, action) {
|
|
409
446
|
state.loading = false;
|
|
410
447
|
state.error = action.error.message;
|
|
411
448
|
})
|
|
412
|
-
.addCase(
|
|
449
|
+
.addCase(retrieveBoardDetails.pending, function (state) {
|
|
413
450
|
state.error = null;
|
|
414
451
|
state.loading = true;
|
|
415
452
|
})
|
|
416
|
-
.addCase(
|
|
417
|
-
var _a;
|
|
453
|
+
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
418
454
|
state.error = null;
|
|
419
455
|
state.loading = false;
|
|
420
|
-
var data =
|
|
421
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
422
|
-
if (description) {
|
|
423
|
-
state.error = description;
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
456
|
+
var data = action.payload || {};
|
|
426
457
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
427
458
|
})
|
|
428
|
-
.addCase(
|
|
459
|
+
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
429
460
|
state.error = action.error.message;
|
|
430
461
|
state.loading = false;
|
|
431
462
|
})
|
|
@@ -446,19 +477,9 @@ export var taxSlice = createSlice({
|
|
|
446
477
|
.addCase(updateLeadSuccess.fulfilled, function (state, action) {
|
|
447
478
|
var _a;
|
|
448
479
|
state.loading = false;
|
|
449
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: false });
|
|
450
480
|
state.error = null;
|
|
451
|
-
var
|
|
452
|
-
|
|
453
|
-
if (description) {
|
|
454
|
-
state.error = description;
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
var flows = response.flows, steps = response.steps, user = response.user, bank_account = response.bank_account, vatID = response.vatID, merchant = response.merchant, individuals = response.individuals, entity = response.entity, brand = response.brand, individualData = response.individualData;
|
|
458
|
-
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
459
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps, bank_account: bank_account, name: user === null || user === void 0 ? void 0 : user.names, vatID: vatID, merchant: merchant, individuals: individuals, entity: entity, brand: brand }), (individualData && { user: individualData })), (data_state && {
|
|
460
|
-
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
461
|
-
}));
|
|
481
|
+
var _b = action.payload || {}, flows = _b.flows, data = _b.data;
|
|
482
|
+
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, updateBoardSuccessLoading: false });
|
|
462
483
|
})
|
|
463
484
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
464
485
|
state.loading = true;
|
|
@@ -17,7 +17,7 @@ import { handleNextScreenStep, settingsSelector } from '../../../../app/settings
|
|
|
17
17
|
import { resetStore } from '../../../app/auth/authStore';
|
|
18
18
|
import { AbsherButton, MobileButton } from '../../../shared/Button';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
|
-
import { isKW, isSA } from '../../../../utils';
|
|
20
|
+
import { isKW, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
21
21
|
import { ICONS_NAMES } from '../../../../constants';
|
|
22
22
|
var AuthSwitch = function (_a) {
|
|
23
23
|
var dispatch = useAppDispatch();
|
|
@@ -35,9 +35,21 @@ var AuthSwitch = function (_a) {
|
|
|
35
35
|
dispatch(handleNextScreenStep('AUTH_EMAIL_STEP'));
|
|
36
36
|
};
|
|
37
37
|
var onOpenNID = function () {
|
|
38
|
+
sendCustomEventToGTM({
|
|
39
|
+
event: 'Send Event',
|
|
40
|
+
event_category: 'User Registration Flow',
|
|
41
|
+
event_action: 'Abser Click',
|
|
42
|
+
event_label: data.businessCountry.iso2
|
|
43
|
+
});
|
|
38
44
|
dispatch(handleNextScreenStep('AUTH_NID_STEP'));
|
|
39
45
|
};
|
|
40
46
|
var onOpenPACI = function () {
|
|
47
|
+
sendCustomEventToGTM({
|
|
48
|
+
event: 'Send Event',
|
|
49
|
+
event_category: 'User Registration Flow',
|
|
50
|
+
event_action: 'PACI Click',
|
|
51
|
+
event_label: data.businessCountry.iso2
|
|
52
|
+
});
|
|
41
53
|
dispatch(handleNextScreenStep('AUTH_CIVIL_ID_STEP'));
|
|
42
54
|
};
|
|
43
55
|
return (_jsxs(ScreenContainer, { children: [_jsx(MobileButton, __assign({ sx: { mt: 2.5 }, onClick: function () { return onOpenMobile(); } }, { children: t('mobile_button_label') })), _jsx(MobileButton, __assign({ onClick: function () { return onOpenEmail(); }, icon: ICONS_NAMES.email_icon }, { children: t('email_button_label') })), isKWCountry ? (_jsx(MobileButton, __assign({ onClick: function () { return onOpenPACI(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (isSACountry && _jsx(AbsherButton, __assign({ onClick: function () { return onOpenNID(); } }, { children: t('absher_button_label') })))] }));
|
|
@@ -52,7 +52,7 @@ import { useAppSelector, useAppDispatch, useLanguage } from '../../../../hooks';
|
|
|
52
52
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
53
53
|
import BusinessCountry from '../../../shared/BusinessCountry';
|
|
54
54
|
import Button from '../../../shared/Button';
|
|
55
|
-
import { findCountryByIso2, isSA } from '../../../../utils';
|
|
55
|
+
import { findCountryByIso2, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
56
56
|
import Collapse from '../../../../components/Collapse';
|
|
57
57
|
import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
|
|
58
58
|
import { authSelector, updateBusinessCountry, storeIsStartFromBusinessCountry, clearError, resetStore, setMobileCountryCode } from '../../../app/auth/authStore';
|
|
@@ -81,6 +81,12 @@ var BusinessCountryScreen = function (_a) {
|
|
|
81
81
|
return [2];
|
|
82
82
|
countryCode = findCountryByIso2(settingsData.countries, iso2);
|
|
83
83
|
dispatch(handleSetCountryByIso2(iso2));
|
|
84
|
+
sendCustomEventToGTM({
|
|
85
|
+
event: 'Send Event',
|
|
86
|
+
event_category: 'User Registration Flow',
|
|
87
|
+
event_action: 'Country selection page view',
|
|
88
|
+
event_label: iso2
|
|
89
|
+
});
|
|
84
90
|
if (!data.leadId) return [3, 2];
|
|
85
91
|
return [4, dispatch(updateBusinessCountry(iso2)).unwrap()];
|
|
86
92
|
case 1:
|
|
@@ -2,6 +2,7 @@ import { LibConfig } from '../../@types';
|
|
|
2
2
|
export interface BankLibProps extends LibConfig {
|
|
3
3
|
verifyToken?: string;
|
|
4
4
|
configToken?: string;
|
|
5
|
+
loaderColor?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare function BankElement(props: BankLibProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export declare function renderBankLib(config: BankLibProps, elementId: string): {
|
|
@@ -36,7 +36,7 @@ import { bankFeatureScreens } from '../featuresScreens';
|
|
|
36
36
|
import { bankSelector, verifyLeadToken } from '../app/bank/bankStore';
|
|
37
37
|
import Background from '../shared/Background';
|
|
38
38
|
var Bank = memo(function (_a) {
|
|
39
|
-
var verifyToken = _a.verifyToken, configToken = _a.configToken, props = __rest(_a, ["verifyToken", "configToken"]);
|
|
39
|
+
var verifyToken = _a.verifyToken, configToken = _a.configToken, loaderColor = _a.loaderColor, props = __rest(_a, ["verifyToken", "configToken", "loaderColor"]);
|
|
40
40
|
var theme = useAppTheme().theme;
|
|
41
41
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
42
42
|
var _c = useAppSelector(bankSelector), customLoading = _c.customLoading, loading = _c.loading, bankError = _c.error;
|
|
@@ -55,11 +55,14 @@ var Bank = memo(function (_a) {
|
|
|
55
55
|
loadingScreenName: 'BANK_LOADING_DATA_STEP',
|
|
56
56
|
navigation: featureScreensNavigation,
|
|
57
57
|
open: open,
|
|
58
|
+
mode: props.mode,
|
|
58
59
|
internalToken: verifyToken,
|
|
59
|
-
settingLoading: settingLoading
|
|
60
|
+
settingLoading: settingLoading,
|
|
61
|
+
operatorErrorScreenName: 'BANK_OPERATOR_ERROR_STEP',
|
|
62
|
+
isValidOperator: data.isValidOperator
|
|
60
63
|
});
|
|
61
|
-
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
62
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: bankFeatureScreens.map(function (_a, index) {
|
|
64
|
+
var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
|
|
65
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, loaderColor: loaderColor, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: bankFeatureScreens.map(function (_a, index) {
|
|
63
66
|
var Element = _a.element, name = _a.name;
|
|
64
67
|
var isActive = activeScreen.name === name;
|
|
65
68
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|