@zeniai/client-epic-state 5.2.41 → 5.2.42
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/actualMatching/actualMatchingPayload.d.ts +31 -0
- package/lib/entity/actualMatching/actualMatchingPayload.js +52 -0
- package/lib/entity/actualMatching/actualMatchingReducer.d.ts +9 -0
- package/lib/entity/actualMatching/actualMatchingReducer.js +33 -0
- package/lib/entity/actualMatching/actualMatchingSelector.d.ts +3 -0
- package/lib/entity/actualMatching/actualMatchingSelector.js +6 -0
- package/lib/entity/actualMatching/actualMatchingState.d.ts +23 -0
- package/lib/entity/actualMatching/actualMatchingState.js +2 -0
- package/lib/entity/actualMatching/actualMatchingTypes.d.ts +1 -0
- package/lib/entity/actualMatching/actualMatchingTypes.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +31 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +53 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +33 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/epic.d.ts +8 -1
- package/lib/epic.js +14 -0
- package/lib/esm/entity/actualMatching/actualMatchingPayload.js +48 -0
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +30 -0
- package/lib/esm/entity/actualMatching/actualMatchingSelector.js +3 -0
- package/lib/esm/entity/actualMatching/actualMatchingState.js +1 -0
- package/lib/esm/entity/actualMatching/actualMatchingTypes.js +1 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +53 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/epic.js +14 -0
- package/lib/esm/index.js +7 -3
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +46 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +36 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.js +7 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +108 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.js +16 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.js +60 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +74 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +78 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +40 -15
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +19 -8
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewState.js +4 -2
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +68 -0
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +462 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +426 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +38 -0
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
- package/lib/index.d.ts +14 -5
- package/lib/index.js +82 -48
- package/lib/reducer.d.ts +2 -0
- package/lib/reducer.js +6 -0
- package/lib/rootStateTypes.d.ts +4 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +50 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +12 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +40 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.js +11 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +112 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.d.ts +3 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.js +19 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.js +64 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +78 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +82 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +5 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +39 -14
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +18 -7
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +6 -3
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +85 -0
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +74 -0
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +79 -0
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +466 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -5
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +87 -0
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +11 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +38 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +445 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +106 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +46 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
|
+
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
|
+
import { ActualMatchingMatchId } from '../../../entity/actualMatching/actualMatchingTypes';
|
|
5
|
+
import { JEOneTimeAccrualKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
6
|
+
export declare const toActualMatchingSortKey: (v: string) => "type" | "date" | "vendor" | "category" | "class" | "amount" | "variance" | "lifecycle" | "service" | "accrued" | "actual";
|
|
7
|
+
export type ActualMatchingSortKey = ReturnType<typeof toActualMatchingSortKey>;
|
|
8
|
+
export declare const MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
|
|
9
|
+
export declare const MATCH_ACCRUAL_SEARCH_LIMIT = 50;
|
|
10
|
+
export declare const MATCH_SEARCH_DEBOUNCE_MS = 300;
|
|
11
|
+
export declare const toMatchAndReverseResultStatus: (v: string) => "error" | "reversed" | "noop" | "conflict" | "claim_lost";
|
|
12
|
+
export type MatchAndReverseResultStatus = ReturnType<typeof toMatchAndReverseResultStatus>;
|
|
13
|
+
export interface ActualMatchingViewUIState {
|
|
14
|
+
scrollPosition: {
|
|
15
|
+
scrollTop: number;
|
|
16
|
+
scrollLeft?: number;
|
|
17
|
+
} | undefined;
|
|
18
|
+
searchString: string;
|
|
19
|
+
sortKey: ActualMatchingSortKey;
|
|
20
|
+
sortOrder: SortOrder;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sibling of Missing Receipts `MatchCandidate`. Confirm needs `lineId` and
|
|
24
|
+
* `transactionIntegrationId` on every row — those fields are required here.
|
|
25
|
+
*/
|
|
26
|
+
export interface ActualMatchingTransactionSearchResult {
|
|
27
|
+
amount: number;
|
|
28
|
+
currencyCode: string;
|
|
29
|
+
currencySymbol: string;
|
|
30
|
+
lineId: string;
|
|
31
|
+
syncToken: string;
|
|
32
|
+
transactionDate: string;
|
|
33
|
+
transactionId: ID;
|
|
34
|
+
transactionIntegrationId: string;
|
|
35
|
+
transactionType: string;
|
|
36
|
+
vendorName: string;
|
|
37
|
+
accountDescription?: string;
|
|
38
|
+
accountId?: ID;
|
|
39
|
+
accountingClassId?: ID;
|
|
40
|
+
accountingClassName?: string;
|
|
41
|
+
accountName?: string;
|
|
42
|
+
transactionDescription?: string;
|
|
43
|
+
transactionMemo?: string;
|
|
44
|
+
transactionTypeName?: string;
|
|
45
|
+
vendorId?: ID;
|
|
46
|
+
}
|
|
47
|
+
export interface MatchAndReverseResult {
|
|
48
|
+
accrualId: ID;
|
|
49
|
+
status: MatchAndReverseResultStatus;
|
|
50
|
+
reason?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function isMatchAndReverseCompleteStatus(status: MatchAndReverseResultStatus): boolean;
|
|
53
|
+
export interface MatchAndReverseAccrualsParams {
|
|
54
|
+
accrualIds: ID[];
|
|
55
|
+
lineIds: ID[];
|
|
56
|
+
transactionId: ID;
|
|
57
|
+
transactionIntegrationId: string;
|
|
58
|
+
transactionSyncToken: string;
|
|
59
|
+
transactionType: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const toUndoReversalResultStatus: (v: string) => "error" | "claim_lost" | "undone";
|
|
62
|
+
export type UndoReversalResultStatus = ReturnType<typeof toUndoReversalResultStatus>;
|
|
63
|
+
export interface UndoReversalResult {
|
|
64
|
+
accrualId: ID;
|
|
65
|
+
status: UndoReversalResultStatus;
|
|
66
|
+
reason?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface UndoReversalAccrualsParams {
|
|
69
|
+
accrualIds: ID[];
|
|
70
|
+
matchId: ActualMatchingMatchId;
|
|
71
|
+
}
|
|
72
|
+
export interface ActualMatchingTransactionSearchState extends FetchStateAndError {
|
|
73
|
+
isLoadingMore: boolean;
|
|
74
|
+
nextPageToken: string | null;
|
|
75
|
+
query: string;
|
|
76
|
+
results: ActualMatchingTransactionSearchResult[];
|
|
77
|
+
}
|
|
78
|
+
export interface ActualMatchingAccrualSearchState extends FetchStateAndError {
|
|
79
|
+
isLoadingMore: boolean;
|
|
80
|
+
nextPageToken: string | null;
|
|
81
|
+
query: string;
|
|
82
|
+
results: JEOneTimeAccrualKey[];
|
|
83
|
+
}
|
|
84
|
+
export interface ActualMatchingMatchModalState {
|
|
85
|
+
accrualSearch: ActualMatchingAccrualSearchState;
|
|
86
|
+
confirmStatus: FetchStateAndError;
|
|
87
|
+
didPinPrefillTransactions: boolean;
|
|
88
|
+
isOpen: boolean;
|
|
89
|
+
pinnedTransactionResults: ActualMatchingTransactionSearchResult[];
|
|
90
|
+
transactionSearch: ActualMatchingTransactionSearchState;
|
|
91
|
+
lastBatchResults?: MatchAndReverseResult[];
|
|
92
|
+
openedFromMatchId?: ActualMatchingMatchId;
|
|
93
|
+
}
|
|
94
|
+
export declare function actualMatchingTransactionLineKey(transactionType: string, transactionIntegrationId: string, lineId: string): string;
|
|
95
|
+
export interface ActualMatchingViewState extends FetchedState {
|
|
96
|
+
closeMatchAfterUndo: boolean;
|
|
97
|
+
detailFetchStateByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
98
|
+
detailRefreshStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
99
|
+
lastMatchResultsByMatchId: Record<ActualMatchingMatchId, MatchAndReverseResult[]>;
|
|
100
|
+
lastUndoResultsByMatchId: Record<ActualMatchingMatchId, UndoReversalResult[]>;
|
|
101
|
+
matchIdsByPeriod: Record<MonthYearPeriodId, ActualMatchingMatchId[]>;
|
|
102
|
+
matchModal: ActualMatchingMatchModalState;
|
|
103
|
+
refreshStatus: FetchStateAndError;
|
|
104
|
+
uiState: ActualMatchingViewUIState;
|
|
105
|
+
undoReversalStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
106
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toUndoReversalResultStatus = exports.toMatchAndReverseResultStatus = exports.MATCH_SEARCH_DEBOUNCE_MS = exports.MATCH_ACCRUAL_SEARCH_LIMIT = exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = exports.toActualMatchingSortKey = void 0;
|
|
4
|
+
exports.isMatchAndReverseCompleteStatus = isMatchAndReverseCompleteStatus;
|
|
5
|
+
exports.actualMatchingTransactionLineKey = actualMatchingTransactionLineKey;
|
|
6
|
+
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
7
|
+
const ACTUAL_MATCHING_SORT_KEYS = [
|
|
8
|
+
'vendor',
|
|
9
|
+
'date',
|
|
10
|
+
'amount',
|
|
11
|
+
'category',
|
|
12
|
+
'class',
|
|
13
|
+
'type',
|
|
14
|
+
'lifecycle',
|
|
15
|
+
'service',
|
|
16
|
+
'accrued',
|
|
17
|
+
'actual',
|
|
18
|
+
'variance',
|
|
19
|
+
];
|
|
20
|
+
const toActualMatchingSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_SORT_KEYS);
|
|
21
|
+
exports.toActualMatchingSortKey = toActualMatchingSortKey;
|
|
22
|
+
exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
|
|
23
|
+
exports.MATCH_ACCRUAL_SEARCH_LIMIT = 50;
|
|
24
|
+
exports.MATCH_SEARCH_DEBOUNCE_MS = 300;
|
|
25
|
+
const MATCH_AND_REVERSE_RESULT_STATUSES = [
|
|
26
|
+
'reversed',
|
|
27
|
+
'noop',
|
|
28
|
+
'conflict',
|
|
29
|
+
'claim_lost',
|
|
30
|
+
'error',
|
|
31
|
+
];
|
|
32
|
+
const toMatchAndReverseResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, MATCH_AND_REVERSE_RESULT_STATUSES);
|
|
33
|
+
exports.toMatchAndReverseResultStatus = toMatchAndReverseResultStatus;
|
|
34
|
+
function isMatchAndReverseCompleteStatus(status) {
|
|
35
|
+
return status === 'reversed' || status === 'noop';
|
|
36
|
+
}
|
|
37
|
+
const UNDO_REVERSAL_RESULT_STATUSES = [
|
|
38
|
+
'undone',
|
|
39
|
+
'claim_lost',
|
|
40
|
+
'error',
|
|
41
|
+
];
|
|
42
|
+
const toUndoReversalResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, UNDO_REVERSAL_RESULT_STATUSES);
|
|
43
|
+
exports.toUndoReversalResultStatus = toUndoReversalResultStatus;
|
|
44
|
+
function actualMatchingTransactionLineKey(transactionType, transactionIntegrationId, lineId) {
|
|
45
|
+
return `${transactionType}:${transactionIntegrationId}:${lineId}`;
|
|
46
|
+
}
|
|
@@ -12,7 +12,7 @@ import { ZeniDate } from '../../../zeniDayJS';
|
|
|
12
12
|
import { JETransactionLink } from '../../scheduleView/scheduleDetailView/scheduleDetailState';
|
|
13
13
|
export declare const toJEScheduleSortKey: (v: string) => "type" | "vendor" | "category" | "class" | "memo" | "jePostingDate" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "remainingMonths" | "totalAmount" | "transactionDate";
|
|
14
14
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
15
|
-
export declare const toJEPageTab: (v: string) => "schedules" | "existing_schedules";
|
|
15
|
+
export declare const toJEPageTab: (v: string) => "schedules" | "actual_matching" | "existing_schedules";
|
|
16
16
|
export type JEPageTab = ReturnType<typeof toJEPageTab>;
|
|
17
17
|
export declare const ALL_JE_PAGE_TABS: readonly JEPageTab[];
|
|
18
18
|
export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
|
|
@@ -20,7 +20,14 @@ const JE_SCHEDULE_SORT_KEYS = [
|
|
|
20
20
|
];
|
|
21
21
|
const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
|
|
22
22
|
exports.toJEScheduleSortKey = toJEScheduleSortKey;
|
|
23
|
-
|
|
23
|
+
// `actual_matching` is chrome only: the JE tab bar includes it, but AM data is
|
|
24
|
+
// `expenseAutomationActualMatchingViewState`, not the schedules period-tab
|
|
25
|
+
// cache below. Walks of ALL_JE_PAGE_TABS that read schedule keys must skip it.
|
|
26
|
+
const JE_PAGE_TABS = [
|
|
27
|
+
'schedules',
|
|
28
|
+
'actual_matching',
|
|
29
|
+
'existing_schedules',
|
|
30
|
+
];
|
|
24
31
|
const toJEPageTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_PAGE_TABS);
|
|
25
32
|
exports.toJEPageTab = toJEPageTab;
|
|
26
33
|
exports.ALL_JE_PAGE_TABS = JE_PAGE_TABS;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.42",
|
|
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
|
"module": "lib/esm/index.js",
|