@zeniai/client-epic-state 5.0.67-beta0ND → 5.0.67
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/chargeCard/chargeCardReducer.d.ts +2 -19
- package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
- package/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
- package/lib/entity/creditAgent/creditAgentState.d.ts +1 -1
- package/lib/epic.d.ts +10 -11
- package/lib/epic.js +11 -12
- package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
- package/lib/esm/epic.js +11 -12
- package/lib/esm/index.js +13 -19
- package/lib/esm/reducer.js +2 -8
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -127
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +0 -4
- package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -28
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/index.d.ts +15 -22
- package/lib/index.js +58 -77
- package/lib/reducer.d.ts +2 -8
- package/lib/reducer.js +2 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -8
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -128
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -14
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -40
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +1 -2
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +0 -4
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -29
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/package.json +1 -1
- package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
- package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
- package/lib/commonStateTypes/pusherActions.d.ts +0 -11
- package/lib/commonStateTypes/pusherActions.js +0 -6
- package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.d.ts +0 -36
- package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.js +0 -55
- package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.d.ts +0 -6
- package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.js +0 -27
- package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.d.ts +0 -4
- package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.js +0 -17
- package/lib/entity/scheduleActivityLog/scheduleActivityLogState.d.ts +0 -51
- package/lib/entity/scheduleActivityLog/scheduleActivityLogState.js +0 -23
- package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
- package/lib/esm/commonStateTypes/pusherActions.js +0 -3
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogPayload.js +0 -49
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogReducer.js +0 -23
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogSelector.js +0 -10
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogState.js +0 -19
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
- package/lib/esm/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +0 -43
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +0 -1
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +0 -47
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +0 -33
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewState.js +0 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
- package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
- package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.d.ts +0 -9
- package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +0 -47
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.d.ts +0 -8
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +0 -2
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.d.ts +0 -17
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +0 -51
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.d.ts +0 -8
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +0 -36
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.d.ts +0 -5
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.js +0 -2
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
|
|
2
|
-
export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
|
|
3
|
-
/**
|
|
4
|
-
* "No sub-tab filter" sentinel — single source of truth for the default
|
|
5
|
-
* value of {@link CompletedSubTab}. Use this constant in initial slice
|
|
6
|
-
* state and at any call site that needs to fall back to the parent-tab
|
|
7
|
-
* listing semantics (review tab requests, manual-search overrides, etc.)
|
|
8
|
-
* so a future rename of the union doesn't require chasing literals.
|
|
9
|
-
*/
|
|
10
|
-
export declare const DEFAULT_COMPLETED_SUB_TAB: CompletedSubTab;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_COMPLETED_SUB_TAB = exports.toCompletedSubTab = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
-
/**
|
|
6
|
-
* Sub-tabs that can appear under any "Completed" tab in the Expense Automation
|
|
7
|
-
* surface (Transaction Categorization Completed and Missing Receipts Completed
|
|
8
|
-
* both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
|
|
9
|
-
* / `match_type`. `'all'` preserves parent-tab semantics on the backend.
|
|
10
|
-
*/
|
|
11
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
12
|
-
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
13
|
-
exports.toCompletedSubTab = toCompletedSubTab;
|
|
14
|
-
/**
|
|
15
|
-
* "No sub-tab filter" sentinel — single source of truth for the default
|
|
16
|
-
* value of {@link CompletedSubTab}. Use this constant in initial slice
|
|
17
|
-
* state and at any call site that needs to fall back to the parent-tab
|
|
18
|
-
* listing semantics (review tab requests, manual-search overrides, etc.)
|
|
19
|
-
* so a future rename of the union doesn't require chasing literals.
|
|
20
|
-
*/
|
|
21
|
-
exports.DEFAULT_COMPLETED_SUB_TAB = 'all';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateScheduleActivityLogs } from '../../entity/scheduleActivityLog/scheduleActivityLogReducer';
|
|
4
|
-
import { updateAllUsers } from '../../entity/user/userReducer';
|
|
5
|
-
import { RootState } from '../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../zeniAPI';
|
|
7
|
-
import { fetchScheduleActivityLog, updateScheduleActivityLogViewFetchStatus, updateScheduleActivityLogViewOnSuccess } from './scheduleActivityLogViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchScheduleActivityLog> | ReturnType<typeof updateScheduleActivityLogs> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateScheduleActivityLogViewOnSuccess> | ReturnType<typeof updateScheduleActivityLogViewFetchStatus>;
|
|
9
|
-
export declare const fetchScheduleActivityLogEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchScheduleActivityLogEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const scheduleActivityLogReducer_1 = require("../../entity/scheduleActivityLog/scheduleActivityLogReducer");
|
|
7
|
-
const userReducer_1 = require("../../entity/user/userReducer");
|
|
8
|
-
const responsePayload_1 = require("../../responsePayload");
|
|
9
|
-
const scheduleActivityLogViewReducer_1 = require("./scheduleActivityLogViewReducer");
|
|
10
|
-
const fetchScheduleActivityLogEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleActivityLogViewReducer_1.fetchScheduleActivityLog.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { scheduleId } = action.payload;
|
|
12
|
-
return zeniAPI
|
|
13
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/${scheduleId}/activity`)
|
|
14
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
16
|
-
response.data != null &&
|
|
17
|
-
response.data.activity != null) {
|
|
18
|
-
const updateActions = [];
|
|
19
|
-
if (response.data.users != null &&
|
|
20
|
-
response.data.users.length > 0) {
|
|
21
|
-
updateActions.push((0, userReducer_1.updateAllUsers)({
|
|
22
|
-
users: response.data.users,
|
|
23
|
-
updateType: 'merge',
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
updateActions.push((0, scheduleActivityLogReducer_1.updateScheduleActivityLogs)(response.data.activity));
|
|
27
|
-
updateActions.push((0, scheduleActivityLogViewReducer_1.updateScheduleActivityLogViewOnSuccess)({
|
|
28
|
-
data: response.data.activity,
|
|
29
|
-
scheduleId,
|
|
30
|
-
}));
|
|
31
|
-
return (0, rxjs_1.from)(updateActions);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return (0, rxjs_1.of)((0, scheduleActivityLogViewReducer_1.updateScheduleActivityLogViewFetchStatus)({
|
|
35
|
-
fetchState: 'Error',
|
|
36
|
-
error: response.status,
|
|
37
|
-
scheduleId,
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, scheduleActivityLogViewReducer_1.updateScheduleActivityLogViewFetchStatus)({
|
|
41
|
-
scheduleId,
|
|
42
|
-
fetchState: 'Error',
|
|
43
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch schedule activity log REST API call errored out' +
|
|
44
|
-
JSON.stringify(error)),
|
|
45
|
-
}))));
|
|
46
|
-
}));
|
|
47
|
-
exports.fetchScheduleActivityLogEpic = fetchScheduleActivityLogEpic;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ScheduleActivityLogPayload } from '../../entity/scheduleActivityLog/scheduleActivityLogPayload';
|
|
2
|
-
import { UserPayload } from '../../entity/user/userPayload';
|
|
3
|
-
import { ZeniAPIResponse } from '../../responsePayload';
|
|
4
|
-
export interface FetchScheduleActivityLogPayload {
|
|
5
|
-
activity: ScheduleActivityLogPayload[];
|
|
6
|
-
users?: UserPayload[];
|
|
7
|
-
}
|
|
8
|
-
export type FetchScheduleActivityLogResponse = ZeniAPIResponse<FetchScheduleActivityLogPayload>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FetchState } from '../../commonStateTypes/common';
|
|
2
|
-
import { ScheduleActivityLogPayload } from '../../entity/scheduleActivityLog/scheduleActivityLogPayload';
|
|
3
|
-
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
-
import { ScheduleActivityLogViewState } from './scheduleActivityLogViewState';
|
|
5
|
-
export declare const initialState: ScheduleActivityLogViewState;
|
|
6
|
-
export declare const fetchScheduleActivityLog: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleId: string], {
|
|
7
|
-
scheduleId: string;
|
|
8
|
-
}, "scheduleActivityLogView/fetchScheduleActivityLog", never, never>, updateScheduleActivityLogViewOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
-
data: ScheduleActivityLogPayload[];
|
|
10
|
-
scheduleId: string;
|
|
11
|
-
}, "scheduleActivityLogView/updateScheduleActivityLogViewOnSuccess">, clearScheduleActivityLogView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"scheduleActivityLogView/clearScheduleActivityLogView">, updateScheduleActivityLogViewFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
|
-
fetchState: FetchState;
|
|
13
|
-
scheduleId: string;
|
|
14
|
-
error?: ZeniAPIStatus;
|
|
15
|
-
}, "scheduleActivityLogView/updateScheduleActivityLogViewFetchStatus">;
|
|
16
|
-
declare const _default: import("redux").Reducer<ScheduleActivityLogViewState>;
|
|
17
|
-
export default _default;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateScheduleActivityLogViewFetchStatus = exports.clearScheduleActivityLogView = exports.updateScheduleActivityLogViewOnSuccess = exports.fetchScheduleActivityLog = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const scheduleActivityLogPayload_1 = require("../../entity/scheduleActivityLog/scheduleActivityLogPayload");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
scheduleActivityLogIdsByScheduleId: {},
|
|
9
|
-
scheduleActivityLogFetchStateByScheduleId: {},
|
|
10
|
-
};
|
|
11
|
-
const scheduleActivityLogView = (0, toolkit_1.createSlice)({
|
|
12
|
-
name: 'scheduleActivityLogView',
|
|
13
|
-
initialState: exports.initialState,
|
|
14
|
-
reducers: {
|
|
15
|
-
fetchScheduleActivityLog: {
|
|
16
|
-
prepare(scheduleId) {
|
|
17
|
-
return {
|
|
18
|
-
payload: { scheduleId },
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
reducer(draft, action) {
|
|
22
|
-
const { scheduleId } = action.payload;
|
|
23
|
-
draft.scheduleActivityLogFetchStateByScheduleId[scheduleId] = {
|
|
24
|
-
fetchState: 'In-Progress',
|
|
25
|
-
error: undefined,
|
|
26
|
-
};
|
|
27
|
-
draft.scheduleActivityLogIdsByScheduleId[scheduleId] = [];
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
updateScheduleActivityLogViewOnSuccess(draft, action) {
|
|
31
|
-
const { data, scheduleId } = action.payload;
|
|
32
|
-
draft.scheduleActivityLogFetchStateByScheduleId[scheduleId] = {
|
|
33
|
-
fetchState: 'Completed',
|
|
34
|
-
error: undefined,
|
|
35
|
-
};
|
|
36
|
-
draft.scheduleActivityLogIdsByScheduleId[scheduleId] = data.map((scheduleActivityLog) => (0, scheduleActivityLogPayload_1.toScheduleActivityLogId)(scheduleActivityLog.correlation_id, scheduleActivityLog.event_type, scheduleActivityLog.data?.transaction?.line_id));
|
|
37
|
-
},
|
|
38
|
-
updateScheduleActivityLogViewFetchStatus(draft, action) {
|
|
39
|
-
const { fetchState, scheduleId, error } = action.payload;
|
|
40
|
-
draft.scheduleActivityLogFetchStateByScheduleId[scheduleId] = {
|
|
41
|
-
fetchState,
|
|
42
|
-
error,
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
clearScheduleActivityLogView(draft) {
|
|
46
|
-
Object.assign(draft, exports.initialState);
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
_a = scheduleActivityLogView.actions, exports.fetchScheduleActivityLog = _a.fetchScheduleActivityLog, exports.updateScheduleActivityLogViewOnSuccess = _a.updateScheduleActivityLogViewOnSuccess, exports.clearScheduleActivityLogView = _a.clearScheduleActivityLogView, exports.updateScheduleActivityLogViewFetchStatus = _a.updateScheduleActivityLogViewFetchStatus;
|
|
51
|
-
exports.default = scheduleActivityLogView.reducer;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { ScheduleActivityLog } from '../../entity/scheduleActivityLog/scheduleActivityLogState';
|
|
4
|
-
import { RootState } from '../../reducer';
|
|
5
|
-
export interface ScheduleActivityLogViewSelectorView extends SelectorView {
|
|
6
|
-
scheduleActivityLogs: ScheduleActivityLog[];
|
|
7
|
-
}
|
|
8
|
-
export declare const getScheduleActivityLogView: (state: RootState, scheduleId: ID) => ScheduleActivityLogViewSelectorView;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getScheduleActivityLogView = void 0;
|
|
4
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
6
|
-
const scheduleActivityLogSelector_1 = require("../../entity/scheduleActivityLog/scheduleActivityLogSelector");
|
|
7
|
-
exports.getScheduleActivityLogView = (0, toolkit_1.createSelector)((state) => state.scheduleActivityLogViewState, (state) => state.scheduleActivityLogState, (state) => state.userState, (_state, scheduleId) => scheduleId, (scheduleActivityLogViewState, scheduleActivityLogState, userState, scheduleId) => {
|
|
8
|
-
const fetchStateAndError = scheduleActivityLogViewState
|
|
9
|
-
.scheduleActivityLogFetchStateByScheduleId[scheduleId] ?? {
|
|
10
|
-
fetchState: 'Not-Started',
|
|
11
|
-
error: undefined,
|
|
12
|
-
};
|
|
13
|
-
const scheduleActivityLogIds = scheduleActivityLogViewState.scheduleActivityLogIdsByScheduleId[scheduleId] ?? [];
|
|
14
|
-
const rawLogs = (0, scheduleActivityLogSelector_1.getScheduleActivityLogsByIds)(scheduleActivityLogState, scheduleActivityLogIds);
|
|
15
|
-
const scheduleActivityLogs = rawLogs.map((log) => {
|
|
16
|
-
const userId = log.data?.transaction?.userId;
|
|
17
|
-
if (userId == null || log.data == null) {
|
|
18
|
-
return log;
|
|
19
|
-
}
|
|
20
|
-
const user = userState.userByUserId[userId];
|
|
21
|
-
if (user == null) {
|
|
22
|
-
return log;
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
...log,
|
|
26
|
-
data: {
|
|
27
|
-
...log.data,
|
|
28
|
-
user,
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
...(0, reduceFetchState_1.reduceFetchState)([fetchStateAndError]),
|
|
34
|
-
scheduleActivityLogs,
|
|
35
|
-
};
|
|
36
|
-
});
|