@zeniai/client-epic-state 5.1.72 → 5.1.73-betaRD2
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/jeSchedules/jeSchedulesPayload.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +13 -2
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +1 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +1 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +13 -2
- package/lib/esm/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +1 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/esm/epic.js +5 -1
- package/lib/esm/index.js +10 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +23 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +21 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +73 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +133 -8
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +70 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +115 -15
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +3 -6
- package/lib/index.d.ts +11 -7
- package/lib/index.js +70 -48
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +21 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +45 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +77 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +7 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +40 -9
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +134 -8
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +25 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +31 -7
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +10 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +75 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +4 -1
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +117 -14
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +53 -6
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -8
- package/package.json +1 -1
|
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isAiAccountantSchedule = void 0;
|
|
7
|
+
exports.isAccruedScheduleRow = isAccruedScheduleRow;
|
|
6
8
|
exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
|
|
7
9
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
8
10
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
@@ -10,6 +12,7 @@ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState")
|
|
|
10
12
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
11
13
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
12
14
|
const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
|
|
15
|
+
const jeSchedulesTypes_1 = require("../../../entity/jeSchedules/jeSchedulesTypes");
|
|
13
16
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
14
17
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
15
18
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
@@ -18,6 +21,37 @@ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/
|
|
|
18
21
|
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
19
22
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
20
23
|
const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
|
|
24
|
+
const jeNewScheduleViewSelector_1 = require("./jeNewScheduleViewSelector");
|
|
25
|
+
// Matches the AI-automation user addresses webc's schedule list row already
|
|
26
|
+
// checks (JEScheduleReadOnlyListRow/JEScheduleDraftListRow "Method" column,
|
|
27
|
+
// strings.ts aiBotEmail/botEmail) to determine whether a schedule was
|
|
28
|
+
// created by the AI accountant vs. a human.
|
|
29
|
+
const AI_BOT_EMAIL = 'ai@zeni.ai';
|
|
30
|
+
const BOT_EMAIL = 'bot@zeni.ai';
|
|
31
|
+
// Exported (rather than kept as a closure inside the selector) so it can be
|
|
32
|
+
// unit-tested directly — confidenceScore is a separate, more narrowly
|
|
33
|
+
// populated field that can be null on a schedule the bot user created,
|
|
34
|
+
// which previously caused these schedules to display as "AI Accountant" in
|
|
35
|
+
// the list but count under "Manual" in the KPI summary.
|
|
36
|
+
const isAiAccountantSchedule = (schedule) => schedule.createdByUser?.email === AI_BOT_EMAIL ||
|
|
37
|
+
schedule.createdByUser?.email === BOT_EMAIL;
|
|
38
|
+
exports.isAiAccountantSchedule = isAiAccountantSchedule;
|
|
39
|
+
// Accrued schedules are structurally distinct — no baseTransaction, carrying recurringAmount and
|
|
40
|
+
// memo in its place — so anything reading baseTransaction has to branch on this first.
|
|
41
|
+
//
|
|
42
|
+
// Discriminates on jeAccruedScheduleKey, which only JEAccruedSchedule carries. jeScheduleType
|
|
43
|
+
// cannot be used: it is a data field present on BOTH row shapes, so an accrued-typed row that
|
|
44
|
+
// arrived through the prepaid/fixed DTO (failed_je_postings, legacy fetches) would be
|
|
45
|
+
// misclassified and then crash on recurringAmount / jeAccruedScheduleKey.
|
|
46
|
+
function isAccruedScheduleRow(schedule) {
|
|
47
|
+
return 'jeAccruedScheduleKey' in schedule;
|
|
48
|
+
}
|
|
49
|
+
function getScheduleAmount(schedule) {
|
|
50
|
+
if (isAccruedScheduleRow(schedule)) {
|
|
51
|
+
return schedule.recurringAmount.amount;
|
|
52
|
+
}
|
|
53
|
+
return schedule.baseTransaction.amount.amount;
|
|
54
|
+
}
|
|
21
55
|
function getJEScheduleSortAccessor(sortKey) {
|
|
22
56
|
switch (sortKey) {
|
|
23
57
|
case 'vendor':
|
|
@@ -29,7 +63,9 @@ function getJEScheduleSortAccessor(sortKey) {
|
|
|
29
63
|
case 'depCategory':
|
|
30
64
|
return (s) => s.jeCredit.account?.accountName?.toLowerCase();
|
|
31
65
|
case 'scheduleCategory':
|
|
32
|
-
return (s) => s
|
|
66
|
+
return (s) => isAccruedScheduleRow(s)
|
|
67
|
+
? undefined
|
|
68
|
+
: s.baseTransaction.account?.accountName?.toLowerCase();
|
|
33
69
|
case 'startMonth':
|
|
34
70
|
return (s) => s.startDate?.valueOf();
|
|
35
71
|
case 'type':
|
|
@@ -57,11 +93,13 @@ function getJEScheduleSortAccessor(sortKey) {
|
|
|
57
93
|
return s.balanceAsOfToday?.amount ?? null;
|
|
58
94
|
};
|
|
59
95
|
case 'totalAmount':
|
|
60
|
-
return (s) => s
|
|
96
|
+
return (s) => getScheduleAmount(s);
|
|
61
97
|
case 'transactionDate':
|
|
62
|
-
return (s) => s.
|
|
98
|
+
return (s) => s.createTime?.valueOf();
|
|
63
99
|
case 'memo':
|
|
64
|
-
return (s) => s
|
|
100
|
+
return (s) => isAccruedScheduleRow(s)
|
|
101
|
+
? s.memo.toLowerCase()
|
|
102
|
+
: s.baseTransaction.memo?.toLowerCase();
|
|
65
103
|
default:
|
|
66
104
|
return (s) => s.startDate?.valueOf();
|
|
67
105
|
}
|
|
@@ -73,9 +111,14 @@ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
|
|
|
73
111
|
function getExpenseAutomationJESchedulesView(state) {
|
|
74
112
|
const jeScheduledTransaction = [];
|
|
75
113
|
const failedJeScheduledTransaction = [];
|
|
114
|
+
const accruedSchedules = [];
|
|
76
115
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
77
|
-
const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
|
|
116
|
+
const { jeScheduleTransactionKeysByPeriod, jeScheduleAccruedKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
|
|
78
117
|
const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
|
|
118
|
+
const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
|
|
119
|
+
newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
|
|
120
|
+
? (0, jeNewScheduleViewSelector_1.getNewScheduleView)(state, newSchedule.selectedDetailScheduleType)
|
|
121
|
+
: undefined;
|
|
79
122
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
80
123
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
81
124
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
@@ -111,19 +154,24 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
111
154
|
: null;
|
|
112
155
|
const jeScheduleTransactionKeys = jeScheduleTransactionKeysForSelectedPeriod ?? [];
|
|
113
156
|
const failedJeScheduleTransactionKeys = failedJeScheduleTransactionKeysForSelectedPeriod ?? [];
|
|
157
|
+
const jeScheduleAccruedKeys = (monthYearPeriodId != null
|
|
158
|
+
? jeScheduleAccruedKeysByPeriod[monthYearPeriodId]
|
|
159
|
+
: null) ?? [];
|
|
114
160
|
jeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
115
161
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
116
162
|
jeScheduledTransaction.push(jeScheduleDetails);
|
|
117
163
|
});
|
|
164
|
+
jeScheduleAccruedKeys.forEach((jeAccruedScheduleKey) => {
|
|
165
|
+
const accruedScheduleDetails = (0, jeSchedulesSelector_1.getJEAccruedScheduleByJEScheduleKey)(jeAccruedScheduleKey, state);
|
|
166
|
+
if (accruedScheduleDetails != null) {
|
|
167
|
+
accruedSchedules.push(accruedScheduleDetails);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
118
170
|
failedJeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
119
171
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
120
172
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
121
173
|
});
|
|
122
|
-
const { sortKey, sortOrder } = uiState;
|
|
123
|
-
const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
|
|
124
|
-
const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
|
|
125
|
-
const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
|
|
126
|
-
schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
|
|
174
|
+
const { sortKey, sortOrder, selectedJETypeFilter } = uiState;
|
|
127
175
|
const unsortedResolveSchedules = [];
|
|
128
176
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
129
177
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
@@ -135,10 +183,46 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
135
183
|
});
|
|
136
184
|
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
137
185
|
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
186
|
+
const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
|
|
187
|
+
schedule.jeScheduleType === selectedJETypeFilter;
|
|
188
|
+
const isCreatedStatus = (schedule) => schedule.status.code === 'ongoing' ||
|
|
189
|
+
schedule.status.code === 'completed' ||
|
|
190
|
+
schedule.status.code === 'marked_as_completed';
|
|
191
|
+
const allScheduleRows = [
|
|
192
|
+
...jeScheduledTransaction,
|
|
193
|
+
...accruedSchedules,
|
|
194
|
+
];
|
|
138
195
|
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
139
|
-
...
|
|
196
|
+
...allScheduleRows.filter((schedule) => schedule.status.code === 'draft' && matchesTypeFilter(schedule)),
|
|
140
197
|
...validResolveForPending,
|
|
141
198
|
], sortKey, sortOrder);
|
|
199
|
+
const createdSchedules = sortJEScheduledTransactions(allScheduleRows.filter((schedule) => isCreatedStatus(schedule) && matchesTypeFilter(schedule)), sortKey, sortOrder);
|
|
200
|
+
// KPI summary — derived from unfiltered schedules so counts are always accurate
|
|
201
|
+
const allSchedules = allScheduleRows;
|
|
202
|
+
const sumAmount = (schedules) => schedules.reduce((total, schedule) => total + (getScheduleAmount(schedule) ?? 0), 0);
|
|
203
|
+
const pendingReviewTotal = sumAmount(pendingReviewSchedules);
|
|
204
|
+
const createdTotal = sumAmount(createdSchedules);
|
|
205
|
+
const aiAccountantSchedules = allSchedules.filter(exports.isAiAccountantSchedule);
|
|
206
|
+
const manualSchedules = allSchedules.filter((schedule) => !(0, exports.isAiAccountantSchedule)(schedule));
|
|
207
|
+
const pendingUnfiltered = allSchedules.filter((schedule) => schedule.status.code === 'draft');
|
|
208
|
+
const kpiSummary = {
|
|
209
|
+
aiAccountant: {
|
|
210
|
+
count: aiAccountantSchedules.length,
|
|
211
|
+
amount: sumAmount(aiAccountantSchedules),
|
|
212
|
+
},
|
|
213
|
+
manual: {
|
|
214
|
+
count: manualSchedules.length,
|
|
215
|
+
amount: sumAmount(manualSchedules),
|
|
216
|
+
},
|
|
217
|
+
needsReview: {
|
|
218
|
+
count: pendingUnfiltered.length,
|
|
219
|
+
amount: sumAmount(pendingUnfiltered),
|
|
220
|
+
},
|
|
221
|
+
total: {
|
|
222
|
+
count: allSchedules.length,
|
|
223
|
+
amount: sumAmount(allSchedules),
|
|
224
|
+
},
|
|
225
|
+
};
|
|
142
226
|
const allSteps = monthYearPeriodId != null
|
|
143
227
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
144
228
|
: [];
|
|
@@ -151,6 +235,22 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
151
235
|
{ fetchState, error },
|
|
152
236
|
monthEndFetchState,
|
|
153
237
|
]);
|
|
238
|
+
const countByType = (schedules) => {
|
|
239
|
+
const counts = jeSchedulesTypes_1.ALL_SCHEDULES_TYPES.reduce((acc, type) => ({ ...acc, [type]: 0 }), {});
|
|
240
|
+
schedules.forEach((schedule) => {
|
|
241
|
+
if (schedule.jeScheduleType != null) {
|
|
242
|
+
counts[schedule.jeScheduleType] += 1;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
return counts;
|
|
246
|
+
};
|
|
247
|
+
const jeScheduleTypeCounts = {
|
|
248
|
+
active: countByType(allSchedules.filter((schedule) => schedule.status.code === 'draft' ||
|
|
249
|
+
schedule.status.code === 'ongoing' ||
|
|
250
|
+
schedule.status.code === 'completed' ||
|
|
251
|
+
schedule.status.code === 'marked_as_completed')),
|
|
252
|
+
ongoing: countByType(allSchedules.filter((schedule) => schedule.status.code === 'ongoing')),
|
|
253
|
+
};
|
|
154
254
|
return {
|
|
155
255
|
uncategorizedAccounts,
|
|
156
256
|
allDepreciationAccountList: filteredDepAccounts,
|
|
@@ -159,12 +259,15 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
159
259
|
allAccountList: filteredAccounts,
|
|
160
260
|
accountListNestedAccountHierarchy,
|
|
161
261
|
allClassList: allClasses,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
262
|
+
createdSchedules,
|
|
263
|
+
createdTotal,
|
|
264
|
+
jeScheduleTypeCounts,
|
|
265
|
+
kpiSummary,
|
|
165
266
|
pendingReviewSchedules,
|
|
267
|
+
pendingReviewTotal,
|
|
166
268
|
resolveSchedules: resolveSchedules,
|
|
167
269
|
accountSettingsView,
|
|
270
|
+
newScheduleView,
|
|
168
271
|
postStatusById: postStatusById,
|
|
169
272
|
ignoreStatusById: ignoreStatusById,
|
|
170
273
|
fetchState: reducedFetchStatus.fetchState,
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
3
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
4
|
import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
4
5
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
5
|
-
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
6
|
+
import { MonthYearPeriodId, ScheduleDaysOfMonth } from '../../../commonStateTypes/timePeriod';
|
|
6
7
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
7
|
-
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
|
+
import { JEScheduleKey, JEScheduleTransactionKey, ScheduleJournalEntryStatusCodeType, ScheduleTransactionID, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
9
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
9
|
-
|
|
10
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
11
|
+
import { JETransactionLink } from '../../scheduleView/scheduleDetailView/scheduleDetailState';
|
|
12
|
+
export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "jePostingDate" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "remainingMonths";
|
|
10
13
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
11
|
-
export declare const
|
|
12
|
-
export type
|
|
14
|
+
export declare const toJEPageTab: (v: string) => "schedules" | "existing_schedules";
|
|
15
|
+
export type JEPageTab = ReturnType<typeof toJEPageTab>;
|
|
13
16
|
export interface JESchedulesViewUIState {
|
|
17
|
+
createdGroupCollapsed: boolean;
|
|
18
|
+
pendingGroupCollapsed: boolean;
|
|
14
19
|
scrollPosition: {
|
|
15
20
|
scrollTop: number;
|
|
16
21
|
scrollLeft?: number;
|
|
17
22
|
} | undefined;
|
|
18
23
|
searchString: string;
|
|
19
|
-
|
|
24
|
+
selectedJETypeFilter: ScheduleTypes | null;
|
|
25
|
+
selectedPageTab: JEPageTab;
|
|
20
26
|
sortKey: JEScheduleSortKey;
|
|
21
27
|
sortOrder: SortOrder;
|
|
22
28
|
totalCount: number;
|
|
@@ -35,12 +41,53 @@ export interface JESchedulesViewState extends FetchedState {
|
|
|
35
41
|
accountSettings: AccountSettingsState;
|
|
36
42
|
failedJeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
|
|
37
43
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
44
|
+
jeScheduleAccruedKeysByPeriod: Record<MonthYearPeriodId, JEScheduleKey[]>;
|
|
38
45
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
39
46
|
jeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
|
|
47
|
+
newSchedule: NewJeScheduleState;
|
|
40
48
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
41
49
|
refreshStatus: FetchStateAndError;
|
|
42
50
|
uiState: JESchedulesViewUIState;
|
|
43
51
|
}
|
|
52
|
+
export interface NewJeDetailLocalData {
|
|
53
|
+
amount: Amount;
|
|
54
|
+
jeLink: JETransactionLink;
|
|
55
|
+
memo: string;
|
|
56
|
+
postingDate: ZeniDate;
|
|
57
|
+
postingStatus: ScheduleJournalEntryStatusCodeType;
|
|
58
|
+
runningBalance: Amount;
|
|
59
|
+
}
|
|
60
|
+
export interface NewScheduleLocalData {
|
|
61
|
+
jeScheduleDetails: NewJeDetailLocalData[];
|
|
62
|
+
scheduleType: ScheduleTypes;
|
|
63
|
+
lastDayOfMonth?: boolean;
|
|
64
|
+
selectedAccount?: ID;
|
|
65
|
+
selectedBaseTransactionId?: ScheduleTransactionID;
|
|
66
|
+
selectedClass?: ID;
|
|
67
|
+
selectedDate?: ZeniDate;
|
|
68
|
+
selectedDayOfMonth?: ScheduleDaysOfMonth;
|
|
69
|
+
selectedJEScheduleKey?: JEScheduleTransactionKey;
|
|
70
|
+
selectedMonths?: number;
|
|
71
|
+
selectedVendor?: VendorBase;
|
|
72
|
+
}
|
|
73
|
+
export interface NewScheduleLocalDataFixedAssets extends NewScheduleLocalData {
|
|
74
|
+
assetId?: string;
|
|
75
|
+
selectedAccumulatedDepreciationCategory?: ID;
|
|
76
|
+
}
|
|
77
|
+
export interface SearchTransactionsState extends FetchStateAndError {
|
|
78
|
+
searchResults: JEScheduleTransactionKey[];
|
|
79
|
+
searchString?: string;
|
|
80
|
+
}
|
|
81
|
+
export declare const MIN_NEW_SCHEDULE_SEARCH_LENGTH = 2;
|
|
82
|
+
export interface NewJeScheduleState extends FetchStateAndError {
|
|
83
|
+
newScheduleState: {
|
|
84
|
+
fixed_assets: NewScheduleLocalDataFixedAssets;
|
|
85
|
+
prepaid_expenses: NewScheduleLocalData;
|
|
86
|
+
};
|
|
87
|
+
saveStatus: FetchStateAndError;
|
|
88
|
+
searchTransactions: SearchTransactionsState;
|
|
89
|
+
selectedDetailScheduleType?: ScheduleTypes;
|
|
90
|
+
}
|
|
44
91
|
export interface AccountSettingsLocalData {
|
|
45
92
|
previousAccruedExpensesAccount: AccountBase[];
|
|
46
93
|
previousFixedAssetsAccount: AccountBase[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MIN_NEW_SCHEDULE_SEARCH_LENGTH = exports.toJEPageTab = exports.toJEScheduleSortKey = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const JE_SCHEDULE_SORT_KEYS = [
|
|
6
6
|
'vendor',
|
|
@@ -20,10 +20,7 @@ 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
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
];
|
|
28
|
-
const toJEScheduleMainTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_MAIN_TABS);
|
|
29
|
-
exports.toJEScheduleMainTab = toJEScheduleMainTab;
|
|
23
|
+
const JE_PAGE_TABS = ['schedules', 'existing_schedules'];
|
|
24
|
+
const toJEPageTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_PAGE_TABS);
|
|
25
|
+
exports.toJEPageTab = toJEPageTab;
|
|
26
|
+
exports.MIN_NEW_SCHEDULE_SEARCH_LENGTH = 2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.73-betaRD2",
|
|
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",
|