@zeniai/client-epic-state 5.2.64 → 5.2.66-beta0MM
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/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/epic.d.ts +3 -2
- package/lib/epic.js +3 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +15 -16
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +18 -9
- package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +11 -2
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +37 -0
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +21 -1
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +31 -28
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +15 -16
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +2 -3
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +12 -3
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +17 -8
- package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +11 -2
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +8 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +41 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +22 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resetKycKybEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const setupViewReducer_1 = require("../../setupViewReducer");
|
|
9
|
+
const resetKycKybEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(setupViewReducer_1.resetKycKyb.match), (0, operators_1.mergeMap)(() => zeniAPI
|
|
10
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/kyc-kyb-reset`, { is_reset_company_officers: false })
|
|
11
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
12
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
13
|
+
return (0, rxjs_1.from)([
|
|
14
|
+
(0, setupViewReducer_1.resetKycKybSuccess)(),
|
|
15
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
16
|
+
messageSection: 'kyc_kyb_reset',
|
|
17
|
+
messageText: 'success',
|
|
18
|
+
type: 'success',
|
|
19
|
+
}),
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
return (0, rxjs_1.from)([
|
|
23
|
+
(0, setupViewReducer_1.resetKycKybFailure)(response.status),
|
|
24
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
25
|
+
messageSection: 'kyc_kyb_reset',
|
|
26
|
+
messageText: 'failed',
|
|
27
|
+
type: 'error',
|
|
28
|
+
}),
|
|
29
|
+
]);
|
|
30
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
31
|
+
(0, setupViewReducer_1.resetKycKybFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Reset KYC/KYB errored out: ' +
|
|
32
|
+
(error instanceof Error
|
|
33
|
+
? error.message
|
|
34
|
+
: JSON.stringify(error)))),
|
|
35
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
36
|
+
messageSection: 'kyc_kyb_reset',
|
|
37
|
+
messageText: 'failed',
|
|
38
|
+
type: 'error',
|
|
39
|
+
}),
|
|
40
|
+
])))));
|
|
41
|
+
exports.resetKycKybEpic = resetKycKybEpic;
|
|
@@ -14,7 +14,7 @@ export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPr
|
|
|
14
14
|
sendForVerification: any;
|
|
15
15
|
fromBillListScreen: any;
|
|
16
16
|
isSubmittingAdditionalDocuments: any;
|
|
17
|
-
}, "setupView/updateBusinessVerificationDetails", never, never>, updateBusinessVerificationDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/updateBusinessVerificationDetailsSuccess">, updateBusinessVerificationDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "setupView/updateBusinessVerificationDetailsFailure", never, never>, updateSelectedCompanyOfficer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedOfficerType: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10"], {
|
|
17
|
+
}, "setupView/updateBusinessVerificationDetails", never, never>, updateBusinessVerificationDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/updateBusinessVerificationDetailsSuccess">, updateBusinessVerificationDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "setupView/updateBusinessVerificationDetailsFailure", never, never>, resetKycKyb: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/resetKycKyb">, resetKycKybSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/resetKycKybSuccess">, resetKycKybFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "setupView/resetKycKybFailure", never, never>, clearKycKybResetStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/clearKycKybResetStatus">, updateSelectedCompanyOfficer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedOfficerType: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10"], {
|
|
18
18
|
selectedOfficerType: "Officer_1" | "Officer_2" | "Officer_3" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10";
|
|
19
19
|
}, "setupView/updateSelectedCompanyOfficer", never, never>, updateSetupViewLocalStoreData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
20
|
companyId: ID;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearKycKybAutofillForSetup = exports.applyKybDocumentAutofillForSetup = exports.applyKycDocumentAutofillForSetup = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.saveTreasuryAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
4
|
+
exports.clearKycKybAutofillForSetup = exports.applyKybDocumentAutofillForSetup = exports.applyKycDocumentAutofillForSetup = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.saveTreasuryAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.clearKycKybResetStatus = exports.resetKycKybFailure = exports.resetKycKybSuccess = exports.resetKycKyb = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const rootActions_1 = require("../../../rootActions");
|
|
7
7
|
const kycKybAutofillActions_1 = require("./kycKybAutofillActions");
|
|
@@ -17,6 +17,7 @@ const emptyOfficerSlot = {
|
|
|
17
17
|
};
|
|
18
18
|
exports.initialState = {
|
|
19
19
|
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
20
|
+
kycKybResetStatus: { fetchState: 'Not-Started', error: undefined },
|
|
20
21
|
parsingDocumentFileIds: [],
|
|
21
22
|
companyDetails: { autoFilledFields: [] },
|
|
22
23
|
companyOfficerUpdateStatus: {
|
|
@@ -88,6 +89,25 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
88
89
|
};
|
|
89
90
|
},
|
|
90
91
|
},
|
|
92
|
+
resetKycKyb(draft) {
|
|
93
|
+
draft.kycKybResetStatus = { fetchState: 'In-Progress', error: undefined };
|
|
94
|
+
},
|
|
95
|
+
resetKycKybSuccess(draft) {
|
|
96
|
+
draft.kycKybResetStatus = { fetchState: 'Completed', error: undefined };
|
|
97
|
+
},
|
|
98
|
+
resetKycKybFailure: {
|
|
99
|
+
reducer(draft, action) {
|
|
100
|
+
draft.kycKybResetStatus = { fetchState: 'Error', error: action.payload };
|
|
101
|
+
},
|
|
102
|
+
prepare(error) {
|
|
103
|
+
return {
|
|
104
|
+
payload: error,
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
clearKycKybResetStatus(draft) {
|
|
109
|
+
draft.kycKybResetStatus = { fetchState: 'Not-Started', error: undefined };
|
|
110
|
+
},
|
|
91
111
|
updateSelectedCompanyOfficer: {
|
|
92
112
|
reducer(draft, action) {
|
|
93
113
|
const { selectedOfficerType } = action.payload;
|
|
@@ -363,5 +383,5 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
363
383
|
});
|
|
364
384
|
},
|
|
365
385
|
});
|
|
366
|
-
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.saveTreasuryAdditionalDocumentsInLocalStore = _a.saveTreasuryAdditionalDocumentsInLocalStore, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.applyKycDocumentAutofillForSetup = _a.applyKycDocumentAutofillForSetup, exports.applyKybDocumentAutofillForSetup = _a.applyKybDocumentAutofillForSetup, exports.clearKycKybAutofillForSetup = _a.clearKycKybAutofillForSetup;
|
|
386
|
+
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.resetKycKyb = _a.resetKycKyb, exports.resetKycKybSuccess = _a.resetKycKybSuccess, exports.resetKycKybFailure = _a.resetKycKybFailure, exports.clearKycKybResetStatus = _a.clearKycKybResetStatus, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.saveTreasuryAdditionalDocumentsInLocalStore = _a.saveTreasuryAdditionalDocumentsInLocalStore, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.applyKycDocumentAutofillForSetup = _a.applyKycDocumentAutofillForSetup, exports.applyKybDocumentAutofillForSetup = _a.applyKybDocumentAutofillForSetup, exports.clearKycKybAutofillForSetup = _a.clearKycKybAutofillForSetup;
|
|
367
387
|
exports.default = setupView.reducer;
|
|
@@ -21,6 +21,7 @@ export interface SetupView {
|
|
|
21
21
|
}
|
|
22
22
|
export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData {
|
|
23
23
|
allNationalityCountries: Country[];
|
|
24
|
+
kycKybResetStatus: FetchStateAndError;
|
|
24
25
|
updateStatus: FetchStateAndError;
|
|
25
26
|
companyView?: CompanyView;
|
|
26
27
|
}
|
|
@@ -90,7 +90,7 @@ function getPrimaryAccountForTheProduct(state, companyId, setupViewType) {
|
|
|
90
90
|
}
|
|
91
91
|
function getBusinessVerificationDetails(state, companyId) {
|
|
92
92
|
const { setupViewState, countryListState } = state;
|
|
93
|
-
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, updateStatus, } = setupViewState;
|
|
93
|
+
const { companyDetails, companyOfficerUpdateStatus, kycKybResetStatus, primaryContactDetails, updateStatus, } = setupViewState;
|
|
94
94
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
95
95
|
const { companyDetailsLocalData, companyOfficerLocalData, parsingDocumentFileIds, } = (0, exports.getCompanyAndIdentityDetails)(state, companyId, {
|
|
96
96
|
companyDetails,
|
|
@@ -105,6 +105,7 @@ function getBusinessVerificationDetails(state, companyId) {
|
|
|
105
105
|
parsingDocumentFileIds,
|
|
106
106
|
companyView,
|
|
107
107
|
updateStatus,
|
|
108
|
+
kycKybResetStatus,
|
|
108
109
|
allNationalityCountries,
|
|
109
110
|
};
|
|
110
111
|
}
|
|
@@ -185,6 +185,7 @@ export interface CompanyAndIdentityDetails {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
export interface SetupViewState extends CompanyAndIdentityDetails {
|
|
188
|
+
kycKybResetStatus: FetchStateAndError;
|
|
188
189
|
/**
|
|
189
190
|
* File IDs currently being parsed by the AI autofill epic. Populated when
|
|
190
191
|
* `parseUploadedKyc/KybDocument` dispatches and cleared when the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.66-beta0MM",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|