@zeniai/client-epic-state 4.12.80 → 4.12.82
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 +8 -10
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +14 -16
- package/lib/entity/billPay/billTransaction/billTransactionReducer.js +1 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +12 -13
- package/lib/entity/billPay/billTransaction/billTransactionState.js +3 -3
- package/lib/entity/reimbursement/reimbursementPayload.d.ts +1 -3
- package/lib/entity/reimbursement/reimbursementPayload.js +0 -3
- package/lib/entity/reimbursement/reimbursementReducer.d.ts +1 -2
- package/lib/entity/reimbursement/reimbursementReducer.js +2 -25
- package/lib/entity/reimbursement/reimbursementState.d.ts +1 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/index.d.ts +7 -9
- package/lib/index.js +14 -30
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- 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 +0 -1
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts +1 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +2 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -1
- package/lib/view/spendManagement/helpers.d.ts +1 -6
- package/lib/view/spendManagement/helpers.js +3 -24
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +10 -13
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigPayload.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigReducer.js +0 -3
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigState.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +2 -4
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +2 -18
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +3 -159
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +0 -1
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +6 -5
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +6 -5
- package/package.json +1 -1
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/approveOrRejectRemisBulkActionEpic.d.ts +0 -9
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/approveOrRejectRemisBulkActionEpic.js +0 -80
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/cancelOrDeleteRemisBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/cancelOrDeleteRemisBulkActionEpic.js +0 -81
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/reviewDraftRemisBulkActionEpic.ts.d.ts +0 -7
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/reviewDraftRemisBulkActionEpic.ts.js +0 -29
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/submitDraftRemisBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/epics/submitDraftRemisBulkActionEpic.js +0 -74
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewPayload.d.ts +0 -14
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewPayload.js +0 -2
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.d.ts +0 -17
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.js +0 -166
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewSelector.d.ts +0 -25
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewSelector.js +0 -46
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.d.ts +0 -30
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.js +0 -24
|
@@ -1,74 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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;
|
package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearRemiBulkActionView = exports.remisBulkActionSuccess = exports.incrementRemiBulkActionProcessedCount = exports.autoReviewPendingApprovalRemis = exports.remisBulkActionFailure = exports.cancelOrDeleteRemisBulkAction = exports.approveOrRejectRemisBulkAction = exports.submitDraftRemisBulkAction = exports.reviewDraftRemisBulkActionFailure = exports.reviewDraftRemisBulkActionSuccess = exports.reviewDraftRemisBulkAction = exports.clearAllRemisFromBulkActionList = exports.removeRemiFromBulkActionList = exports.updateRemisBulkActionList = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const remisBulkActionViewState_1 = require("./remisBulkActionViewState");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
remisSelectedForBulkAction: [],
|
|
9
|
-
bulkReviewStateById: {},
|
|
10
|
-
bulkReviewFetchState: {
|
|
11
|
-
fetchState: 'Not-Started',
|
|
12
|
-
error: undefined,
|
|
13
|
-
},
|
|
14
|
-
bulkSubmissionFetchState: {
|
|
15
|
-
fetchState: 'Not-Started',
|
|
16
|
-
error: undefined,
|
|
17
|
-
},
|
|
18
|
-
bulkOperationTypeSelected: 'delete',
|
|
19
|
-
bulkOperationProgress: {
|
|
20
|
-
remisProcessed: 0,
|
|
21
|
-
remisProcessing: 0,
|
|
22
|
-
refreshTimeInSeconds: 0,
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
const remisBulkActionView = (0, toolkit_1.createSlice)({
|
|
26
|
-
name: 'remisBulkActionView',
|
|
27
|
-
initialState: exports.initialState,
|
|
28
|
-
reducers: {
|
|
29
|
-
updateRemisBulkActionList(draft, action) {
|
|
30
|
-
draft.remisSelectedForBulkAction = action.payload;
|
|
31
|
-
},
|
|
32
|
-
removeRemiFromBulkActionList(draft, action) {
|
|
33
|
-
var _a, _b, _c;
|
|
34
|
-
draft.remisSelectedForBulkAction =
|
|
35
|
-
draft.remisSelectedForBulkAction.filter((remiId) => remiId !== action.payload);
|
|
36
|
-
//remove warning if duplicates within batch
|
|
37
|
-
if (draft.bulkOperationTypeSelected === 'send_for_approval' &&
|
|
38
|
-
draft.bulkReviewFetchState.fetchState === 'Completed') {
|
|
39
|
-
const duplicateIds = (_c = (_b = (_a = draft.bulkReviewStateById[action.payload]) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.duplicateTransactionIds) !== null && _c !== void 0 ? _c : [];
|
|
40
|
-
duplicateIds.forEach((id) => {
|
|
41
|
-
var _a, _b, _c, _d;
|
|
42
|
-
if (id in draft.bulkReviewStateById) {
|
|
43
|
-
if (((_b = (_a = draft.bulkReviewStateById[id].error) === null || _a === void 0 ? void 0 : _a.duplicateTransactionIds) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
|
44
|
-
((_d = (_c = draft.bulkReviewStateById[id].error) === null || _c === void 0 ? void 0 : _c.duplicateTransactionIds) === null || _d === void 0 ? void 0 : _d[0]) === action.payload) {
|
|
45
|
-
draft.bulkReviewStateById[id].status = 'valid';
|
|
46
|
-
draft.bulkReviewStateById[id].error = undefined;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
clearAllRemisFromBulkActionList(draft) {
|
|
53
|
-
draft.remisSelectedForBulkAction = [];
|
|
54
|
-
},
|
|
55
|
-
reviewDraftRemisBulkAction(draft) {
|
|
56
|
-
draft.bulkReviewFetchState = {
|
|
57
|
-
fetchState: 'In-Progress',
|
|
58
|
-
error: undefined,
|
|
59
|
-
};
|
|
60
|
-
draft.bulkSubmissionFetchState = {
|
|
61
|
-
fetchState: 'Not-Started',
|
|
62
|
-
error: undefined,
|
|
63
|
-
};
|
|
64
|
-
draft.bulkOperationTypeSelected = 'send_for_approval';
|
|
65
|
-
},
|
|
66
|
-
reviewDraftRemisBulkActionSuccess(draft, action) {
|
|
67
|
-
draft.bulkReviewFetchState = {
|
|
68
|
-
fetchState: 'Completed',
|
|
69
|
-
error: undefined,
|
|
70
|
-
};
|
|
71
|
-
action.payload.forEach((result) => {
|
|
72
|
-
var _a;
|
|
73
|
-
const transactionId = result.entity_id;
|
|
74
|
-
const status = (0, remisBulkActionViewState_1.toBulkReviewStatusCode)(result.status);
|
|
75
|
-
draft.bulkReviewStateById[transactionId] = {
|
|
76
|
-
transactionId,
|
|
77
|
-
status,
|
|
78
|
-
error: status !== 'valid' && result.error != null
|
|
79
|
-
? {
|
|
80
|
-
code: (0, remisBulkActionViewState_1.toBulkReviewErrorCode)(result.error.error_code),
|
|
81
|
-
message: result.error.error_message,
|
|
82
|
-
duplicateTransactionIds: (_a = result.error.duplicate_entity_ids) !== null && _a !== void 0 ? _a : [],
|
|
83
|
-
}
|
|
84
|
-
: undefined,
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
reviewDraftRemisBulkActionFailure(draft, action) {
|
|
89
|
-
draft.bulkReviewFetchState = {
|
|
90
|
-
fetchState: 'Error',
|
|
91
|
-
error: action.payload,
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
autoReviewPendingApprovalRemis(draft) {
|
|
95
|
-
draft.bulkOperationTypeSelected = 'approve'; //or reject
|
|
96
|
-
draft.remisSelectedForBulkAction.forEach((id) => {
|
|
97
|
-
draft.bulkReviewStateById[id] = {
|
|
98
|
-
transactionId: id,
|
|
99
|
-
status: 'valid',
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
draft.bulkReviewFetchState = {
|
|
103
|
-
fetchState: 'Completed',
|
|
104
|
-
error: undefined,
|
|
105
|
-
};
|
|
106
|
-
draft.bulkSubmissionFetchState = {
|
|
107
|
-
fetchState: 'Not-Started',
|
|
108
|
-
error: undefined,
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
submitDraftRemisBulkAction(draft) {
|
|
112
|
-
draft.bulkOperationTypeSelected = 'send_for_approval';
|
|
113
|
-
draft.bulkSubmissionFetchState = {
|
|
114
|
-
fetchState: 'In-Progress',
|
|
115
|
-
error: undefined,
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
approveOrRejectRemisBulkAction: {
|
|
119
|
-
reducer(draft, action) {
|
|
120
|
-
draft.bulkOperationTypeSelected =
|
|
121
|
-
action.payload.approvalType === 'approved' ? 'approve' : 'reject';
|
|
122
|
-
draft.bulkSubmissionFetchState = {
|
|
123
|
-
fetchState: 'In-Progress',
|
|
124
|
-
error: undefined,
|
|
125
|
-
};
|
|
126
|
-
},
|
|
127
|
-
prepare(approvalType, description) {
|
|
128
|
-
return { payload: { approvalType, description } };
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
cancelOrDeleteRemisBulkAction: {
|
|
132
|
-
reducer(draft, action) {
|
|
133
|
-
draft.bulkOperationTypeSelected = action.payload.operationType;
|
|
134
|
-
draft.bulkSubmissionFetchState.fetchState = 'In-Progress';
|
|
135
|
-
},
|
|
136
|
-
prepare(operationType, description) {
|
|
137
|
-
return { payload: { operationType, description } };
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
remisBulkActionFailure(draft, action) {
|
|
141
|
-
draft.bulkSubmissionFetchState = {
|
|
142
|
-
fetchState: 'Error',
|
|
143
|
-
error: action.payload,
|
|
144
|
-
};
|
|
145
|
-
},
|
|
146
|
-
remisBulkActionSuccess(draft, action) {
|
|
147
|
-
Object.assign(draft, exports.initialState, {
|
|
148
|
-
bulkSubmissionFetchState: {
|
|
149
|
-
fetchState: 'Completed',
|
|
150
|
-
error: undefined,
|
|
151
|
-
},
|
|
152
|
-
}, {
|
|
153
|
-
bulkOperationProgress: Object.assign(Object.assign({}, draft.bulkOperationProgress), { remisProcessing: action.payload.remisProcessing, refreshTimeInSeconds: action.payload.refreshTime }),
|
|
154
|
-
});
|
|
155
|
-
},
|
|
156
|
-
incrementRemiBulkActionProcessedCount(draft) {
|
|
157
|
-
draft.bulkOperationProgress.remisProcessed =
|
|
158
|
-
draft.bulkOperationProgress.remisProcessed + 1;
|
|
159
|
-
},
|
|
160
|
-
clearRemiBulkActionView(draft) {
|
|
161
|
-
Object.assign(draft, exports.initialState);
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
});
|
|
165
|
-
_a = remisBulkActionView.actions, exports.updateRemisBulkActionList = _a.updateRemisBulkActionList, exports.removeRemiFromBulkActionList = _a.removeRemiFromBulkActionList, exports.clearAllRemisFromBulkActionList = _a.clearAllRemisFromBulkActionList, exports.reviewDraftRemisBulkAction = _a.reviewDraftRemisBulkAction, exports.reviewDraftRemisBulkActionSuccess = _a.reviewDraftRemisBulkActionSuccess, exports.reviewDraftRemisBulkActionFailure = _a.reviewDraftRemisBulkActionFailure, exports.submitDraftRemisBulkAction = _a.submitDraftRemisBulkAction, exports.approveOrRejectRemisBulkAction = _a.approveOrRejectRemisBulkAction, exports.cancelOrDeleteRemisBulkAction = _a.cancelOrDeleteRemisBulkAction, exports.remisBulkActionFailure = _a.remisBulkActionFailure, exports.autoReviewPendingApprovalRemis = _a.autoReviewPendingApprovalRemis, exports.incrementRemiBulkActionProcessedCount = _a.incrementRemiBulkActionProcessedCount, exports.remisBulkActionSuccess = _a.remisBulkActionSuccess, exports.clearRemiBulkActionView = _a.clearRemiBulkActionView;
|
|
166
|
-
exports.default = remisBulkActionView.reducer;
|
package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewSelector.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../../reducer';
|
|
2
|
-
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
3
|
-
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
import { BulkOperationProgress, BulkReviewErrorCode, BulkReviewStatusCode } from './remisBulkActionViewState';
|
|
5
|
-
import { RemiSubTabType, RemiTabType } from '../remiListView/remiListState';
|
|
6
|
-
import { User } from '../../../../entity/user/userState';
|
|
7
|
-
import { Reimbursement } from '../../../../entity/reimbursement/reimbursementState';
|
|
8
|
-
import { BulkOperationType } from '../../helpers';
|
|
9
|
-
export interface RemiForReview {
|
|
10
|
-
transactionId: ID;
|
|
11
|
-
reimbursement?: Reimbursement;
|
|
12
|
-
submittedBy?: User;
|
|
13
|
-
reviewStatus?: BulkReviewStatusCode;
|
|
14
|
-
reviewErrorCode?: BulkReviewErrorCode;
|
|
15
|
-
reviewInfoMessage?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface RemisBulkReviewView extends SelectorView {
|
|
18
|
-
remisForReview: RemiForReview[];
|
|
19
|
-
bulkSubmissionFetchState: FetchState;
|
|
20
|
-
bulkOperationTypeSelected: BulkOperationType;
|
|
21
|
-
currentTab: RemiTabType;
|
|
22
|
-
currentSubTab: RemiSubTabType;
|
|
23
|
-
}
|
|
24
|
-
export declare const getRemisBulkReviewView: (state: RootState) => RemisBulkReviewView;
|
|
25
|
-
export declare const getRemisBulkOperationProgress: (state: RootState) => BulkOperationProgress;
|
package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewSelector.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getRemisBulkOperationProgress = exports.getRemisBulkReviewView = void 0;
|
|
7
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
-
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
9
|
-
const getRemisBulkReviewView = (state) => {
|
|
10
|
-
const { reimbursementState, remisBulkActionViewState, remiListState, userState, } = state;
|
|
11
|
-
const transactionIds = remisBulkActionViewState.remisSelectedForBulkAction;
|
|
12
|
-
const { currentTab, currentSubTab } = remiListState;
|
|
13
|
-
let selectedTransactions = transactionIds.map((transactionId) => {
|
|
14
|
-
const transaction = (0, get_1.default)(reimbursementState.reimbursementById, transactionId);
|
|
15
|
-
return {
|
|
16
|
-
transactionId,
|
|
17
|
-
reimbursement: transaction,
|
|
18
|
-
submittedBy: transaction != null
|
|
19
|
-
? (0, userSelector_1.getUserByUserId)(userState, transaction.reimburseeUserId)
|
|
20
|
-
: undefined,
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
const bulkReviewFetchState = remisBulkActionViewState.bulkReviewFetchState.fetchState;
|
|
24
|
-
const bulkSubmissionFetchState = remisBulkActionViewState.bulkSubmissionFetchState.fetchState;
|
|
25
|
-
if (bulkReviewFetchState === 'Completed') {
|
|
26
|
-
selectedTransactions = selectedTransactions.map((transaction) => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const reviewStateOfRemi = remisBulkActionViewState.bulkReviewStateById[transaction.transactionId];
|
|
29
|
-
return Object.assign(Object.assign({}, transaction), { reviewStatus: reviewStateOfRemi === null || reviewStateOfRemi === void 0 ? void 0 : reviewStateOfRemi.status, reviewInfoMessage: (_a = reviewStateOfRemi === null || reviewStateOfRemi === void 0 ? void 0 : reviewStateOfRemi.error) === null || _a === void 0 ? void 0 : _a.message, reviewErrorCode: (_b = reviewStateOfRemi === null || reviewStateOfRemi === void 0 ? void 0 : reviewStateOfRemi.error) === null || _b === void 0 ? void 0 : _b.code });
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
fetchState: bulkReviewFetchState,
|
|
34
|
-
remisForReview: selectedTransactions,
|
|
35
|
-
bulkSubmissionFetchState,
|
|
36
|
-
bulkOperationTypeSelected: remisBulkActionViewState.bulkOperationTypeSelected,
|
|
37
|
-
currentTab,
|
|
38
|
-
currentSubTab,
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
exports.getRemisBulkReviewView = getRemisBulkReviewView;
|
|
42
|
-
const getRemisBulkOperationProgress = (state) => {
|
|
43
|
-
const { remisBulkActionViewState } = state;
|
|
44
|
-
return remisBulkActionViewState.bulkOperationProgress;
|
|
45
|
-
};
|
|
46
|
-
exports.getRemisBulkOperationProgress = getRemisBulkOperationProgress;
|
package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
|
-
import { BulkOperationType } from '../../helpers';
|
|
3
|
-
export interface BulkOperationProgress {
|
|
4
|
-
remisProcessed: number;
|
|
5
|
-
remisProcessing: number;
|
|
6
|
-
refreshTimeInSeconds: number;
|
|
7
|
-
}
|
|
8
|
-
export interface RemisBulkActionViewState {
|
|
9
|
-
remisSelectedForBulkAction: ID[];
|
|
10
|
-
bulkReviewStateById: Record<ID, BulkReviewState>;
|
|
11
|
-
bulkReviewFetchState: FetchStateAndError;
|
|
12
|
-
bulkSubmissionFetchState: FetchStateAndError;
|
|
13
|
-
bulkOperationTypeSelected: BulkOperationType;
|
|
14
|
-
bulkOperationProgress: BulkOperationProgress;
|
|
15
|
-
}
|
|
16
|
-
export interface BulkReviewState {
|
|
17
|
-
transactionId: ID;
|
|
18
|
-
status: BulkReviewStatusCode;
|
|
19
|
-
error?: {
|
|
20
|
-
code: BulkReviewErrorCode;
|
|
21
|
-
message: string;
|
|
22
|
-
duplicateTransactionIds: ID[];
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export declare const BULK_REVIEW_STATUS_CODES: readonly ["valid", "error", "warning"];
|
|
26
|
-
export declare const toBulkReviewStatusCode: (v: string) => "error" | "valid" | "warning";
|
|
27
|
-
export declare type BulkReviewStatusCode = ReturnType<typeof toBulkReviewStatusCode>;
|
|
28
|
-
export declare const BULK_REVIEW_ERROR_CODES: readonly ["ERR_INSUFFICIENT_DATA", "ERR_INVOICE_DATE_OUTSIDE_ACCOUNTING_PERIOD", "ERR_FUTURE_PAYMENT_DATE_SUPPORTED", "ERR_POSSIBLE_DUPLICATE_TRANSACTION", "ERR_INVALID_DATA", "ERR_PAYMENT_DATE_CURRENT_OR_FUTURE_DATE_SUPPORTED", "ERR_PHYSICAL_ADDRESS_REQUIRED", "ERR_START_DATE_GT_END_DATE", "ERR_RECURRING_PAYMENT_START_DATE_IS_PAST_DATE", "ERR_INCORRECT_RECURRING_PAYMENT_CYCLE", "ERR_INCORRECT_FIELD", "ERR_UPDATE_VENDOR_DETAILS", "ERR_AMOUNT_ZERO"];
|
|
29
|
-
export declare const toBulkReviewErrorCode: (v: string) => "ERR_INSUFFICIENT_DATA" | "ERR_INVOICE_DATE_OUTSIDE_ACCOUNTING_PERIOD" | "ERR_FUTURE_PAYMENT_DATE_SUPPORTED" | "ERR_POSSIBLE_DUPLICATE_TRANSACTION" | "ERR_INVALID_DATA" | "ERR_PAYMENT_DATE_CURRENT_OR_FUTURE_DATE_SUPPORTED" | "ERR_PHYSICAL_ADDRESS_REQUIRED" | "ERR_START_DATE_GT_END_DATE" | "ERR_RECURRING_PAYMENT_START_DATE_IS_PAST_DATE" | "ERR_INCORRECT_RECURRING_PAYMENT_CYCLE" | "ERR_INCORRECT_FIELD" | "ERR_UPDATE_VENDOR_DETAILS" | "ERR_AMOUNT_ZERO";
|
|
30
|
-
export declare type BulkReviewErrorCode = ReturnType<typeof toBulkReviewErrorCode>;
|
package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toBulkReviewErrorCode = exports.BULK_REVIEW_ERROR_CODES = exports.toBulkReviewStatusCode = exports.BULK_REVIEW_STATUS_CODES = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
|
-
exports.BULK_REVIEW_STATUS_CODES = ['valid', 'error', 'warning'];
|
|
6
|
-
const toBulkReviewStatusCode = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BULK_REVIEW_STATUS_CODES);
|
|
7
|
-
exports.toBulkReviewStatusCode = toBulkReviewStatusCode;
|
|
8
|
-
exports.BULK_REVIEW_ERROR_CODES = [
|
|
9
|
-
'ERR_INSUFFICIENT_DATA',
|
|
10
|
-
'ERR_INVOICE_DATE_OUTSIDE_ACCOUNTING_PERIOD',
|
|
11
|
-
'ERR_FUTURE_PAYMENT_DATE_SUPPORTED',
|
|
12
|
-
'ERR_POSSIBLE_DUPLICATE_TRANSACTION',
|
|
13
|
-
'ERR_INVALID_DATA',
|
|
14
|
-
'ERR_PAYMENT_DATE_CURRENT_OR_FUTURE_DATE_SUPPORTED',
|
|
15
|
-
'ERR_PHYSICAL_ADDRESS_REQUIRED',
|
|
16
|
-
'ERR_START_DATE_GT_END_DATE',
|
|
17
|
-
'ERR_RECURRING_PAYMENT_START_DATE_IS_PAST_DATE',
|
|
18
|
-
'ERR_INCORRECT_RECURRING_PAYMENT_CYCLE',
|
|
19
|
-
'ERR_INCORRECT_FIELD',
|
|
20
|
-
'ERR_UPDATE_VENDOR_DETAILS',
|
|
21
|
-
'ERR_AMOUNT_ZERO',
|
|
22
|
-
];
|
|
23
|
-
const toBulkReviewErrorCode = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BULK_REVIEW_ERROR_CODES);
|
|
24
|
-
exports.toBulkReviewErrorCode = toBulkReviewErrorCode;
|