@zeniai/client-epic-state 4.12.78 → 4.12.80
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/billPay/billTransaction/billTransactionPayload.d.ts +10 -8
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +16 -14
- package/lib/entity/billPay/billTransaction/billTransactionReducer.js +1 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +13 -12
- package/lib/entity/billPay/billTransaction/billTransactionState.js +3 -3
- package/lib/entity/reimbursement/reimbursementPayload.d.ts +3 -1
- package/lib/entity/reimbursement/reimbursementPayload.js +3 -0
- package/lib/entity/reimbursement/reimbursementReducer.d.ts +2 -1
- package/lib/entity/reimbursement/reimbursementReducer.js +25 -2
- package/lib/entity/reimbursement/reimbursementState.d.ts +2 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/index.d.ts +9 -7
- package/lib/index.js +30 -14
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +4 -4
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +4 -4
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +1 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -1
- package/lib/view/spendManagement/helpers.d.ts +6 -1
- package/lib/view/spendManagement/helpers.js +24 -3
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +13 -10
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigPayload.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigReducer.js +3 -0
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigState.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +2 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +4 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +18 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +159 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/approveOrRejectRemisBulkActionEpic.d.ts +9 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/approveOrRejectRemisBulkActionEpic.js +80 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/cancelOrDeleteRemisBulkActionEpic.d.ts +8 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/cancelOrDeleteRemisBulkActionEpic.js +81 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/reviewDraftRemisBulkActionEpic.ts.d.ts +7 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/reviewDraftRemisBulkActionEpic.ts.js +29 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/submitDraftRemisBulkActionEpic.d.ts +8 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/submitDraftRemisBulkActionEpic.js +74 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewPayload.d.ts +14 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewPayload.js +2 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.d.ts +17 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.js +166 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewSelector.d.ts +25 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewSelector.js +46 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.d.ts +30 -0
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.js +24 -0
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,11 +3,23 @@ import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
|
3
3
|
import { TimePeriod } from '../../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { Reimbursement } from '../../../../entity/reimbursement/reimbursementState';
|
|
6
|
-
import { RemiTabType, SaveRemiStageCode, RemiListUIState, ReimbursementViewSortKey, RemiSubTabType, ReimbursementFilters } from './remiListState';
|
|
6
|
+
import { RemiTabType, SaveRemiStageCode, RemiListUIState, ReimbursementViewSortKey, RemiSubTabType, ReimbursementFilters, RemiBulkSelectExceptionInfoType } from './remiListState';
|
|
7
7
|
import { User, UserState } from '../../../../entity/user/userState';
|
|
8
8
|
import { EntityApprovalStatusState } from '../../../../entity/entityApprovalStatus/entityApprovalStatusState';
|
|
9
9
|
import { SortOrder } from '../../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
10
10
|
import { Approvers } from '../../../../entity/approvalRule/approvalRuleState';
|
|
11
|
+
import { BulkOperationType } from '../../helpers';
|
|
12
|
+
export interface RemiBulkSelectInfo {
|
|
13
|
+
isSelectableForBulkAction: boolean;
|
|
14
|
+
isSelectableForBulkActionSelectAll: boolean;
|
|
15
|
+
bulkSelectExceptionInfo?: RemiBulkSelectExceptionInfoType;
|
|
16
|
+
}
|
|
17
|
+
export interface RemiListBulkActionInfo {
|
|
18
|
+
isBulkActionAllowed: boolean;
|
|
19
|
+
allowedBulkActions: BulkOperationType[];
|
|
20
|
+
bulkSubmissionFetchState: FetchState;
|
|
21
|
+
remisSelectedForBulkAction: ID[];
|
|
22
|
+
}
|
|
11
23
|
export interface RemiListReport extends SelectorView {
|
|
12
24
|
reimbursements: ReimbursementView[];
|
|
13
25
|
createdByUserList: User[];
|
|
@@ -23,11 +35,15 @@ export interface RemiListReport extends SelectorView {
|
|
|
23
35
|
reimbursementBotEmail: string;
|
|
24
36
|
isDownloadEnabled: boolean;
|
|
25
37
|
createdByUserListFetchState: FetchState;
|
|
38
|
+
remiBulkSubmissionLimit: number;
|
|
39
|
+
remiListBulkActionInfo: RemiListBulkActionInfo;
|
|
26
40
|
}
|
|
27
41
|
export interface ReimbursementView extends Reimbursement {
|
|
28
42
|
submittedBy: User | undefined;
|
|
29
43
|
approvers: Approvers;
|
|
44
|
+
bulkSelectInfo?: RemiBulkSelectInfo;
|
|
30
45
|
}
|
|
31
|
-
export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod) => RemiListReport;
|
|
46
|
+
export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
|
|
32
47
|
export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
|
|
33
48
|
export declare const getRemiListOnSort: (sortKey: ReimbursementViewSortKey, sortOrder: SortOrder, currentTab: RemiTabType, reimbursements: ReimbursementView[]) => ReimbursementView[];
|
|
49
|
+
export declare const getAllowedBulkActions: (selectedTab: RemiTabType, selectedSubTab: RemiSubTabType, isAllAwaitingMyApproval: boolean, isFirstBillProcessing: boolean) => BulkOperationType[];
|
|
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getRemiListOnSort = exports.getApproversOrRejectors = exports.getRemiList = void 0;
|
|
6
|
+
exports.getAllowedBulkActions = exports.getRemiListOnSort = exports.getApproversOrRejectors = exports.getRemiList = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
|
+
const difference_1 = __importDefault(require("lodash/difference"));
|
|
9
10
|
const remiListState_1 = require("./remiListState");
|
|
10
11
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
11
12
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -15,9 +16,10 @@ const approvalRuleState_1 = require("../../../../entity/approvalRule/approvalRul
|
|
|
15
16
|
const reimbursementConfigSelector_1 = require("../../reimbursement/reimbursementConfig/reimbursementConfigSelector");
|
|
16
17
|
const spendManagementFilterHelpers_1 = require("../../spendManagementFilterHelpers");
|
|
17
18
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
18
|
-
const
|
|
19
|
+
const helpers_1 = require("../../helpers");
|
|
20
|
+
const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
19
21
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
20
|
-
const { remiListState, reimbursementState, userState, entityApprovalStatusState, tenantState, reimbursementConfigState, } = state;
|
|
22
|
+
const { remiListState, reimbursementState, userState, entityApprovalStatusState, tenantState, reimbursementConfigState, remisBulkActionViewState, } = state;
|
|
21
23
|
const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
22
24
|
const key = (0, remiListState_1.getRemiListKey)(currentTimePeriod, remiListState.currentTab);
|
|
23
25
|
const pendingApprovalKey = (0, remiListState_1.getRemiListKey)(currentTimePeriod, 'pending_approval');
|
|
@@ -69,6 +71,58 @@ const getRemiList = (state, currentTimePeriod) => {
|
|
|
69
71
|
lastName.includes(loweredSearchText) ||
|
|
70
72
|
email.includes(loweredSearchText));
|
|
71
73
|
}));
|
|
74
|
+
//BulkActions
|
|
75
|
+
const bulkSubmissionFetchState = remisBulkActionViewState.bulkSubmissionFetchState.fetchState;
|
|
76
|
+
let remiListBulkActionInfo = {
|
|
77
|
+
isBulkActionAllowed: false,
|
|
78
|
+
remisSelectedForBulkAction: [],
|
|
79
|
+
allowedBulkActions: [],
|
|
80
|
+
bulkSubmissionFetchState,
|
|
81
|
+
};
|
|
82
|
+
const remisSelectedForBulkAction = remisBulkActionViewState.remisSelectedForBulkAction;
|
|
83
|
+
const firstRemiInBulkList = (0, get_1.default)(reimbursementState.reimbursementById, remisSelectedForBulkAction[0], undefined);
|
|
84
|
+
const isBulkActionAllowed = isBulkActionFeatureEnabled
|
|
85
|
+
? checkIfBulkActionAllowed(remiListState.currentTab, remiListState.currentSubTab)
|
|
86
|
+
: false;
|
|
87
|
+
let firstSelectableRemi = undefined;
|
|
88
|
+
if (isBulkActionAllowed) {
|
|
89
|
+
reimbursementsDetailed = reimbursementsDetailed.map((transaction) => {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
let bulkSelectInfo;
|
|
92
|
+
if (isBulkActionAllowed) {
|
|
93
|
+
const isProcessing = (0, helpers_1.isBulkProcessing)((_a = transaction.bulkProcessingDetail) === null || _a === void 0 ? void 0 : _a.type);
|
|
94
|
+
const isError = ((_b = transaction.bulkProcessingDetail) === null || _b === void 0 ? void 0 : _b.type) === 'error';
|
|
95
|
+
const { isSelectableForBulkAction, isSelectableForBulkActionSelectAll, bulkSelectExceptionInfo, } = isProcessing || isError
|
|
96
|
+
? {
|
|
97
|
+
isSelectableForBulkAction: false,
|
|
98
|
+
isSelectableForBulkActionSelectAll: false,
|
|
99
|
+
bulkSelectExceptionInfo: undefined,
|
|
100
|
+
}
|
|
101
|
+
: isRemiSelectableForBulkAction(transaction, remiListState.currentTab, firstSelectableRemi, firstRemiInBulkList);
|
|
102
|
+
if (firstSelectableRemi == null && isSelectableForBulkAction) {
|
|
103
|
+
firstSelectableRemi = transaction;
|
|
104
|
+
}
|
|
105
|
+
bulkSelectInfo = {
|
|
106
|
+
isSelectableForBulkAction,
|
|
107
|
+
isSelectableForBulkActionSelectAll,
|
|
108
|
+
bulkSelectExceptionInfo,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return Object.assign(Object.assign({}, transaction), { bulkSelectInfo });
|
|
112
|
+
});
|
|
113
|
+
const allBulkRemisAwaitingMyApproval = (0, difference_1.default)(remisSelectedForBulkAction, pendingApprovalTransactionIDs)
|
|
114
|
+
.length === 0;
|
|
115
|
+
const allowedBulkActions = isBulkActionAllowed
|
|
116
|
+
? (0, exports.getAllowedBulkActions)(remiListState.currentTab, remiListState.currentSubTab, allBulkRemisAwaitingMyApproval, (firstRemiInBulkList === null || firstRemiInBulkList === void 0 ? void 0 : firstRemiInBulkList.reimbursementInfo.billPaymentStatus.code) ===
|
|
117
|
+
'processing')
|
|
118
|
+
: [];
|
|
119
|
+
remiListBulkActionInfo = {
|
|
120
|
+
isBulkActionAllowed,
|
|
121
|
+
remisSelectedForBulkAction,
|
|
122
|
+
allowedBulkActions,
|
|
123
|
+
bulkSubmissionFetchState,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
72
126
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
73
127
|
const isReimbursementUser = Boolean(currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.userRole) === true
|
|
74
128
|
? (0, userRoleType_1.hasReimbursementUserAccess)(currentTenant)
|
|
@@ -86,6 +140,7 @@ const getRemiList = (state, currentTimePeriod) => {
|
|
|
86
140
|
error: (_b = remiListState.byRemiListKey[key]) === null || _b === void 0 ? void 0 : _b.error,
|
|
87
141
|
});
|
|
88
142
|
}));
|
|
143
|
+
const remiBulkSubmissionLimit = reimbursementConfigState.reimbursementBulkSubmissionLimit;
|
|
89
144
|
return {
|
|
90
145
|
reportTitle: 'Reimbursements',
|
|
91
146
|
version: 0,
|
|
@@ -106,6 +161,8 @@ const getRemiList = (state, currentTimePeriod) => {
|
|
|
106
161
|
isDownloadEnabled,
|
|
107
162
|
createdByUserList,
|
|
108
163
|
createdByUserListFetchState: createdByUserListFetchState.fetchState,
|
|
164
|
+
remiBulkSubmissionLimit,
|
|
165
|
+
remiListBulkActionInfo,
|
|
109
166
|
};
|
|
110
167
|
};
|
|
111
168
|
exports.getRemiList = getRemiList;
|
|
@@ -392,3 +449,102 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
392
449
|
];
|
|
393
450
|
};
|
|
394
451
|
exports.getRemiListOnSort = getRemiListOnSort;
|
|
452
|
+
const checkIfBulkActionAllowed = (selectedTab, selectedSubTab) => {
|
|
453
|
+
if (selectedTab === 'paid' || selectedSubTab === 'deleted') {
|
|
454
|
+
return false;
|
|
455
|
+
}
|
|
456
|
+
return true;
|
|
457
|
+
};
|
|
458
|
+
const isRemiSelectableForBulkAction = (reimbursement, selectedTab, firstSelectableRemi, firstRemiSelected) => {
|
|
459
|
+
const result = {
|
|
460
|
+
isSelectableForBulkAction: true,
|
|
461
|
+
isSelectableForBulkActionSelectAll: true,
|
|
462
|
+
bulkSelectExceptionInfo: undefined,
|
|
463
|
+
};
|
|
464
|
+
if (selectedTab === 'scheduled') {
|
|
465
|
+
//for cases where user attempts select all on scheduled tab
|
|
466
|
+
if (firstRemiSelected == null && firstSelectableRemi != null) {
|
|
467
|
+
if (firstSelectableRemi.reimbursementInfo.billPaymentStatus.code ===
|
|
468
|
+
'processing') {
|
|
469
|
+
if (reimbursement.reimbursementInfo.billPaymentStatus.code !==
|
|
470
|
+
'processing') {
|
|
471
|
+
return {
|
|
472
|
+
isSelectableForBulkAction: true,
|
|
473
|
+
isSelectableForBulkActionSelectAll: false,
|
|
474
|
+
bulkSelectExceptionInfo: undefined,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (reimbursement.reimbursementInfo.billPaymentStatus.code === 'processing') {
|
|
479
|
+
if (firstSelectableRemi.reimbursementInfo.billPaymentStatus.code !==
|
|
480
|
+
'processing') {
|
|
481
|
+
return {
|
|
482
|
+
isSelectableForBulkAction: true,
|
|
483
|
+
isSelectableForBulkActionSelectAll: false,
|
|
484
|
+
bulkSelectExceptionInfo: undefined,
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if ((firstRemiSelected === null || firstRemiSelected === void 0 ? void 0 : firstRemiSelected.reimbursementInfo.billPaymentStatus.code) ===
|
|
490
|
+
'processing') {
|
|
491
|
+
if (reimbursement.reimbursementInfo.billPaymentStatus.code !== 'processing') {
|
|
492
|
+
return {
|
|
493
|
+
isSelectableForBulkAction: false,
|
|
494
|
+
isSelectableForBulkActionSelectAll: true,
|
|
495
|
+
bulkSelectExceptionInfo: 'processingSelectTogether',
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if (firstRemiSelected != null &&
|
|
500
|
+
reimbursement.reimbursementInfo.billPaymentStatus.code === 'processing') {
|
|
501
|
+
if (firstRemiSelected.reimbursementInfo.billPaymentStatus.code !==
|
|
502
|
+
'processing') {
|
|
503
|
+
return {
|
|
504
|
+
isSelectableForBulkAction: false,
|
|
505
|
+
isSelectableForBulkActionSelectAll: true,
|
|
506
|
+
bulkSelectExceptionInfo: 'processingWithOthers',
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return result;
|
|
512
|
+
};
|
|
513
|
+
const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyApproval, isFirstBillProcessing) => {
|
|
514
|
+
switch (selectedTab) {
|
|
515
|
+
case 'draft':
|
|
516
|
+
return ['send_for_approval', 'delete'];
|
|
517
|
+
case 'pending_approval': {
|
|
518
|
+
switch (selectedSubTab) {
|
|
519
|
+
case 'all':
|
|
520
|
+
case 'awaitingApproval':
|
|
521
|
+
case 'awaitingAllApproval':
|
|
522
|
+
case 'overdue':
|
|
523
|
+
if (isAllAwaitingMyApproval) {
|
|
524
|
+
return ['approve', 'reject', 'delete'];
|
|
525
|
+
}
|
|
526
|
+
return ['delete'];
|
|
527
|
+
case 'awaitingMyApproval':
|
|
528
|
+
return ['approve', 'reject', 'delete'];
|
|
529
|
+
case 'rejected':
|
|
530
|
+
return ['delete'];
|
|
531
|
+
default:
|
|
532
|
+
return [];
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
case 'scheduled': {
|
|
536
|
+
switch (selectedSubTab) {
|
|
537
|
+
case 'all':
|
|
538
|
+
return isFirstBillProcessing ? ['cancel'] : ['delete'];
|
|
539
|
+
case 'failed':
|
|
540
|
+
case 'cancelled':
|
|
541
|
+
return ['delete'];
|
|
542
|
+
default:
|
|
543
|
+
return [];
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
default:
|
|
547
|
+
return [];
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
exports.getAllowedBulkActions = getAllowedBulkActions;
|
|
@@ -53,4 +53,5 @@ export interface ReimbursementFilterCategory {
|
|
|
53
53
|
export declare type RemiListViewFilterCategoryField = 'createdBy' | 'status' | 'amount' | 'receiptDate' | 'creationDate' | 'paymentMethod';
|
|
54
54
|
export declare const REIMBURSEMENT_FILTER_CATEGORIES: ReimbursementFilterCategoryDropdownOption[];
|
|
55
55
|
export declare const REIMBURSEMENT_FILTER_CATEGORIES_RESTRICTED: ReimbursementFilterCategoryDropdownOption[];
|
|
56
|
+
export declare type RemiBulkSelectExceptionInfoType = 'processingSelectTogether' | 'processingWithOthers';
|
|
56
57
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
|
+
import { approveOrRejectRemisBulkAction, remisBulkActionFailure, remisBulkActionSuccess } from '../remisBulkActionViewReducer';
|
|
7
|
+
import { updateReimbursementsWithBulkActionStatus } from '../../../../../entity/reimbursement/reimbursementReducer';
|
|
8
|
+
export declare type ActionType = ReturnType<typeof approveOrRejectRemisBulkAction> | ReturnType<typeof updateReimbursementsWithBulkActionStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof remisBulkActionFailure> | ReturnType<typeof remisBulkActionSuccess>;
|
|
9
|
+
export declare const approveOrRejectRemisBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.approveOrRejectRemisBulkActionEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
+
const remisBulkActionViewReducer_1 = require("../remisBulkActionViewReducer");
|
|
9
|
+
const reimbursementReducer_1 = require("../../../../../entity/reimbursement/reimbursementReducer");
|
|
10
|
+
const approveOrRejectRemisBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remisBulkActionViewReducer_1.approveOrRejectRemisBulkAction.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
+
const { approvalType, description } = action.payload;
|
|
12
|
+
const { remisBulkActionViewState } = state$.value;
|
|
13
|
+
const transactionIds = remisBulkActionViewState.remisSelectedForBulkAction;
|
|
14
|
+
const payload = prepareBulkApproveOrRejectPayload(transactionIds, approvalType, description);
|
|
15
|
+
return zeniAPI
|
|
16
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bulk/reimbursements/transactions`, payload)
|
|
17
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
20
|
+
const actions = [];
|
|
21
|
+
const processingRemisCount = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0;
|
|
22
|
+
actions.push((0, remisBulkActionViewReducer_1.remisBulkActionSuccess)({
|
|
23
|
+
remisProcessing: processingRemisCount,
|
|
24
|
+
refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
|
|
25
|
+
}));
|
|
26
|
+
actions.push((0, reimbursementReducer_1.updateReimbursementsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
|
|
27
|
+
if (processingRemisCount > 0) {
|
|
28
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
29
|
+
messageSection: 'reimbursement_bulk_submit',
|
|
30
|
+
messageText: 'success',
|
|
31
|
+
type: 'success',
|
|
32
|
+
variables: [
|
|
33
|
+
{
|
|
34
|
+
variableName: '_count_',
|
|
35
|
+
variableValue: processingRemisCount.toString(),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
variableName: '_report_',
|
|
39
|
+
variableValue: processingRemisCount > 1 ? 'reports' : 'report',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
variableName: '_action_',
|
|
43
|
+
variableValue: approvalType,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
return (0, rxjs_1.from)(actions);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.remisBulkActionFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
52
|
+
messageSection: 'reimbursement_bulk_submit',
|
|
53
|
+
messageText: 'failed',
|
|
54
|
+
type: 'error',
|
|
55
|
+
variables: [
|
|
56
|
+
{
|
|
57
|
+
variableName: '_api-error_',
|
|
58
|
+
variableValue: response.status.message,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.remisBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Remi Approve or Reject bulk action REST API call errored out ' +
|
|
64
|
+
JSON.stringify(error))))));
|
|
65
|
+
}));
|
|
66
|
+
exports.approveOrRejectRemisBulkActionEpic = approveOrRejectRemisBulkActionEpic;
|
|
67
|
+
function prepareBulkApproveOrRejectPayload(transactionIds, approvalType, description) {
|
|
68
|
+
const bulkApproveOrRejectItems = transactionIds.map((id) => ({
|
|
69
|
+
entity_id: id,
|
|
70
|
+
request_data: {
|
|
71
|
+
approval_status: approvalType,
|
|
72
|
+
is_include_entity_approval: true,
|
|
73
|
+
description: description !== null && description !== void 0 ? description : '',
|
|
74
|
+
},
|
|
75
|
+
}));
|
|
76
|
+
return {
|
|
77
|
+
operation_type: approvalType === 'approved' ? 'approve' : 'reject',
|
|
78
|
+
operations: bulkApproveOrRejectItems,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { updateReimbursementsWithBulkActionStatus } from '../../../../../entity/reimbursement/reimbursementReducer';
|
|
5
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
|
+
import { cancelOrDeleteRemisBulkAction, remisBulkActionFailure, remisBulkActionSuccess } from '../remisBulkActionViewReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof cancelOrDeleteRemisBulkAction> | ReturnType<typeof updateReimbursementsWithBulkActionStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof remisBulkActionFailure> | ReturnType<typeof remisBulkActionSuccess>;
|
|
8
|
+
export declare const cancelOrDeleteRemisBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cancelOrDeleteRemisBulkActionEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const reimbursementReducer_1 = require("../../../../../entity/reimbursement/reimbursementReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const remisBulkActionViewReducer_1 = require("../remisBulkActionViewReducer");
|
|
10
|
+
const cancelOrDeleteRemisBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remisBulkActionViewReducer_1.cancelOrDeleteRemisBulkAction.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
+
const { operationType, description } = action.payload;
|
|
12
|
+
const { remisBulkActionViewState } = state$.value;
|
|
13
|
+
const transactionIds = remisBulkActionViewState.remisSelectedForBulkAction;
|
|
14
|
+
const payload = prepareBulkCancelOrDeletePayload(transactionIds, operationType, description);
|
|
15
|
+
const bulkApiUrl = `${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bulk/reimbursements/transactions`;
|
|
16
|
+
const api = operationType === 'cancel'
|
|
17
|
+
? zeniAPI.putAndGetJSON(bulkApiUrl, payload)
|
|
18
|
+
: zeniAPI.deleteAndGetJSON(bulkApiUrl, payload);
|
|
19
|
+
return api.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f;
|
|
21
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
22
|
+
const actions = [];
|
|
23
|
+
const processingRemisCount = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0;
|
|
24
|
+
actions.push((0, remisBulkActionViewReducer_1.remisBulkActionSuccess)({
|
|
25
|
+
remisProcessing: processingRemisCount,
|
|
26
|
+
refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
|
|
27
|
+
}));
|
|
28
|
+
actions.push((0, reimbursementReducer_1.updateReimbursementsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
|
|
29
|
+
if (processingRemisCount > 0) {
|
|
30
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
31
|
+
messageSection: 'reimbursement_bulk_submit',
|
|
32
|
+
messageText: 'success',
|
|
33
|
+
type: 'success',
|
|
34
|
+
variables: [
|
|
35
|
+
{
|
|
36
|
+
variableName: '_count_',
|
|
37
|
+
variableValue: processingRemisCount.toString(),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
variableName: '_report_',
|
|
41
|
+
variableValue: processingRemisCount > 1 ? 'reports' : 'report',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
variableName: '_action_',
|
|
45
|
+
variableValue: operationType === 'cancel' ? 'canceled' : 'deleted',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
return (0, rxjs_1.from)(actions);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.remisBulkActionFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
54
|
+
messageSection: 'reimbursement_bulk_submit',
|
|
55
|
+
messageText: 'failed',
|
|
56
|
+
type: 'error',
|
|
57
|
+
variables: [
|
|
58
|
+
{
|
|
59
|
+
variableName: '_api-error_',
|
|
60
|
+
variableValue: response.status.message,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.remisBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Remi Cancel or Delete bulk action REST API call errored out ' +
|
|
66
|
+
JSON.stringify(error))))));
|
|
67
|
+
}));
|
|
68
|
+
exports.cancelOrDeleteRemisBulkActionEpic = cancelOrDeleteRemisBulkActionEpic;
|
|
69
|
+
function prepareBulkCancelOrDeletePayload(transactionIds, operationType, description) {
|
|
70
|
+
const bulkCancelOrDeleteItems = transactionIds.map((id) => ({
|
|
71
|
+
entity_id: id,
|
|
72
|
+
request_data: {
|
|
73
|
+
reimbursement_provider: 'zeni',
|
|
74
|
+
description,
|
|
75
|
+
},
|
|
76
|
+
}));
|
|
77
|
+
return {
|
|
78
|
+
operation_type: operationType,
|
|
79
|
+
operations: bulkCancelOrDeleteItems,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { reviewDraftRemisBulkAction, reviewDraftRemisBulkActionFailure, reviewDraftRemisBulkActionSuccess } from '../remisBulkActionViewReducer';
|
|
6
|
+
export declare type ActionType = ReturnType<typeof reviewDraftRemisBulkAction> | ReturnType<typeof reviewDraftRemisBulkActionSuccess> | ReturnType<typeof reviewDraftRemisBulkActionFailure>;
|
|
7
|
+
export declare const reviewDraftRemisBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reviewDraftRemisBulkActionEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const remisBulkActionViewReducer_1 = require("../remisBulkActionViewReducer");
|
|
8
|
+
const reviewDraftRemisBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remisBulkActionViewReducer_1.reviewDraftRemisBulkAction.match), (0, operators_1.mergeMap)(() => {
|
|
9
|
+
const { remisBulkActionViewState } = state$.value;
|
|
10
|
+
const transactionIds = remisBulkActionViewState.remisSelectedForBulkAction;
|
|
11
|
+
const queryParam = {
|
|
12
|
+
entity_ids: transactionIds,
|
|
13
|
+
};
|
|
14
|
+
return zeniAPI
|
|
15
|
+
.getJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bulk/reimbursements/transactions/validate?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
16
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
19
|
+
const actions = [];
|
|
20
|
+
actions.push((0, remisBulkActionViewReducer_1.reviewDraftRemisBulkActionSuccess)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.validation_results) !== null && _b !== void 0 ? _b : []));
|
|
21
|
+
return (0, rxjs_1.from)(actions);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.reviewDraftRemisBulkActionFailure)(response.status));
|
|
25
|
+
}
|
|
26
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.reviewDraftRemisBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Remi bulk review action REST API call errored out ' +
|
|
27
|
+
JSON.stringify(error))))));
|
|
28
|
+
}));
|
|
29
|
+
exports.reviewDraftRemisBulkActionEpic = reviewDraftRemisBulkActionEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { updateReimbursementsWithBulkActionStatus } from '../../../../../entity/reimbursement/reimbursementReducer';
|
|
5
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
|
+
import { remisBulkActionFailure, submitDraftRemisBulkAction, remisBulkActionSuccess } from '../remisBulkActionViewReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof submitDraftRemisBulkAction> | ReturnType<typeof updateReimbursementsWithBulkActionStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof remisBulkActionFailure> | ReturnType<typeof remisBulkActionSuccess>;
|
|
8
|
+
export declare const submitDraftRemisBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.submitDraftRemisBulkActionEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const reimbursementReducer_1 = require("../../../../../entity/reimbursement/reimbursementReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const remisBulkActionViewReducer_1 = require("../remisBulkActionViewReducer");
|
|
10
|
+
const submitDraftRemisBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remisBulkActionViewReducer_1.submitDraftRemisBulkAction.match), (0, operators_1.mergeMap)(() => {
|
|
11
|
+
const { remisBulkActionViewState } = state$.value;
|
|
12
|
+
const payload = prepareBulkSubmitPayload(remisBulkActionViewState);
|
|
13
|
+
const bulkApiUrl = `${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bulk/reimbursements/transactions`;
|
|
14
|
+
return zeniAPI
|
|
15
|
+
.putAndGetJSON(bulkApiUrl, payload)
|
|
16
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
19
|
+
const actions = [];
|
|
20
|
+
const processingRemisCount = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0;
|
|
21
|
+
actions.push((0, remisBulkActionViewReducer_1.remisBulkActionSuccess)({
|
|
22
|
+
remisProcessing: processingRemisCount,
|
|
23
|
+
refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
|
|
24
|
+
}));
|
|
25
|
+
actions.push((0, reimbursementReducer_1.updateReimbursementsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
|
|
26
|
+
if (processingRemisCount > 0) {
|
|
27
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
28
|
+
messageSection: 'reimbursement_bulk_submit',
|
|
29
|
+
messageText: 'success',
|
|
30
|
+
type: 'success',
|
|
31
|
+
variables: [
|
|
32
|
+
{
|
|
33
|
+
variableName: '_count_',
|
|
34
|
+
variableValue: processingRemisCount.toString(),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
variableName: '_report_',
|
|
38
|
+
variableValue: processingRemisCount > 1 ? 'reports' : 'report',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
variableName: '_action_',
|
|
42
|
+
variableValue: 'sent for approval',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
return (0, rxjs_1.from)(actions);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.remisBulkActionFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
51
|
+
messageSection: 'reimbursement_bulk_submit',
|
|
52
|
+
messageText: 'failed',
|
|
53
|
+
type: 'error',
|
|
54
|
+
variables: [
|
|
55
|
+
{
|
|
56
|
+
variableName: '_api-error_',
|
|
57
|
+
variableValue: response.status.message,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, remisBulkActionViewReducer_1.remisBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bulk Send For Approval remi REST API call errored out ' +
|
|
63
|
+
JSON.stringify(error))))));
|
|
64
|
+
}));
|
|
65
|
+
exports.submitDraftRemisBulkActionEpic = submitDraftRemisBulkActionEpic;
|
|
66
|
+
function prepareBulkSubmitPayload(bulkActionState) {
|
|
67
|
+
const bulkDraftSubmitItems = bulkActionState.remisSelectedForBulkAction.map((id) => ({
|
|
68
|
+
entity_id: id,
|
|
69
|
+
}));
|
|
70
|
+
return {
|
|
71
|
+
operation_type: 'send_for_approval',
|
|
72
|
+
operations: bulkDraftSubmitItems,
|
|
73
|
+
};
|
|
74
|
+
}
|
package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewPayload.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
2
|
+
import { BulkActionItemResponseBasePayload, BulkActionResponsePayload } from '../../billPay/billsBulkActionView/billsBulkActionViewPayload';
|
|
3
|
+
export declare type RemisBulkActionResponse = ZeniAPIResponse<BulkActionResponsePayload>;
|
|
4
|
+
export interface BulkActionReviewItemResponsePayload extends BulkActionItemResponseBasePayload {
|
|
5
|
+
error: {
|
|
6
|
+
error_code: string;
|
|
7
|
+
error_message: string;
|
|
8
|
+
duplicate_entity_ids?: string[];
|
|
9
|
+
} | null;
|
|
10
|
+
}
|
|
11
|
+
export interface RemisReviewBulkActionResponsePayload {
|
|
12
|
+
validation_results: BulkActionReviewItemResponsePayload[];
|
|
13
|
+
}
|
|
14
|
+
export declare type RemisReviewBulkActionResponse = ZeniAPIResponse<RemisReviewBulkActionResponsePayload>;
|
package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RemisBulkActionViewState } from './remisBulkActionViewState';
|
|
2
|
+
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
3
|
+
import { RemiApprovalType } from '../remiDetailView/remiDetailViewState';
|
|
4
|
+
import { BulkActionReviewItemResponsePayload } from './remisBulkActionViewPayload';
|
|
5
|
+
export declare const initialState: RemisBulkActionViewState;
|
|
6
|
+
export declare const updateRemisBulkActionList: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], string>, removeRemiFromBulkActionList: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearAllRemisFromBulkActionList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, reviewDraftRemisBulkAction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, reviewDraftRemisBulkActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<BulkActionReviewItemResponsePayload[], string>, reviewDraftRemisBulkActionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, submitDraftRemisBulkAction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, approveOrRejectRemisBulkAction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalType: RemiApprovalType, description: string], {
|
|
7
|
+
approvalType: RemiApprovalType;
|
|
8
|
+
description: string;
|
|
9
|
+
}, string, never, never>, cancelOrDeleteRemisBulkAction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[operationType: "cancel" | "delete", description: string], {
|
|
10
|
+
operationType: "cancel" | "delete";
|
|
11
|
+
description: string;
|
|
12
|
+
}, string, never, never>, remisBulkActionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, autoReviewPendingApprovalRemis: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, incrementRemiBulkActionProcessedCount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, remisBulkActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
+
remisProcessing: number;
|
|
14
|
+
refreshTime: number;
|
|
15
|
+
}, string>, clearRemiBulkActionView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
16
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<RemisBulkActionViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
17
|
+
export default _default;
|