@zeniai/client-epic-state 5.0.85-betaAR1 → 5.0.85-betaAR3

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.
Files changed (64) hide show
  1. package/lib/entity/approvalRule/approvalRulePayload.d.ts +5 -34
  2. package/lib/entity/approvalRule/approvalRulePayload.js +10 -130
  3. package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
  4. package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
  5. package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -59
  6. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  7. package/lib/entity/snackbar/snackbarTypes.js +0 -2
  8. package/lib/epic.d.ts +1 -3
  9. package/lib/epic.js +1 -3
  10. package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -130
  11. package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
  12. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
  13. package/lib/esm/epic.js +1 -3
  14. package/lib/esm/index.js +5 -7
  15. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +66 -18
  16. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +12 -74
  17. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
  18. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
  19. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
  20. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +4 -13
  21. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -122
  22. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  23. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
  24. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
  25. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
  26. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +4 -13
  27. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +11 -63
  28. package/lib/index.d.ts +6 -8
  29. package/lib/index.js +16 -26
  30. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  31. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  32. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  33. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +66 -18
  34. package/lib/view/people/peopleTypes.d.ts +1 -1
  35. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +3 -14
  36. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +13 -75
  37. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +0 -8
  38. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
  39. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
  40. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
  41. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +3 -12
  42. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -50
  43. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +17 -124
  44. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
  45. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  46. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  47. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
  48. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
  49. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
  50. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +3 -12
  51. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +3 -14
  52. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +12 -64
  53. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +0 -5
  54. package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
  55. package/package.json +1 -1
  56. package/lib/entity/approvalRule/approvalRuleConflict.d.ts +0 -56
  57. package/lib/entity/approvalRule/approvalRuleConflict.js +0 -77
  58. package/lib/esm/entity/approvalRule/approvalRuleConflict.js +0 -74
  59. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -54
  60. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -49
  61. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +0 -23
  62. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -58
  63. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +0 -14
  64. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -53
@@ -1,23 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
4
- import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
- import { RootState } from '../../../../../reducer';
6
- import { ZeniAPI } from '../../../../../zeniAPI';
7
- import { fetchBillPaySetupApproverView, reorderBillPayApprovalRules, reorderBillPayApprovalRulesFailure, reorderBillPayApprovalRulesSuccess } from '../billPaySetupApproverViewReducer';
8
- /**
9
- * Approval Rules 3.0 — list-page drag-and-drop reorder.
10
- *
11
- * PUT /bill-pay/approval-rules-v2/reorder with the new ID order in
12
- * 'rule_ids'. Returns the updated 'approval_rules' (with refreshed
13
- * priorities). The reducer optimistically updated 'approvalRuleIds'
14
- * on the trigger action, so:
15
- * - on success: dispatch the updated approval rule payloads into
16
- * the entity slice, then 'Success' to normalise the slice's
17
- * ordered ID list to whatever the server returned.
18
- * - on failure: snackbar + dispatch 'fetchBillPaySetupApproverView'
19
- * with cacheOverride to roll the optimistic state back to server
20
- * truth.
21
- */
22
- export type ActionType = ReturnType<typeof reorderBillPayApprovalRules> | ReturnType<typeof reorderBillPayApprovalRulesSuccess> | ReturnType<typeof reorderBillPayApprovalRulesFailure> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof openSnackbar>;
23
- export declare const reorderBillPayApprovalRulesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reorderBillPayApprovalRulesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
7
- const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
8
- const responsePayload_1 = require("../../../../../responsePayload");
9
- const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
10
- const reorderBillPayApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.reorderBillPayApprovalRules.match), (0, operators_1.switchMap)((action) => {
11
- const { approvalRuleIds, useV3 } = action.payload;
12
- // Approval Rules 3.0 — flag-gated endpoint selection. Mirrors
13
- // the pattern used by delete + fetch epics: the v3 dev host
14
- // until the production base URL ships the v2 reorder route.
15
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2/reorder`;
16
- return zeniAPI
17
- .putAndGetJSON(endpoint, {
18
- rule_ids: approvalRuleIds,
19
- })
20
- .pipe((0, operators_1.mergeMap)((response) => {
21
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
22
- const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
23
- const actions = [
24
- (0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
25
- (0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesSuccess)(serverOrderedIds),
26
- (0, snackbarReducer_1.openSnackbar)({
27
- messageSection: `bill_pay_approval_reorder`,
28
- messageText: 'success',
29
- type: 'success',
30
- }),
31
- ];
32
- return (0, rxjs_1.from)(actions);
33
- }
34
- else {
35
- const recovery = [
36
- (0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesFailure)(response.status),
37
- (0, snackbarReducer_1.openSnackbar)({
38
- messageSection: `bill_pay_approval_reorder`,
39
- messageText: 'failed',
40
- type: 'error',
41
- }),
42
- // Refetch to revert the optimistic order to server truth.
43
- (0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, useV3),
44
- ];
45
- return (0, rxjs_1.from)(recovery);
46
- }
47
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
48
- (0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Reorder Bill Pay Approval Rules errored out' +
49
- JSON.stringify(error))),
50
- (0, snackbarReducer_1.openSnackbar)({
51
- messageSection: `bill_pay_approval_reorder`,
52
- messageText: 'failed',
53
- type: 'error',
54
- }),
55
- (0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, useV3),
56
- ])));
57
- }));
58
- exports.reorderBillPayApprovalRulesEpic = reorderBillPayApprovalRulesEpic;
@@ -1,14 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
4
- import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
- import { RootState } from '../../../../../reducer';
6
- import { ZeniAPI } from '../../../../../zeniAPI';
7
- import { fetchRemiSetupApproverView, reorderRemiApprovalRules, reorderRemiApprovalRulesFailure, reorderRemiApprovalRulesSuccess } from '../remiSetupApproverViewReducer';
8
- /**
9
- * Approval Rules 3.0 — list-page drag-and-drop reorder for
10
- * reimbursements. Mirrors the BillPay reorder epic — see that file
11
- * for the longer rationale.
12
- */
13
- export type ActionType = ReturnType<typeof reorderRemiApprovalRules> | ReturnType<typeof reorderRemiApprovalRulesSuccess> | ReturnType<typeof reorderRemiApprovalRulesFailure> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchRemiSetupApproverView> | ReturnType<typeof openSnackbar>;
14
- export declare const reorderRemiApprovalRulesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reorderRemiApprovalRulesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
7
- const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
8
- const responsePayload_1 = require("../../../../../responsePayload");
9
- const remiSetupApproverViewReducer_1 = require("../remiSetupApproverViewReducer");
10
- const reorderRemiApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupApproverViewReducer_1.reorderRemiApprovalRules.match), (0, operators_1.switchMap)((action) => {
11
- const { approvalRuleIds, useV3 } = action.payload;
12
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules-v2/reorder`;
13
- return zeniAPI
14
- .putAndGetJSON(endpoint, {
15
- rule_ids: approvalRuleIds,
16
- })
17
- .pipe((0, operators_1.mergeMap)((response) => {
18
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
19
- const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
20
- const actions = [
21
- (0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
22
- (0, remiSetupApproverViewReducer_1.reorderRemiApprovalRulesSuccess)(serverOrderedIds),
23
- (0, snackbarReducer_1.openSnackbar)({
24
- messageSection: `reimbursement_approval_reorder`,
25
- messageText: 'success',
26
- type: 'success',
27
- }),
28
- ];
29
- return (0, rxjs_1.from)(actions);
30
- }
31
- else {
32
- return (0, rxjs_1.from)([
33
- (0, remiSetupApproverViewReducer_1.reorderRemiApprovalRulesFailure)(response.status),
34
- (0, snackbarReducer_1.openSnackbar)({
35
- messageSection: `reimbursement_approval_reorder`,
36
- messageText: 'failed',
37
- type: 'error',
38
- }),
39
- (0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, true, useV3),
40
- ]);
41
- }
42
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
43
- (0, remiSetupApproverViewReducer_1.reorderRemiApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Reorder Reimbursement Approval Rules errored out' +
44
- JSON.stringify(error))),
45
- (0, snackbarReducer_1.openSnackbar)({
46
- messageSection: `reimbursement_approval_reorder`,
47
- messageText: 'failed',
48
- type: 'error',
49
- }),
50
- (0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, true, useV3),
51
- ])));
52
- }));
53
- exports.reorderRemiApprovalRulesEpic = reorderRemiApprovalRulesEpic;