@zeniai/client-epic-state 5.0.90-beta0ND → 5.0.90-betaAR2
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/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +0 -1
- package/lib/entity/approvalRule/approvalRuleConflict.d.ts +56 -0
- package/lib/entity/approvalRule/approvalRuleConflict.js +77 -0
- package/lib/entity/approvalRule/approvalRulePayload.d.ts +34 -5
- package/lib/entity/approvalRule/approvalRulePayload.js +145 -10
- package/lib/entity/approvalRule/approvalRuleSelector.d.ts +25 -1
- package/lib/entity/approvalRule/approvalRuleSelector.js +40 -0
- package/lib/entity/approvalRule/approvalRuleState.d.ts +59 -7
- package/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +0 -4
- package/lib/entity/company/companyStateTypes.d.ts +0 -4
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +5 -65
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/epic.d.ts +5 -8
- package/lib/epic.js +5 -9
- package/lib/esm/commonStateTypes/animations.js +0 -1
- package/lib/esm/entity/approvalRule/approvalRuleConflict.js +74 -0
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +145 -10
- package/lib/esm/entity/approvalRule/approvalRuleSelector.js +35 -0
- package/lib/esm/entity/company/companyPayload.js +0 -4
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -3
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/tenant/tenantReducer.js +3 -63
- package/lib/esm/epic.js +5 -9
- package/lib/esm/index.js +13 -14
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +50 -217
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +1 -7
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +0 -12
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +92 -12
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +11 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +54 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +13 -4
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +122 -16
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +7 -2
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -105
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +11 -7
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +49 -0
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +13 -4
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +71 -11
- package/lib/index.d.ts +15 -17
- package/lib/index.js +42 -51
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +4 -41
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -219
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -5
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +2 -11
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -40
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +1 -13
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +14 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +93 -13
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +16 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +10 -6
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +23 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +58 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +12 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +50 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +124 -17
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +31 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +7 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -106
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +10 -6
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +14 -0
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +53 -0
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +12 -3
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +14 -3
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +72 -12
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +12 -0
- package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -54
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -50
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -42
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -52
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -59
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -205
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -28
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -46
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -56
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -30
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -63
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -33
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -213
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -125
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -32
package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearRemiSetupApproverView = exports.clearRemiSetupApproverViewUpdateData = exports.setListeningToPusherEvent = exports.saveRemiSetupApproverViewUpdateData = exports.initializeRemiSetupApproverViewUpdateData = exports.saveRemiSetupApproverViewUpdatesFailure = exports.saveRemiSetupApproverViewUpdatesSuccess = exports.saveRemiSetupApproverViewUpdates = exports.deleteRemiApprovalRuleFailure = exports.deleteRemiApprovalRuleSuccess = exports.deleteRemiApprovalRule = exports.fetchRemiApproversListFailure = exports.fetchRemiApproversListSuccess = exports.fetchRemiApproversList = exports.fetchRemiApproversDetails = exports.fetchRemiSetupApproverViewFailure = exports.fetchRemiSetupApproverViewSuccess = exports.fetchRemiSetupApproverView = exports.initialState = void 0;
|
|
4
|
+
exports.clearRemiSetupApproverView = exports.clearRemiSetupApproverViewUpdateData = exports.setListeningToPusherEvent = exports.saveRemiSetupApproverViewUpdateData = exports.initializeRemiSetupApproverViewUpdateData = exports.saveRemiSetupApproverViewUpdatesFailure = exports.saveRemiSetupApproverViewUpdatesSuccess = exports.saveRemiSetupApproverViewUpdates = exports.reorderRemiApprovalRulesFailure = exports.reorderRemiApprovalRulesSuccess = exports.reorderRemiApprovalRules = exports.deleteRemiApprovalRuleFailure = exports.deleteRemiApprovalRuleSuccess = exports.deleteRemiApprovalRule = exports.fetchRemiApproversListFailure = exports.fetchRemiApproversListSuccess = exports.fetchRemiApproversList = exports.fetchRemiApproversDetails = exports.fetchRemiSetupApproverViewFailure = exports.fetchRemiSetupApproverViewSuccess = exports.fetchRemiSetupApproverView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialState = {
|
|
7
7
|
fetchState: 'Not-Started',
|
|
@@ -17,6 +17,7 @@ exports.initialState = {
|
|
|
17
17
|
newApprovalRuleId: undefined,
|
|
18
18
|
approvalRulesDeleteStatusById: {},
|
|
19
19
|
remiSetupApproverViewUpdateData: undefined,
|
|
20
|
+
reorderStatus: { fetchState: 'Not-Started', error: undefined },
|
|
20
21
|
hasValidState() {
|
|
21
22
|
return this.fetchState === 'Completed';
|
|
22
23
|
},
|
|
@@ -30,12 +31,16 @@ const remiSetupApproverView = (0, toolkit_1.createSlice)({
|
|
|
30
31
|
draft.fetchState = 'In-Progress';
|
|
31
32
|
draft.error = undefined;
|
|
32
33
|
},
|
|
33
|
-
|
|
34
|
+
// Approval Rules 3.0 — `useV3` arrives from the screen connector
|
|
35
|
+
// (`approval_rule_v3_config` dynamic config) and picks v1 vs v2
|
|
36
|
+
// endpoint in the fetch epic.
|
|
37
|
+
prepare(cacheOverride = false, resolveAttributeToUser = false, includeImplicitActors = false, useV3 = false) {
|
|
34
38
|
return {
|
|
35
39
|
payload: {
|
|
36
40
|
cacheOverride,
|
|
37
41
|
resolveAttributeToUser,
|
|
38
42
|
includeImplicitActors,
|
|
43
|
+
useV3,
|
|
39
44
|
},
|
|
40
45
|
};
|
|
41
46
|
},
|
|
@@ -138,8 +143,11 @@ const remiSetupApproverView = (0, toolkit_1.createSlice)({
|
|
|
138
143
|
error: undefined,
|
|
139
144
|
};
|
|
140
145
|
},
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
// Approval Rules 3.0 — `useV3` flows from the screen connector
|
|
147
|
+
// (`approval_rule_v3_config` dynamic config) so the delete epic
|
|
148
|
+
// can pick the v1 vs v2 endpoint.
|
|
149
|
+
prepare(approvalRuleId, useV3 = false) {
|
|
150
|
+
return { payload: { approvalRuleId, useV3 } };
|
|
143
151
|
},
|
|
144
152
|
},
|
|
145
153
|
deleteRemiApprovalRuleSuccess: {
|
|
@@ -171,13 +179,65 @@ const remiSetupApproverView = (0, toolkit_1.createSlice)({
|
|
|
171
179
|
};
|
|
172
180
|
},
|
|
173
181
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Approval Rules 3.0 — list-page drag-and-drop reorder.
|
|
184
|
+
* See BillPay equivalent for the longer rationale.
|
|
185
|
+
*/
|
|
186
|
+
reorderRemiApprovalRules: {
|
|
187
|
+
reducer(draft, action) {
|
|
188
|
+
const { approvalRuleIds } = action.payload;
|
|
189
|
+
draft.reorderStatus = { fetchState: 'In-Progress', error: undefined };
|
|
190
|
+
// Stash the pre-reorder order for synchronous rollback on
|
|
191
|
+
// 'Failure'. See the BillPay reducer for the rationale.
|
|
192
|
+
draft.reorderRollbackIds = draft.approvalRuleIds;
|
|
193
|
+
draft.approvalRuleIds = approvalRuleIds;
|
|
194
|
+
},
|
|
195
|
+
prepare(approvalRuleIds, useV3 = false) {
|
|
196
|
+
return { payload: { approvalRuleIds, useV3 } };
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
reorderRemiApprovalRulesSuccess: {
|
|
200
|
+
reducer(draft, action) {
|
|
201
|
+
const { approvalRuleIds } = action.payload;
|
|
202
|
+
draft.reorderStatus = { fetchState: 'Completed', error: undefined };
|
|
203
|
+
draft.approvalRuleIds = approvalRuleIds;
|
|
204
|
+
draft.reorderRollbackIds = undefined;
|
|
205
|
+
},
|
|
206
|
+
prepare(approvalRuleIds) {
|
|
207
|
+
return { payload: { approvalRuleIds } };
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
reorderRemiApprovalRulesFailure: {
|
|
211
|
+
reducer(draft, action) {
|
|
212
|
+
const { status } = action.payload;
|
|
213
|
+
draft.reorderStatus = { fetchState: 'Error', error: status };
|
|
214
|
+
if (draft.reorderRollbackIds != null) {
|
|
215
|
+
draft.approvalRuleIds = draft.reorderRollbackIds;
|
|
216
|
+
draft.reorderRollbackIds = undefined;
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
prepare(status) {
|
|
220
|
+
return { payload: { status } };
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
saveRemiSetupApproverViewUpdates: {
|
|
224
|
+
// Approval Rules 3.0 — `useV3` sourced from
|
|
225
|
+
// `approval_rule_v3_config` dynamic config in the screen
|
|
226
|
+
// connector; epic uses it to pick v1 vs v2 URL + mapper. The
|
|
227
|
+
// reducer doesn't read the action but the parameter must be
|
|
228
|
+
// declared so the action payload type carries downstream.
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
230
|
+
reducer(draft, _action) {
|
|
231
|
+
if (draft.remiSetupApproverViewUpdateData != null) {
|
|
232
|
+
draft.remiSetupApproverViewUpdateData.updateStatus = {
|
|
233
|
+
fetchState: 'In-Progress',
|
|
234
|
+
error: undefined,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
prepare(useV3) {
|
|
239
|
+
return { payload: { useV3 } };
|
|
240
|
+
},
|
|
181
241
|
},
|
|
182
242
|
saveRemiSetupApproverViewUpdatesSuccess: {
|
|
183
243
|
reducer(draft, action) {
|
|
@@ -266,5 +326,5 @@ const remiSetupApproverView = (0, toolkit_1.createSlice)({
|
|
|
266
326
|
},
|
|
267
327
|
},
|
|
268
328
|
});
|
|
269
|
-
_a = remiSetupApproverView.actions, exports.fetchRemiSetupApproverView = _a.fetchRemiSetupApproverView, exports.fetchRemiSetupApproverViewSuccess = _a.fetchRemiSetupApproverViewSuccess, exports.fetchRemiSetupApproverViewFailure = _a.fetchRemiSetupApproverViewFailure, exports.fetchRemiApproversDetails = _a.fetchRemiApproversDetails, exports.fetchRemiApproversList = _a.fetchRemiApproversList, exports.fetchRemiApproversListSuccess = _a.fetchRemiApproversListSuccess, exports.fetchRemiApproversListFailure = _a.fetchRemiApproversListFailure, exports.deleteRemiApprovalRule = _a.deleteRemiApprovalRule, exports.deleteRemiApprovalRuleSuccess = _a.deleteRemiApprovalRuleSuccess, exports.deleteRemiApprovalRuleFailure = _a.deleteRemiApprovalRuleFailure, exports.saveRemiSetupApproverViewUpdates = _a.saveRemiSetupApproverViewUpdates, exports.saveRemiSetupApproverViewUpdatesSuccess = _a.saveRemiSetupApproverViewUpdatesSuccess, exports.saveRemiSetupApproverViewUpdatesFailure = _a.saveRemiSetupApproverViewUpdatesFailure, exports.initializeRemiSetupApproverViewUpdateData = _a.initializeRemiSetupApproverViewUpdateData, exports.saveRemiSetupApproverViewUpdateData = _a.saveRemiSetupApproverViewUpdateData, exports.setListeningToPusherEvent = _a.setListeningToPusherEvent, exports.clearRemiSetupApproverViewUpdateData = _a.clearRemiSetupApproverViewUpdateData, exports.clearRemiSetupApproverView = _a.clearRemiSetupApproverView;
|
|
329
|
+
_a = remiSetupApproverView.actions, exports.fetchRemiSetupApproverView = _a.fetchRemiSetupApproverView, exports.fetchRemiSetupApproverViewSuccess = _a.fetchRemiSetupApproverViewSuccess, exports.fetchRemiSetupApproverViewFailure = _a.fetchRemiSetupApproverViewFailure, exports.fetchRemiApproversDetails = _a.fetchRemiApproversDetails, exports.fetchRemiApproversList = _a.fetchRemiApproversList, exports.fetchRemiApproversListSuccess = _a.fetchRemiApproversListSuccess, exports.fetchRemiApproversListFailure = _a.fetchRemiApproversListFailure, exports.deleteRemiApprovalRule = _a.deleteRemiApprovalRule, exports.deleteRemiApprovalRuleSuccess = _a.deleteRemiApprovalRuleSuccess, exports.deleteRemiApprovalRuleFailure = _a.deleteRemiApprovalRuleFailure, exports.reorderRemiApprovalRules = _a.reorderRemiApprovalRules, exports.reorderRemiApprovalRulesSuccess = _a.reorderRemiApprovalRulesSuccess, exports.reorderRemiApprovalRulesFailure = _a.reorderRemiApprovalRulesFailure, exports.saveRemiSetupApproverViewUpdates = _a.saveRemiSetupApproverViewUpdates, exports.saveRemiSetupApproverViewUpdatesSuccess = _a.saveRemiSetupApproverViewUpdatesSuccess, exports.saveRemiSetupApproverViewUpdatesFailure = _a.saveRemiSetupApproverViewUpdatesFailure, exports.initializeRemiSetupApproverViewUpdateData = _a.initializeRemiSetupApproverViewUpdateData, exports.saveRemiSetupApproverViewUpdateData = _a.saveRemiSetupApproverViewUpdateData, exports.setListeningToPusherEvent = _a.setListeningToPusherEvent, exports.clearRemiSetupApproverViewUpdateData = _a.clearRemiSetupApproverViewUpdateData, exports.clearRemiSetupApproverView = _a.clearRemiSetupApproverView;
|
|
270
330
|
exports.default = remiSetupApproverView.reducer;
|
package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts
CHANGED
|
@@ -10,8 +10,20 @@ export interface RemiSetupApproverViewState extends FetchedState {
|
|
|
10
10
|
fetchStatus: FetchStateAndError;
|
|
11
11
|
attributeSubTypeToUserIdMapping?: Record<AttributeType, ID>;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* List-page reorder PUT status. See BillPay equivalent for the
|
|
15
|
+
* longer rationale.
|
|
16
|
+
*/
|
|
17
|
+
reorderStatus: FetchStateAndError;
|
|
13
18
|
affectedEntityIds?: ID[];
|
|
14
19
|
listeningToPusherEvent?: boolean;
|
|
15
20
|
newApprovalRuleId?: ID;
|
|
16
21
|
remiSetupApproverViewUpdateData?: ApproverViewUpdateData;
|
|
22
|
+
/**
|
|
23
|
+
* Pre-reorder snapshot of 'approvalRuleIds'. Stashed on the trigger
|
|
24
|
+
* reducer right before the optimistic mutation and consumed on
|
|
25
|
+
* Failure to restore the previous order without waiting for the
|
|
26
|
+
* epic's safety-net refetch. Cleared on Success.
|
|
27
|
+
*/
|
|
28
|
+
reorderRollbackIds?: ID[];
|
|
17
29
|
}
|
|
@@ -50,15 +50,15 @@ export interface TaskFilterCategory {
|
|
|
50
50
|
}
|
|
51
51
|
export type TaskListFilterCategoryField = 'status' | 'dueDate' | 'assignee' | 'creationDate' | 'priority' | 'tag';
|
|
52
52
|
export declare const TASK_LIST_GROUP_BY_KEYS: readonly ["groupName", "status", "dueDate", "assignee", "priority", "tag"];
|
|
53
|
-
export declare const toTaskListGroupByKeyType: (v: string) => "status" | "
|
|
54
|
-
export declare const toTaskListGroupByKeyTypeStrict: (v: string) => "status" | "
|
|
53
|
+
export declare const toTaskListGroupByKeyType: (v: string) => "status" | "priority" | "dueDate" | "groupName" | "tag" | "assignee";
|
|
54
|
+
export declare const toTaskListGroupByKeyTypeStrict: (v: string) => "status" | "priority" | "dueDate" | "groupName" | "tag" | "assignee" | undefined;
|
|
55
55
|
export declare type TaskGroupKey = ReturnType<typeof toTaskListGroupByKeyType>;
|
|
56
56
|
export interface TaskListUIState extends SpendManagementUIState {
|
|
57
57
|
groupByKey: TaskGroupKey;
|
|
58
58
|
searchText: string;
|
|
59
59
|
sortKey: TaskListViewSortKey;
|
|
60
60
|
}
|
|
61
|
-
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "
|
|
61
|
+
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "priority" | "dueDate" | "tag" | "timeSpent" | "assignee" | "creationDate" | "visibility";
|
|
62
62
|
export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
|
|
63
63
|
export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
|
|
64
64
|
interface TaskListFilterCategoryOption {
|
|
@@ -8,7 +8,7 @@ import { JournalEntryTransactionLine, Line, TransactionLineBase } from '../../en
|
|
|
8
8
|
* is testable and reusable.
|
|
9
9
|
*/
|
|
10
10
|
export declare const JOURNAL_ENTRY_SORT_KEYS: readonly ["description", "name", "category", "class", "debit", "credit"];
|
|
11
|
-
export declare const toJournalEntrySortKey: (v: string) => "
|
|
11
|
+
export declare const toJournalEntrySortKey: (v: string) => "description" | "name" | "category" | "class" | "credit" | "debit";
|
|
12
12
|
export type JournalEntrySortKey = ReturnType<typeof toJournalEntrySortKey>;
|
|
13
13
|
export interface JournalEntryRowSortConfig {
|
|
14
14
|
sortKey: JournalEntrySortKey;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.90-
|
|
3
|
+
"version": "5.0.90-betaAR2",
|
|
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",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { RootState } from '../../../reducer';
|
|
3
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import { initEmailConnectOAuth, initEmailConnectOAuthFailure, initEmailConnectOAuthSuccess } from '../tenantReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof initEmailConnectOAuth> | ReturnType<typeof initEmailConnectOAuthSuccess> | ReturnType<typeof initEmailConnectOAuthFailure>;
|
|
6
|
-
export type NavigateFn = (url: string) => void;
|
|
7
|
-
export declare const initEmailConnectOAuthEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI, navigate?: NavigateFn) => import("rxjs").Observable<{
|
|
8
|
-
payload: {
|
|
9
|
-
tenantId: string;
|
|
10
|
-
provider: "gmail" | "outlook";
|
|
11
|
-
authorizationUrl: string;
|
|
12
|
-
};
|
|
13
|
-
type: "tenant/initEmailConnectOAuthSuccess";
|
|
14
|
-
} | {
|
|
15
|
-
payload: {
|
|
16
|
-
tenantId: string;
|
|
17
|
-
provider: "gmail" | "outlook";
|
|
18
|
-
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
|
-
};
|
|
20
|
-
type: "tenant/initEmailConnectOAuthFailure";
|
|
21
|
-
}>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initEmailConnectOAuthEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const tenantReducer_1 = require("../tenantReducer");
|
|
8
|
-
const defaultNavigate = (url) => {
|
|
9
|
-
// Production path: full-page redirect. The user's session continues on the
|
|
10
|
-
// provider's consent screen and lands back on this app via auth's HTML
|
|
11
|
-
// callback page (which itself redirects to redirect_after_url with the
|
|
12
|
-
// result encoded as a query param).
|
|
13
|
-
if (typeof window !== 'undefined') {
|
|
14
|
-
window.location.href = url;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
// Backs the new POST /1.0/connectors/email/<provider>/init endpoint on the
|
|
18
|
-
// auth service. The endpoint creates a CSRF state token in the auth NDB
|
|
19
|
-
// store and returns the provider's authorization_url; this epic then drives
|
|
20
|
-
// a full-page redirect so the user lands on Google's / Microsoft's consent
|
|
21
|
-
// screen. After consent the user lands on auth's callback, which writes the
|
|
22
|
-
// resulting tokens through to tenant and redirects the browser back to
|
|
23
|
-
// ``redirectAfterUrl`` with ``?email_connect_result=<json>`` for the
|
|
24
|
-
// integrations page to consume on mount.
|
|
25
|
-
const initEmailConnectOAuthEpic = (actions$, _state$, zeniAPI,
|
|
26
|
-
// Test seam: callers can override to assert intended URL without actually
|
|
27
|
-
// navigating. Default is full-page redirect via window.location.
|
|
28
|
-
navigate = defaultNavigate) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.initEmailConnectOAuth.match), (0, operators_1.switchMap)((action) => zeniAPI
|
|
29
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/email/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
|
|
30
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
31
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
32
|
-
// Fire-and-forget side effect — once the browser navigates,
|
|
33
|
-
// any further state we'd dispatch here is irrelevant. We still
|
|
34
|
-
// emit the success action so subscribers (tests, analytics)
|
|
35
|
-
// can observe the URL the epic decided to navigate to.
|
|
36
|
-
navigate(response.data.authorization_url);
|
|
37
|
-
return (0, rxjs_1.from)([
|
|
38
|
-
(0, tenantReducer_1.initEmailConnectOAuthSuccess)(action.payload.tenantId, action.payload.provider, response.data.authorization_url),
|
|
39
|
-
]);
|
|
40
|
-
}
|
|
41
|
-
const status = response.status ??
|
|
42
|
-
(0, responsePayload_1.createZeniAPIStatus)(`Failed to start ${action.payload.provider} connection. Please try again.`);
|
|
43
|
-
return (0, rxjs_1.from)([
|
|
44
|
-
(0, tenantReducer_1.initEmailConnectOAuthFailure)(action.payload.tenantId, action.payload.provider, status),
|
|
45
|
-
]);
|
|
46
|
-
}), (0, operators_1.catchError)((error) => {
|
|
47
|
-
const message = error instanceof Error
|
|
48
|
-
? error.message
|
|
49
|
-
: `Unexpected error starting ${action.payload.provider} connection.`;
|
|
50
|
-
return (0, rxjs_1.from)([
|
|
51
|
-
(0, tenantReducer_1.initEmailConnectOAuthFailure)(action.payload.tenantId, action.payload.provider, (0, responsePayload_1.createZeniAPIStatus)(message)),
|
|
52
|
-
]);
|
|
53
|
-
}))));
|
|
54
|
-
exports.initEmailConnectOAuthEpic = initEmailConnectOAuthEpic;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { from } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
|
|
4
|
-
import { initEmailConnectOAuth, initEmailConnectOAuthFailure, initEmailConnectOAuthSuccess, } from '../tenantReducer';
|
|
5
|
-
const defaultNavigate = (url) => {
|
|
6
|
-
// Production path: full-page redirect. The user's session continues on the
|
|
7
|
-
// provider's consent screen and lands back on this app via auth's HTML
|
|
8
|
-
// callback page (which itself redirects to redirect_after_url with the
|
|
9
|
-
// result encoded as a query param).
|
|
10
|
-
if (typeof window !== 'undefined') {
|
|
11
|
-
window.location.href = url;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
// Backs the new POST /1.0/connectors/email/<provider>/init endpoint on the
|
|
15
|
-
// auth service. The endpoint creates a CSRF state token in the auth NDB
|
|
16
|
-
// store and returns the provider's authorization_url; this epic then drives
|
|
17
|
-
// a full-page redirect so the user lands on Google's / Microsoft's consent
|
|
18
|
-
// screen. After consent the user lands on auth's callback, which writes the
|
|
19
|
-
// resulting tokens through to tenant and redirects the browser back to
|
|
20
|
-
// ``redirectAfterUrl`` with ``?email_connect_result=<json>`` for the
|
|
21
|
-
// integrations page to consume on mount.
|
|
22
|
-
export const initEmailConnectOAuthEpic = (actions$, _state$, zeniAPI,
|
|
23
|
-
// Test seam: callers can override to assert intended URL without actually
|
|
24
|
-
// navigating. Default is full-page redirect via window.location.
|
|
25
|
-
navigate = defaultNavigate) => actions$.pipe(filter(initEmailConnectOAuth.match), switchMap((action) => zeniAPI
|
|
26
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/email/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
|
|
27
|
-
.pipe(mergeMap((response) => {
|
|
28
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
29
|
-
// Fire-and-forget side effect — once the browser navigates,
|
|
30
|
-
// any further state we'd dispatch here is irrelevant. We still
|
|
31
|
-
// emit the success action so subscribers (tests, analytics)
|
|
32
|
-
// can observe the URL the epic decided to navigate to.
|
|
33
|
-
navigate(response.data.authorization_url);
|
|
34
|
-
return from([
|
|
35
|
-
initEmailConnectOAuthSuccess(action.payload.tenantId, action.payload.provider, response.data.authorization_url),
|
|
36
|
-
]);
|
|
37
|
-
}
|
|
38
|
-
const status = response.status ??
|
|
39
|
-
createZeniAPIStatus(`Failed to start ${action.payload.provider} connection. Please try again.`);
|
|
40
|
-
return from([
|
|
41
|
-
initEmailConnectOAuthFailure(action.payload.tenantId, action.payload.provider, status),
|
|
42
|
-
]);
|
|
43
|
-
}), catchError((error) => {
|
|
44
|
-
const message = error instanceof Error
|
|
45
|
-
? error.message
|
|
46
|
-
: `Unexpected error starting ${action.payload.provider} connection.`;
|
|
47
|
-
return from([
|
|
48
|
-
initEmailConnectOAuthFailure(action.payload.tenantId, action.payload.provider, createZeniAPIStatus(message)),
|
|
49
|
-
]);
|
|
50
|
-
}))));
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
4
|
-
import { fetchAiAgentsActivationStatus, fetchAiAgentsActivationStatusFailure, fetchAiAgentsActivationStatusSuccess, } from '../../onboardingCustomerViewReducer';
|
|
5
|
-
const toPhaseStatus = (raw) => {
|
|
6
|
-
if (raw === 'idle' ||
|
|
7
|
-
raw === 'starting' ||
|
|
8
|
-
raw === 'building' ||
|
|
9
|
-
raw === 'ready') {
|
|
10
|
-
return raw;
|
|
11
|
-
}
|
|
12
|
-
return 'idle';
|
|
13
|
-
};
|
|
14
|
-
const toPhase = (row) => ({
|
|
15
|
-
key: row.key,
|
|
16
|
-
status: toPhaseStatus(row.status),
|
|
17
|
-
startedAt: row.started_at,
|
|
18
|
-
completedAt: row.completed_at,
|
|
19
|
-
});
|
|
20
|
-
const toCounts = (payload) => ({
|
|
21
|
-
customerCount: payload?.customer_count ?? 0,
|
|
22
|
-
glAccountCount: payload?.gl_account_count ?? 0,
|
|
23
|
-
targetTransactionCount: payload?.target_transaction_count ?? 0,
|
|
24
|
-
transactionCount: payload?.transaction_count ?? 0,
|
|
25
|
-
vendorCount: payload?.vendor_count ?? 0,
|
|
26
|
-
});
|
|
27
|
-
export const fetchAiAgentsActivationStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchAiAgentsActivationStatus.match), mergeMap(() => {
|
|
28
|
-
const url = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/ai-agents-activation/status`;
|
|
29
|
-
return zeniAPI
|
|
30
|
-
.getJSON(url)
|
|
31
|
-
.pipe(mergeMap((response) => {
|
|
32
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
33
|
-
const phases = (response.data.phases ?? []).map(toPhase);
|
|
34
|
-
return of(fetchAiAgentsActivationStatusSuccess({
|
|
35
|
-
phases,
|
|
36
|
-
counts: toCounts(response.data.counts),
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
return of(fetchAiAgentsActivationStatusFailure(response.status));
|
|
40
|
-
}), catchError((error) => of(fetchAiAgentsActivationStatusFailure(createZeniAPIStatus('Unexpected Error', 'fetchAiAgentsActivationStatus errored out ' +
|
|
41
|
-
JSON.stringify(error))))));
|
|
42
|
-
}));
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { updateCompanies } from '../../../../../entity/company/companyReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
5
|
-
import { acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiActivationViewedFailure, acknowledgeOnboardingAiActivationViewedSuccess, } from '../../onboardingCustomerViewReducer';
|
|
6
|
-
export const acknowledgeOnboardingAiActivationViewedEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(acknowledgeOnboardingAiActivationViewed.match), mergeMap((action) => {
|
|
7
|
-
const { companyId } = action.payload;
|
|
8
|
-
const payload = {
|
|
9
|
-
is_onboarding_ai_activation_viewed: true,
|
|
10
|
-
};
|
|
11
|
-
return zeniAPI
|
|
12
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
13
|
-
.pipe(mergeMap((response) => {
|
|
14
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
15
|
-
const actions = [
|
|
16
|
-
updateCompanies({
|
|
17
|
-
payload: response.data.companies,
|
|
18
|
-
schema: {},
|
|
19
|
-
}),
|
|
20
|
-
acknowledgeOnboardingAiActivationViewedSuccess(),
|
|
21
|
-
];
|
|
22
|
-
return from(actions);
|
|
23
|
-
}
|
|
24
|
-
return of(acknowledgeOnboardingAiActivationViewedFailure(response.status));
|
|
25
|
-
}),
|
|
26
|
-
// Best-effort — failure is silent; cascade just runs again next visit.
|
|
27
|
-
catchError((error) => of(acknowledgeOnboardingAiActivationViewedFailure(createZeniAPIStatus('Unexpected Error', 'Acknowledge - Onboarding AI Activation Viewed errored out' +
|
|
28
|
-
JSON.stringify(error))))));
|
|
29
|
-
}));
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { updateCompanies } from '../../../../../entity/company/companyReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
6
|
-
import { acknowledgeOnboardingAiFinanceTeam, acknowledgeOnboardingAiFinanceTeamFailure, acknowledgeOnboardingAiFinanceTeamSuccess, } from '../../onboardingCustomerViewReducer';
|
|
7
|
-
export const acknowledgeOnboardingAiFinanceTeamEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(acknowledgeOnboardingAiFinanceTeam.match), mergeMap((action) => {
|
|
8
|
-
const { companyId } = action.payload;
|
|
9
|
-
const payload = {
|
|
10
|
-
is_onboarding_ai_finance_team_acknowledged: true,
|
|
11
|
-
};
|
|
12
|
-
return zeniAPI
|
|
13
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
14
|
-
.pipe(mergeMap((response) => {
|
|
15
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
16
|
-
const actions = [
|
|
17
|
-
updateCompanies({
|
|
18
|
-
payload: response.data.companies,
|
|
19
|
-
schema: {},
|
|
20
|
-
}),
|
|
21
|
-
acknowledgeOnboardingAiFinanceTeamSuccess(),
|
|
22
|
-
];
|
|
23
|
-
return from(actions);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return of(openSnackbar({
|
|
27
|
-
messageSection: 'onboarding_customer_view_complete',
|
|
28
|
-
messageText: 'failed',
|
|
29
|
-
type: 'error',
|
|
30
|
-
variables: [
|
|
31
|
-
{
|
|
32
|
-
variableName: '_api-error_',
|
|
33
|
-
variableValue: response.status.message,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
}), acknowledgeOnboardingAiFinanceTeamFailure(response.status));
|
|
37
|
-
}
|
|
38
|
-
}), catchError((error) => of(acknowledgeOnboardingAiFinanceTeamFailure(createZeniAPIStatus('Unexpected Error', 'Acknowledge - Onboarding AI Finance Team errored out' +
|
|
39
|
-
JSON.stringify(error))))));
|
|
40
|
-
}));
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { isSuccessResponse } from '../../../../../responsePayload';
|
|
4
|
-
import { applyKybDocumentAutofillForOnboarding } from '../../../../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
5
|
-
import { parseUploadedKybDocument, parseUploadedKybDocumentFailure, } from '../../kycKybAutofillActions';
|
|
6
|
-
import { mapCoiToCompanyDetails, mapTaxEinToCompanyDetails, } from '../../kycKybParseMapper';
|
|
7
|
-
import { applyKybDocumentAutofillForSetup } from '../../setupViewReducer';
|
|
8
|
-
const PROCESS_DOCUMENT_SYNC_PATH = '/1.0/documents/process/sync';
|
|
9
|
-
export const parseUploadedKybDocumentEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(parseUploadedKybDocument.match), mergeMap((action) => {
|
|
10
|
-
const { target, companyId, fileId, documentType } = action.payload;
|
|
11
|
-
const url = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}${PROCESS_DOCUMENT_SYNC_PATH}`;
|
|
12
|
-
const requestPayload = {
|
|
13
|
-
provided_document_type: documentType,
|
|
14
|
-
files: [{ file_id: fileId }],
|
|
15
|
-
processing_priority: 10,
|
|
16
|
-
metadata: { source: 'kyc_kyb_autofill' },
|
|
17
|
-
};
|
|
18
|
-
const failureAction = parseUploadedKybDocumentFailure({ target, fileId });
|
|
19
|
-
return zeniAPI
|
|
20
|
-
.postAndGetJSON(url, requestPayload)
|
|
21
|
-
.pipe(mergeMap((response) => {
|
|
22
|
-
if (!isSuccessResponse(response) || response.data == null) {
|
|
23
|
-
return of(failureAction);
|
|
24
|
-
}
|
|
25
|
-
let result;
|
|
26
|
-
switch (documentType) {
|
|
27
|
-
case 'certificate_of_incorporation':
|
|
28
|
-
result = mapCoiToCompanyDetails(response.data);
|
|
29
|
-
break;
|
|
30
|
-
case 'tax_ein':
|
|
31
|
-
result = mapTaxEinToCompanyDetails(response.data);
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
if (result.autoFilledFieldNames.length === 0) {
|
|
35
|
-
return of(failureAction);
|
|
36
|
-
}
|
|
37
|
-
const applyAction = target === 'setup'
|
|
38
|
-
? applyKybDocumentAutofillForSetup({
|
|
39
|
-
companyId,
|
|
40
|
-
fileId,
|
|
41
|
-
values: result.values,
|
|
42
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
43
|
-
})
|
|
44
|
-
: applyKybDocumentAutofillForOnboarding({
|
|
45
|
-
companyId,
|
|
46
|
-
fileId,
|
|
47
|
-
values: result.values,
|
|
48
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
49
|
-
});
|
|
50
|
-
return of(applyAction);
|
|
51
|
-
}), catchError(() => of(failureAction)));
|
|
52
|
-
}));
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { getCountryList } from '../../../../../entity/countryList/countryListSelector';
|
|
4
|
-
import { isSuccessResponse } from '../../../../../responsePayload';
|
|
5
|
-
import { applyKycDocumentAutofillForOnboarding } from '../../../../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
6
|
-
import { parseUploadedKycDocument, parseUploadedKycDocumentFailure, } from '../../kycKybAutofillActions';
|
|
7
|
-
import { mapDrivingLicenseToOfficer, mapPassportToOfficer, mapSsnCardToOfficer, } from '../../kycKybParseMapper';
|
|
8
|
-
import { applyKycDocumentAutofillForSetup } from '../../setupViewReducer';
|
|
9
|
-
const PROCESS_DOCUMENT_SYNC_PATH = '/1.0/documents/process/sync';
|
|
10
|
-
export const parseUploadedKycDocumentEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(parseUploadedKycDocument.match), mergeMap((action) => {
|
|
11
|
-
const { target, companyId, officerType, fileId, documentType } = action.payload;
|
|
12
|
-
const url = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}${PROCESS_DOCUMENT_SYNC_PATH}`;
|
|
13
|
-
const requestPayload = {
|
|
14
|
-
provided_document_type: documentType,
|
|
15
|
-
files: [{ file_id: fileId }],
|
|
16
|
-
processing_priority: 10,
|
|
17
|
-
metadata: { source: 'kyc_kyb_autofill' },
|
|
18
|
-
};
|
|
19
|
-
const failureAction = parseUploadedKycDocumentFailure({ target, fileId });
|
|
20
|
-
return zeniAPI
|
|
21
|
-
.postAndGetJSON(url, requestPayload)
|
|
22
|
-
.pipe(mergeMap((response) => {
|
|
23
|
-
if (!isSuccessResponse(response) || response.data == null) {
|
|
24
|
-
return of(failureAction);
|
|
25
|
-
}
|
|
26
|
-
const allCountries = getCountryList(state$.value.countryListState, 'nationalityCountryList').countries;
|
|
27
|
-
let result;
|
|
28
|
-
switch (documentType) {
|
|
29
|
-
case 'passport':
|
|
30
|
-
result = mapPassportToOfficer(response.data, allCountries);
|
|
31
|
-
break;
|
|
32
|
-
case 'driving_license':
|
|
33
|
-
result = mapDrivingLicenseToOfficer(response.data);
|
|
34
|
-
break;
|
|
35
|
-
case 'social_security_card':
|
|
36
|
-
result = mapSsnCardToOfficer(response.data);
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
if (result.autoFilledFieldNames.length === 0) {
|
|
40
|
-
return of(failureAction);
|
|
41
|
-
}
|
|
42
|
-
const applyAction = target === 'setup'
|
|
43
|
-
? applyKycDocumentAutofillForSetup({
|
|
44
|
-
companyId,
|
|
45
|
-
officerType,
|
|
46
|
-
fileId,
|
|
47
|
-
values: result.values,
|
|
48
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
49
|
-
})
|
|
50
|
-
: applyKycDocumentAutofillForOnboarding({
|
|
51
|
-
companyId,
|
|
52
|
-
officerType,
|
|
53
|
-
fileId,
|
|
54
|
-
values: result.values,
|
|
55
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
56
|
-
});
|
|
57
|
-
return of(applyAction);
|
|
58
|
-
}), catchError(() => of(failureAction)));
|
|
59
|
-
}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trigger actions for the KYC / KYB autofill epics.
|
|
3
|
-
*
|
|
4
|
-
* These actions don't mutate state — the epic listens for them, calls
|
|
5
|
-
* document-communication-agent's sync endpoint, and dispatches the appropriate
|
|
6
|
-
* `applyKyc/KybDocumentAutofillFor{Setup,Onboarding}` against the matching
|
|
7
|
-
* slice. Co-located with the rest of the commonSetup module because the entire
|
|
8
|
-
* autofill flow is auxiliary to the setup view; there is no separate state.
|
|
9
|
-
*/
|
|
10
|
-
import { createAction } from '@reduxjs/toolkit';
|
|
11
|
-
export const parseUploadedKycDocument = createAction('commonSetup/parseUploadedKycDocument');
|
|
12
|
-
export const parseUploadedKybDocument = createAction('commonSetup/parseUploadedKybDocument');
|
|
13
|
-
export const parseUploadedKycDocumentFailure = createAction('commonSetup/parseUploadedKycDocumentFailure');
|
|
14
|
-
export const parseUploadedKybDocumentFailure = createAction('commonSetup/parseUploadedKybDocumentFailure');
|