@zeniai/client-epic-state 4.11.15 → 4.11.16
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 +0 -9
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +2 -15
- package/lib/entity/billPay/billTransaction/billTransactionReducer.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionReducer.js +2 -25
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +1 -11
- package/lib/entity/billPay/billTransaction/billTransactionState.js +1 -9
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -6
- package/lib/entity/task/taskPayload.d.ts +2 -2
- package/lib/entity/task/taskPayload.js +0 -1
- package/lib/entity/task/taskState.d.ts +2 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -5
- package/lib/entity/tenant/clearAllEpic.js +0 -8
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/attachment.d.ts +0 -6
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +0 -3
- package/lib/entity/transaction/stateTypes/transactionType.js +3 -7
- package/lib/entity/vendor/vendorPayload.d.ts +0 -2
- package/lib/entity/vendor/vendorPayload.js +1 -5
- package/lib/entity/vendor/vendorState.d.ts +0 -2
- package/lib/epic.d.ts +1 -12
- package/lib/epic.js +1 -12
- package/lib/index.d.ts +12 -18
- package/lib/index.js +10 -37
- package/lib/reducer.d.ts +0 -9
- package/lib/reducer.js +0 -9
- package/lib/view/companyView/selector/companyManagementViewSelector.js +7 -13
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +6 -1
- package/lib/view/fileView/fileUploadHelpers.d.ts +0 -5
- 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/reviewCompanyView/reviewCompanyViewSelector.js +9 -26
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +2 -3
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +3 -9
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +2 -19
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +3 -150
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +0 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +0 -2
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +0 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +8 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -6
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/helpers.d.ts +0 -3
- package/lib/view/spendManagement/helpers.js +1 -17
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -5
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +4 -11
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +1 -2
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.d.ts +1 -3
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.js +0 -12
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -31
- package/lib/view/taskManager/taskListView/taskListReducer.js +9 -136
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -12
- package/lib/view/taskManager/taskListView/taskListSelector.js +23 -59
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +5 -22
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js +0 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +5 -11
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +0 -15
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +3 -13
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +3 -45
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +0 -8
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +2 -17
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +2 -6
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.js +1 -2
- package/package.json +1 -1
- package/lib/entity/taskGroup/taskGroupPayload.d.ts +0 -9
- package/lib/entity/taskGroup/taskGroupPayload.js +0 -14
- package/lib/entity/taskGroup/taskGroupReducer.d.ts +0 -6
- package/lib/entity/taskGroup/taskGroupReducer.js +0 -33
- package/lib/entity/taskGroup/taskGroupSelector.d.ts +0 -4
- package/lib/entity/taskGroup/taskGroupSelector.js +0 -18
- package/lib/entity/taskGroup/taskGroupState.d.ts +0 -12
- package/lib/entity/taskGroup/taskGroupState.js +0 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.d.ts +0 -32
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.js +0 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.d.ts +0 -17
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.js +0 -166
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts +0 -24
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.js +0 -45
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +0 -28
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.js +0 -7
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.d.ts +0 -9
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.js +0 -73
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.js +0 -74
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.d.ts +0 -7
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.js +0 -29
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.js +0 -62
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.js +0 -57
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.js +0 -41
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.d.ts +0 -8
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.js +0 -33
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.js +0 -51
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.d.ts +0 -6
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.js +0 -2
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.d.ts +0 -34
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.js +0 -123
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.d.ts +0 -7
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.js +0 -2
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.d.ts +0 -8
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +0 -88
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.d.ts +0 -6
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.js +0 -20
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.d.ts +0 -10
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.js +0 -37
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getVendorFirstReviewView = void 0;
|
|
4
4
|
const globalMerchantSelector_1 = require("../../../entity/globalMerchant/globalMerchantSelector");
|
|
5
5
|
const userSelector_1 = require("../../../entity/user/userSelector");
|
|
6
6
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
7
7
|
const globalMerchantAutoCompleteViewSelector_1 = require("../../globalMerchantView/globalMerchantAutoCompleteView/globalMerchantAutoCompleteViewSelector");
|
|
8
8
|
const getVendorFirstReviewView = (state) => {
|
|
9
9
|
const { vendorFirstReviewViewState, userState, vendorState, globalMerchantState, } = state;
|
|
10
|
-
const { vendorFirstReviewViewLocalDataById, recentlySavedErroredVendorData,
|
|
10
|
+
const { vendorFirstReviewViewLocalDataById, recentlySavedErroredVendorData, uiState, fetchState, error, } = vendorFirstReviewViewState;
|
|
11
11
|
const userIds = [];
|
|
12
12
|
const globalMerchantAutoCompleteView = (0, globalMerchantAutoCompleteViewSelector_1.getGlobalMerchantAutoCompleteResults)(state);
|
|
13
13
|
const vendorReviewView = Object.keys(vendorFirstReviewViewLocalDataById).map((id) => {
|
|
@@ -23,7 +23,6 @@ const getVendorFirstReviewView = (state) => {
|
|
|
23
23
|
...recommendations,
|
|
24
24
|
...vendorLocalData.recommendedNonExistingGlobalMerchants,
|
|
25
25
|
];
|
|
26
|
-
const transactionAttachments = vendorLocalData.transactionAttachments;
|
|
27
26
|
let selectedVendor;
|
|
28
27
|
const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorLocalData.selectedVendorId);
|
|
29
28
|
if (vendor != null) {
|
|
@@ -58,12 +57,10 @@ const getVendorFirstReviewView = (state) => {
|
|
|
58
57
|
selectedVendor,
|
|
59
58
|
status: vendorLocalData.status,
|
|
60
59
|
saveStatus: vendorFirstReviewViewLocalDataById[id].saveStatus,
|
|
61
|
-
attachmentFetchStatus,
|
|
62
60
|
lastUpdatedVendorNameByUser: users.find((user) => user.userId === vendorLocalData.lastUpdatedVendorNameByUserId),
|
|
63
61
|
recommendations,
|
|
64
62
|
currentSelection: vendorLocalData.currentSelection,
|
|
65
63
|
mergeVendorName: vendorLocalData.mergeVendorName,
|
|
66
|
-
transactionAttachments,
|
|
67
64
|
};
|
|
68
65
|
});
|
|
69
66
|
let recentlyUpdatedErroredVendorData = undefined;
|
|
@@ -98,15 +95,3 @@ const getVendorFirstReviewView = (state) => {
|
|
|
98
95
|
};
|
|
99
96
|
};
|
|
100
97
|
exports.getVendorFirstReviewView = getVendorFirstReviewView;
|
|
101
|
-
const getVendorFirstReviewAttachmentView = (state, vendorId) => {
|
|
102
|
-
const { vendorFirstReviewViewState } = state;
|
|
103
|
-
const { transactionAttachmentsByVendorId } = vendorFirstReviewViewState;
|
|
104
|
-
if (transactionAttachmentsByVendorId[vendorId] == null) {
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
attachmentFetchStatus: vendorFirstReviewViewState.attachmentFetchStatus,
|
|
109
|
-
transactionAttachments: transactionAttachmentsByVendorId[vendorId],
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
exports.getVendorFirstReviewAttachmentView = getVendorFirstReviewAttachmentView;
|
|
@@ -2,14 +2,13 @@ import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { GlobalMerchant } from '../../../entity/globalMerchant/globalMerchantState';
|
|
5
|
-
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
6
5
|
import { VendorReviewRowCurrentSelection, ReviewStatus } from '../common/state/commonTypes';
|
|
7
|
-
export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd"
|
|
6
|
+
export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd"];
|
|
8
7
|
export interface CurrentSelectionByColumn {
|
|
9
8
|
retain: boolean;
|
|
10
9
|
update: boolean;
|
|
11
10
|
}
|
|
12
|
-
export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd"
|
|
11
|
+
export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd";
|
|
13
12
|
export declare type VendorFirstReviewViewColumnKey = ReturnType<typeof toVendorFirstReviewViewColumnKeyType>;
|
|
14
13
|
export interface RecommendedNonExistingGlobalMerchant extends Omit<GlobalMerchant, 'globalMerchantId'> {
|
|
15
14
|
globalMerchantId?: ID;
|
|
@@ -32,7 +31,6 @@ export interface VendorFirstReviewViewLocalData {
|
|
|
32
31
|
vendorRenamedText?: string;
|
|
33
32
|
lastUpdatedVendorNameByUserId?: ID;
|
|
34
33
|
mergeVendorName: string | undefined;
|
|
35
|
-
transactionAttachments: Attachment[];
|
|
36
34
|
}
|
|
37
35
|
export interface RecentlySavedErroredVendorData {
|
|
38
36
|
vendorId: ID;
|
|
@@ -48,6 +46,4 @@ export interface VendorFirstReviewViewState extends FetchedState {
|
|
|
48
46
|
vendorFirstReviewViewLocalDataById: Record<ID, VendorFirstReviewView>;
|
|
49
47
|
recentlySavedErroredVendorData?: RecentlySavedErroredVendorData;
|
|
50
48
|
uiState: VendorFirstReviewViewUIState;
|
|
51
|
-
attachmentFetchStatus: FetchStateAndError;
|
|
52
|
-
transactionAttachmentsByVendorId: Record<ID, Attachment[]>;
|
|
53
49
|
}
|
|
@@ -8,8 +8,7 @@ exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS = [
|
|
|
8
8
|
'retain',
|
|
9
9
|
'status',
|
|
10
10
|
'action',
|
|
11
|
-
'ytd',
|
|
12
|
-
'viewTenantInvoice',
|
|
11
|
+
'ytd', // Note: this is not part of list view, we are keeping it to use for default sorting purpose since default sorting is by year_to_date_spend
|
|
13
12
|
];
|
|
14
13
|
const toVendorFirstReviewViewColumnKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS);
|
|
15
14
|
exports.toVendorFirstReviewViewColumnKeyType = toVendorFirstReviewViewColumnKeyType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.16",
|
|
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
|
"types": "lib/index.d.ts",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TaskGroup } from './taskGroupState';
|
|
2
|
-
export interface TaskGroupPayload {
|
|
3
|
-
task_group_id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
is_default: boolean;
|
|
6
|
-
is_deleted: boolean;
|
|
7
|
-
created_at: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function mapTaskGroupPayloadToTaskGroup(payload: TaskGroupPayload): TaskGroup;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapTaskGroupPayloadToTaskGroup = void 0;
|
|
4
|
-
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
-
function mapTaskGroupPayloadToTaskGroup(payload) {
|
|
6
|
-
return {
|
|
7
|
-
id: payload.task_group_id,
|
|
8
|
-
name: payload.name,
|
|
9
|
-
isDefault: payload.is_default,
|
|
10
|
-
isDeleted: payload.is_deleted,
|
|
11
|
-
createdAt: (0, zeniDayJS_1.date)(payload.created_at),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.mapTaskGroupPayloadToTaskGroup = mapTaskGroupPayloadToTaskGroup;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TaskGroupPayload } from './taskGroupPayload';
|
|
2
|
-
import { TaskGroupState } from './taskGroupState';
|
|
3
|
-
export declare const initialState: TaskGroupState;
|
|
4
|
-
export declare const updateTaskGroups: import("@reduxjs/toolkit").ActionCreatorWithPayload<TaskGroupPayload[], string>, updateTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<TaskGroupPayload, string>, removeTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearAllTaskGroups: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
5
|
-
declare const _default: import("@reduxjs/toolkit").Reducer<TaskGroupState, import("@reduxjs/toolkit").AnyAction>;
|
|
6
|
-
export default _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllTaskGroups = exports.removeTaskGroup = exports.updateTaskGroup = exports.updateTaskGroups = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const taskGroupPayload_1 = require("./taskGroupPayload");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
taskGroupById: {},
|
|
9
|
-
};
|
|
10
|
-
const taskGroup = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: 'taskGroup',
|
|
12
|
-
initialState: exports.initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
updateTaskGroups(draft, action) {
|
|
15
|
-
action.payload.forEach((taskPayload) => {
|
|
16
|
-
const latestTaskGroup = (0, taskGroupPayload_1.mapTaskGroupPayloadToTaskGroup)(taskPayload);
|
|
17
|
-
draft.taskGroupById[latestTaskGroup.id] = latestTaskGroup;
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
updateTaskGroup(draft, action) {
|
|
21
|
-
const latestTaskGroup = (0, taskGroupPayload_1.mapTaskGroupPayloadToTaskGroup)(action.payload);
|
|
22
|
-
draft.taskGroupById[latestTaskGroup.id] = latestTaskGroup;
|
|
23
|
-
},
|
|
24
|
-
removeTaskGroup(draft, action) {
|
|
25
|
-
delete draft.taskGroupById[action.payload];
|
|
26
|
-
},
|
|
27
|
-
clearAllTaskGroups(draft) {
|
|
28
|
-
draft.taskGroupById = {};
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
_a = taskGroup.actions, exports.updateTaskGroups = _a.updateTaskGroups, exports.updateTaskGroup = _a.updateTaskGroup, exports.removeTaskGroup = _a.removeTaskGroup, exports.clearAllTaskGroups = _a.clearAllTaskGroups;
|
|
33
|
-
exports.default = taskGroup.reducer;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { TaskGroupState, TaskGroup } from './taskGroupState';
|
|
3
|
-
export declare function getTaskGroupByIds(taskGroupState: TaskGroupState, taskGroupIds: ID[]): TaskGroup[];
|
|
4
|
-
export declare function getTaskGroupById(taskGroupState: TaskGroupState, taskGroupId: ID): TaskGroup | undefined;
|
|
@@ -1,18 +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.getTaskGroupById = exports.getTaskGroupByIds = void 0;
|
|
7
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
-
function getTaskGroupByIds(taskGroupState, taskGroupIds) {
|
|
9
|
-
const tasksGroups = taskGroupIds
|
|
10
|
-
.map((taskGroupId) => getTaskGroupById(taskGroupState, taskGroupId))
|
|
11
|
-
.filter((value) => value != null);
|
|
12
|
-
return tasksGroups;
|
|
13
|
-
}
|
|
14
|
-
exports.getTaskGroupByIds = getTaskGroupByIds;
|
|
15
|
-
function getTaskGroupById(taskGroupState, taskGroupId) {
|
|
16
|
-
return (0, get_1.default)(taskGroupState.taskGroupById, taskGroupId, undefined);
|
|
17
|
-
}
|
|
18
|
-
exports.getTaskGroupById = getTaskGroupById;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniDate } from '../../zeniDayJS';
|
|
3
|
-
export interface TaskGroup {
|
|
4
|
-
id: ID;
|
|
5
|
-
name: string;
|
|
6
|
-
isDefault: boolean;
|
|
7
|
-
isDeleted: boolean;
|
|
8
|
-
createdAt: ZeniDate;
|
|
9
|
-
}
|
|
10
|
-
export interface TaskGroupState {
|
|
11
|
-
taskGroupById: Record<ID, TaskGroup>;
|
|
12
|
-
}
|
package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
2
|
-
export interface BulkActionItemResponseBasePayload {
|
|
3
|
-
entity_id: string;
|
|
4
|
-
status: string;
|
|
5
|
-
error: {
|
|
6
|
-
error_code: string;
|
|
7
|
-
error_message: string;
|
|
8
|
-
} | null;
|
|
9
|
-
}
|
|
10
|
-
export interface BulkActionItemResponsePayload extends BulkActionItemResponseBasePayload {
|
|
11
|
-
processing_message: string | null;
|
|
12
|
-
}
|
|
13
|
-
export interface BulkActionResponsePayload {
|
|
14
|
-
total_operations_requested: number;
|
|
15
|
-
total_operations_processing: number;
|
|
16
|
-
bulk_operation_id: string;
|
|
17
|
-
operation_type: string;
|
|
18
|
-
hard_refresh_after_sec: number;
|
|
19
|
-
operations: BulkActionItemResponsePayload[];
|
|
20
|
-
}
|
|
21
|
-
export declare type BillsBulkActionResponse = ZeniAPIResponse<BulkActionResponsePayload>;
|
|
22
|
-
export interface BulkActionReviewItemResponsePayload extends BulkActionItemResponseBasePayload {
|
|
23
|
-
error: {
|
|
24
|
-
error_code: string;
|
|
25
|
-
error_message: string;
|
|
26
|
-
duplicate_entity_ids?: string[];
|
|
27
|
-
} | null;
|
|
28
|
-
}
|
|
29
|
-
export interface BillsReviewBulkActionResponsePayload {
|
|
30
|
-
validation_results: BulkActionReviewItemResponsePayload[];
|
|
31
|
-
}
|
|
32
|
-
export declare type BillsReviewBulkActionResponse = ZeniAPIResponse<BillsReviewBulkActionResponsePayload>;
|
package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BillsBulkActionViewState } from './billsBulkActionViewState';
|
|
2
|
-
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
3
|
-
import { BillApprovalType } from '../billDetailView/billDetailViewState';
|
|
4
|
-
import { BulkActionReviewItemResponsePayload } from './billsBulkActionViewPayload';
|
|
5
|
-
export declare const initialState: BillsBulkActionViewState;
|
|
6
|
-
export declare const updateBillsBulkActionList: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], string>, removeBillFromBulkActionList: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearAllBillsFromBulkActionList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, reviewDraftBillsBulkAction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, reviewDraftBillsBulkActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<BulkActionReviewItemResponsePayload[], string>, reviewDraftBillsBulkActionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, submitDraftBillsBulkAction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, approveOrRejectBillsBulkAction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalType: BillApprovalType, description: string], {
|
|
7
|
-
approvalType: BillApprovalType;
|
|
8
|
-
description: string;
|
|
9
|
-
}, string, never, never>, cancelOrDeleteBillsBulkAction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[operationType: "cancel" | "delete", description: string], {
|
|
10
|
-
operationType: "cancel" | "delete";
|
|
11
|
-
description: string;
|
|
12
|
-
}, string, never, never>, billsBulkActionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, autoReviewPendingApprovalBills: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, incrementBulkActionProcessedCount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, billsBulkActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
-
billsProcessing: number;
|
|
14
|
-
refreshTime: number;
|
|
15
|
-
}, string>, clearBillPayBulkActionView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
16
|
-
declare const _default: import("@reduxjs/toolkit").Reducer<BillsBulkActionViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
17
|
-
export default _default;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearBillPayBulkActionView = exports.billsBulkActionSuccess = exports.incrementBulkActionProcessedCount = exports.autoReviewPendingApprovalBills = exports.billsBulkActionFailure = exports.cancelOrDeleteBillsBulkAction = exports.approveOrRejectBillsBulkAction = exports.submitDraftBillsBulkAction = exports.reviewDraftBillsBulkActionFailure = exports.reviewDraftBillsBulkActionSuccess = exports.reviewDraftBillsBulkAction = exports.clearAllBillsFromBulkActionList = exports.removeBillFromBulkActionList = exports.updateBillsBulkActionList = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const billsBulkActionViewState_1 = require("./billsBulkActionViewState");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
billsSelectedForBulkAction: [],
|
|
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
|
-
billsProcessed: 0,
|
|
21
|
-
billsProcessing: 0,
|
|
22
|
-
refreshTimeInSeconds: 0,
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
const billsBulkActionView = (0, toolkit_1.createSlice)({
|
|
26
|
-
name: 'billsBulkActionView',
|
|
27
|
-
initialState: exports.initialState,
|
|
28
|
-
reducers: {
|
|
29
|
-
updateBillsBulkActionList(draft, action) {
|
|
30
|
-
draft.billsSelectedForBulkAction = action.payload;
|
|
31
|
-
},
|
|
32
|
-
removeBillFromBulkActionList(draft, action) {
|
|
33
|
-
var _a, _b, _c;
|
|
34
|
-
draft.billsSelectedForBulkAction =
|
|
35
|
-
draft.billsSelectedForBulkAction.filter((billId) => billId !== 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
|
-
clearAllBillsFromBulkActionList(draft) {
|
|
53
|
-
draft.billsSelectedForBulkAction = [];
|
|
54
|
-
},
|
|
55
|
-
reviewDraftBillsBulkAction(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
|
-
reviewDraftBillsBulkActionSuccess(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, billsBulkActionViewState_1.toBulkReviewStatusCode)(result.status);
|
|
75
|
-
draft.bulkReviewStateById[transactionId] = {
|
|
76
|
-
transactionId,
|
|
77
|
-
status,
|
|
78
|
-
error: status !== 'valid' && result.error != null
|
|
79
|
-
? {
|
|
80
|
-
code: 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
|
-
reviewDraftBillsBulkActionFailure(draft, action) {
|
|
89
|
-
draft.bulkReviewFetchState = {
|
|
90
|
-
fetchState: 'Error',
|
|
91
|
-
error: action.payload,
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
autoReviewPendingApprovalBills(draft) {
|
|
95
|
-
draft.bulkOperationTypeSelected = 'approve'; //or reject
|
|
96
|
-
draft.billsSelectedForBulkAction.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
|
-
submitDraftBillsBulkAction(draft) {
|
|
112
|
-
draft.bulkOperationTypeSelected = 'send_for_approval';
|
|
113
|
-
draft.bulkSubmissionFetchState = {
|
|
114
|
-
fetchState: 'In-Progress',
|
|
115
|
-
error: undefined,
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
approveOrRejectBillsBulkAction: {
|
|
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
|
-
cancelOrDeleteBillsBulkAction: {
|
|
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
|
-
billsBulkActionFailure(draft, action) {
|
|
141
|
-
draft.bulkSubmissionFetchState = {
|
|
142
|
-
fetchState: 'Error',
|
|
143
|
-
error: action.payload,
|
|
144
|
-
};
|
|
145
|
-
},
|
|
146
|
-
billsBulkActionSuccess(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), { billsProcessing: action.payload.billsProcessing, refreshTimeInSeconds: action.payload.refreshTime }),
|
|
154
|
-
});
|
|
155
|
-
},
|
|
156
|
-
incrementBulkActionProcessedCount(draft) {
|
|
157
|
-
draft.bulkOperationProgress.billsProcessed =
|
|
158
|
-
draft.bulkOperationProgress.billsProcessed + 1;
|
|
159
|
-
},
|
|
160
|
-
clearBillPayBulkActionView(draft) {
|
|
161
|
-
Object.assign(draft, exports.initialState);
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
});
|
|
165
|
-
_a = billsBulkActionView.actions, exports.updateBillsBulkActionList = _a.updateBillsBulkActionList, exports.removeBillFromBulkActionList = _a.removeBillFromBulkActionList, exports.clearAllBillsFromBulkActionList = _a.clearAllBillsFromBulkActionList, exports.reviewDraftBillsBulkAction = _a.reviewDraftBillsBulkAction, exports.reviewDraftBillsBulkActionSuccess = _a.reviewDraftBillsBulkActionSuccess, exports.reviewDraftBillsBulkActionFailure = _a.reviewDraftBillsBulkActionFailure, exports.submitDraftBillsBulkAction = _a.submitDraftBillsBulkAction, exports.approveOrRejectBillsBulkAction = _a.approveOrRejectBillsBulkAction, exports.cancelOrDeleteBillsBulkAction = _a.cancelOrDeleteBillsBulkAction, exports.billsBulkActionFailure = _a.billsBulkActionFailure, exports.autoReviewPendingApprovalBills = _a.autoReviewPendingApprovalBills, exports.incrementBulkActionProcessedCount = _a.incrementBulkActionProcessedCount, exports.billsBulkActionSuccess = _a.billsBulkActionSuccess, exports.clearBillPayBulkActionView = _a.clearBillPayBulkActionView;
|
|
166
|
-
exports.default = billsBulkActionView.reducer;
|
package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../../reducer';
|
|
2
|
-
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
3
|
-
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
import { Amount } from '../../../../commonStateTypes/amount';
|
|
5
|
-
import { BulkOperationProgress, BulkOperationType, BulkReviewStatusCode } from './billsBulkActionViewState';
|
|
6
|
-
import { BillsSubTabType, BillTab } from '../billList/billListState';
|
|
7
|
-
export interface BillForReview {
|
|
8
|
-
transactionId: ID;
|
|
9
|
-
vendorName: string;
|
|
10
|
-
invoiceNumber: string;
|
|
11
|
-
isRecurring: boolean;
|
|
12
|
-
amount?: Amount;
|
|
13
|
-
reviewStatus?: BulkReviewStatusCode;
|
|
14
|
-
reviewInfoMessage?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface BillsBulkReviewView extends SelectorView {
|
|
17
|
-
billsForReview: BillForReview[];
|
|
18
|
-
bulkSubmissionFetchState: FetchState;
|
|
19
|
-
bulkOperationTypeSelected: BulkOperationType;
|
|
20
|
-
currentTab: BillTab;
|
|
21
|
-
currentSubTab: BillsSubTabType;
|
|
22
|
-
}
|
|
23
|
-
export declare const getBillsBulkReviewView: (state: RootState) => BillsBulkReviewView;
|
|
24
|
-
export declare const getBillsBulkOperationProgress: (state: RootState) => BulkOperationProgress;
|
|
@@ -1,45 +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.getBillsBulkOperationProgress = exports.getBillsBulkReviewView = void 0;
|
|
7
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
-
const getBillsBulkReviewView = (state) => {
|
|
9
|
-
const { billTransactionState, billsBulkActionViewState, billListState } = state;
|
|
10
|
-
const transactionIds = billsBulkActionViewState.billsSelectedForBulkAction;
|
|
11
|
-
const { currentTab, currentSubTab } = billListState;
|
|
12
|
-
let selectedTransactions = transactionIds.map((transactionId) => {
|
|
13
|
-
var _a, _b, _c, _d;
|
|
14
|
-
const transaction = (0, get_1.default)(billTransactionState.transactionById, transactionId, undefined);
|
|
15
|
-
return {
|
|
16
|
-
transactionId,
|
|
17
|
-
isRecurring: (_a = transaction === null || transaction === void 0 ? void 0 : transaction.isRecurring) !== null && _a !== void 0 ? _a : false,
|
|
18
|
-
vendorName: (_c = (_b = transaction === null || transaction === void 0 ? void 0 : transaction.vendor) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '',
|
|
19
|
-
invoiceNumber: (_d = transaction === null || transaction === void 0 ? void 0 : transaction.documentId) !== null && _d !== void 0 ? _d : '',
|
|
20
|
-
amount: transaction === null || transaction === void 0 ? void 0 : transaction.totalAmountInUSD,
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
const bulkReviewFetchState = billsBulkActionViewState.bulkReviewFetchState.fetchState;
|
|
24
|
-
const bulkSubmissionFetchState = billsBulkActionViewState.bulkSubmissionFetchState.fetchState;
|
|
25
|
-
if (bulkReviewFetchState === 'Completed') {
|
|
26
|
-
selectedTransactions = selectedTransactions.map((transaction) => {
|
|
27
|
-
const { status, error } = billsBulkActionViewState.bulkReviewStateById[transaction.transactionId];
|
|
28
|
-
return Object.assign(Object.assign({}, transaction), { reviewStatus: status, reviewInfoMessage: error === null || error === void 0 ? void 0 : error.message });
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
fetchState: bulkReviewFetchState,
|
|
33
|
-
billsForReview: selectedTransactions,
|
|
34
|
-
bulkSubmissionFetchState,
|
|
35
|
-
bulkOperationTypeSelected: billsBulkActionViewState.bulkOperationTypeSelected,
|
|
36
|
-
currentTab,
|
|
37
|
-
currentSubTab,
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
exports.getBillsBulkReviewView = getBillsBulkReviewView;
|
|
41
|
-
const getBillsBulkOperationProgress = (state) => {
|
|
42
|
-
const { billsBulkActionViewState } = state;
|
|
43
|
-
return billsBulkActionViewState.bulkOperationProgress;
|
|
44
|
-
};
|
|
45
|
-
exports.getBillsBulkOperationProgress = getBillsBulkOperationProgress;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
|
-
export interface BulkOperationProgress {
|
|
3
|
-
billsProcessed: number;
|
|
4
|
-
billsProcessing: number;
|
|
5
|
-
refreshTimeInSeconds: number;
|
|
6
|
-
}
|
|
7
|
-
export interface BillsBulkActionViewState {
|
|
8
|
-
billsSelectedForBulkAction: ID[];
|
|
9
|
-
bulkReviewStateById: Record<ID, BulkReviewState>;
|
|
10
|
-
bulkReviewFetchState: FetchStateAndError;
|
|
11
|
-
bulkSubmissionFetchState: FetchStateAndError;
|
|
12
|
-
bulkOperationTypeSelected: BulkOperationType;
|
|
13
|
-
bulkOperationProgress: BulkOperationProgress;
|
|
14
|
-
}
|
|
15
|
-
export interface BulkReviewState {
|
|
16
|
-
transactionId: ID;
|
|
17
|
-
status: BulkReviewStatusCode;
|
|
18
|
-
error?: {
|
|
19
|
-
code: string;
|
|
20
|
-
message: string;
|
|
21
|
-
duplicateTransactionIds: ID[];
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare type BulkOperationType = 'approve' | 'reject' | 'send_for_approval' | 'delete' | 'cancel' | 'review';
|
|
25
|
-
export declare type BulkSelectExceptionInfoType = 'bookCloseDateDelete' | 'bookCloseDateProcessing' | 'processingSelectTogether' | 'processingWithOthers' | 'cancelProcessing' | 'cancelRecurring';
|
|
26
|
-
export declare const BULK_REVIEW_STATUS_CODES: readonly ["valid", "error", "warning"];
|
|
27
|
-
export declare const toBulkReviewStatusCode: (v: string) => "error" | "valid" | "warning";
|
|
28
|
-
export declare type BulkReviewStatusCode = ReturnType<typeof toBulkReviewStatusCode>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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;
|
|
@@ -1,9 +0,0 @@
|
|
|
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 { approveOrRejectBillsBulkAction, billsBulkActionFailure, billsBulkActionSuccess } from '../billsBulkActionViewReducer';
|
|
7
|
-
import { updateBillTransactionsWithBulkActionStatus } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
|
|
8
|
-
export declare type ActionType = ReturnType<typeof approveOrRejectBillsBulkAction> | ReturnType<typeof updateBillTransactionsWithBulkActionStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof billsBulkActionFailure> | ReturnType<typeof billsBulkActionSuccess>;
|
|
9
|
-
export declare const approveOrRejectBillsBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.approveOrRejectBillsBulkActionEpic = 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 billsBulkActionViewReducer_1 = require("../billsBulkActionViewReducer");
|
|
9
|
-
const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
|
|
10
|
-
const approveOrRejectBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billsBulkActionViewReducer_1.approveOrRejectBillsBulkAction.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
-
const { approvalType, description } = action.payload;
|
|
12
|
-
const { billsBulkActionViewState } = state$.value;
|
|
13
|
-
const transactionIds = billsBulkActionViewState.billsSelectedForBulkAction;
|
|
14
|
-
const payload = prepareBulkApproveOrRejectPayload(transactionIds, approvalType, description);
|
|
15
|
-
return zeniAPI
|
|
16
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bulk/bills/transactions`, payload)
|
|
17
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19
|
-
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
20
|
-
const actions = [];
|
|
21
|
-
actions.push((0, billsBulkActionViewReducer_1.billsBulkActionSuccess)({
|
|
22
|
-
billsProcessing: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0,
|
|
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, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
|
|
26
|
-
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
27
|
-
messageSection: 'bill_pay_bulk_submit',
|
|
28
|
-
messageText: 'success',
|
|
29
|
-
type: 'success',
|
|
30
|
-
variables: [
|
|
31
|
-
{
|
|
32
|
-
variableName: '_count_',
|
|
33
|
-
variableValue: (_h = (_g = response.data) === null || _g === void 0 ? void 0 : _g.total_operations_processing.toString()) !== null && _h !== void 0 ? _h : '',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
variableName: '_action_',
|
|
37
|
-
variableValue: approvalType,
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
}));
|
|
41
|
-
return (0, rxjs_1.from)(actions);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.billsBulkActionFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
45
|
-
messageSection: 'bill_pay_bulk_submit',
|
|
46
|
-
messageText: 'failed',
|
|
47
|
-
type: 'error',
|
|
48
|
-
variables: [
|
|
49
|
-
{
|
|
50
|
-
variableName: '_api-error_',
|
|
51
|
-
variableValue: response.status.message,
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.billsBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bill bulk action REST API call errored out ' +
|
|
57
|
-
JSON.stringify(error))))));
|
|
58
|
-
}));
|
|
59
|
-
exports.approveOrRejectBillsBulkActionEpic = approveOrRejectBillsBulkActionEpic;
|
|
60
|
-
function prepareBulkApproveOrRejectPayload(transactionIds, approvalType, description) {
|
|
61
|
-
const bulkApproveOrRejectItems = transactionIds.map((id) => ({
|
|
62
|
-
entity_id: id,
|
|
63
|
-
request_data: {
|
|
64
|
-
approval_status: approvalType,
|
|
65
|
-
is_include_entity_approval: true,
|
|
66
|
-
description: description !== null && description !== void 0 ? description : '',
|
|
67
|
-
},
|
|
68
|
-
}));
|
|
69
|
-
return {
|
|
70
|
-
operation_type: approvalType === 'approved' ? 'approve' : 'reject',
|
|
71
|
-
operations: bulkApproveOrRejectItems,
|
|
72
|
-
};
|
|
73
|
-
}
|