@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
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
3
3
|
import { AccountMetadataPayload } from '../../../entity/account/accountPayload';
|
|
4
|
-
import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
|
-
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
4
|
+
import { JEAccruedScheduledTransactionPayload, JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
|
+
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
6
6
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
7
7
|
import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
|
|
8
|
-
import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
8
|
+
import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState, NewScheduleLocalData, NewScheduleLocalDataFixedAssets, SearchTransactionsState } from '../types/jeSchedulesViewState';
|
|
9
9
|
export declare const accountSettingsInitialState: AccountSettingsState;
|
|
10
|
+
export declare const getBaseNewScheduleLocalData: (scheduleType: ScheduleTypes) => NewScheduleLocalData;
|
|
11
|
+
export declare const newScheduleInitialState: JESchedulesViewState['newSchedule']['newScheduleState'];
|
|
12
|
+
export declare const searchTransactionsInitialState: SearchTransactionsState;
|
|
10
13
|
export declare const initialState: JESchedulesViewState;
|
|
11
|
-
export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
14
|
+
export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, clearSearchTransactionsForNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearSearchTransactionsForNewSchedule">, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
12
15
|
period: TimePeriod;
|
|
13
16
|
refreshViewInBackground: any;
|
|
14
17
|
}, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -18,6 +21,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
18
21
|
period: TimePeriod;
|
|
19
22
|
refreshViewInBackground: any;
|
|
20
23
|
}, "expenseAutomationJESchedulesView/fetchJeSchedulesPage", never, never>, fetchJeSchedulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
24
|
+
accruedJeSchedules: JEAccruedScheduledTransactionPayload[];
|
|
21
25
|
failedJeSchedules: JEScheduledTransactionPayload[];
|
|
22
26
|
jeSchedules: JEScheduledTransactionPayload[];
|
|
23
27
|
refreshViewInBackground: boolean;
|
|
@@ -32,7 +36,11 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
32
36
|
jeScheduleTransactionKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
33
37
|
}, "expenseAutomationJESchedulesView/ignoreRecommendedJeScheduleSuccess", never, never>, initializeAccountSettingsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/initializeAccountSettingsView">, initializeJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedules: JEScheduledTransactionPayload[]], {
|
|
34
38
|
jeScheduleTransactionKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[];
|
|
35
|
-
}, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>,
|
|
39
|
+
}, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>, initializeNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
40
|
+
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
41
|
+
}], {
|
|
42
|
+
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
43
|
+
}, "expenseAutomationJESchedulesView/initializeNewSchedule", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`, selectedPeriod: MonthYearPeriod], {
|
|
36
44
|
failedJeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
37
45
|
selectedPeriod: MonthYearPeriod;
|
|
38
46
|
}, "expenseAutomationJESchedulesView/removeFailedJeScheduleTransactionKey", never, never>, removeJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -40,7 +48,11 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
40
48
|
}, "expenseAutomationJESchedulesView/removeJeScheduleLocalDataById">, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`, selectedPeriod: MonthYearPeriod], {
|
|
41
49
|
jeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
42
50
|
selectedPeriod: MonthYearPeriod;
|
|
43
|
-
}, "expenseAutomationJESchedulesView/removeJeScheduleTransactionKey", never, never>,
|
|
51
|
+
}, "expenseAutomationJESchedulesView/removeJeScheduleTransactionKey", never, never>, resetNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
52
|
+
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
53
|
+
}], {
|
|
54
|
+
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
55
|
+
}, "expenseAutomationJESchedulesView/resetNewScheduleLocalData", never, never>, retryJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
44
56
|
jeScheduleTransactionKey: JEScheduleTransactionKey;
|
|
45
57
|
scheduledJournalEntryID: ID;
|
|
46
58
|
}, "expenseAutomationJESchedulesView/retryJeSchedule">, retryJeScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -52,17 +64,36 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
52
64
|
status: ZeniAPIStatus;
|
|
53
65
|
}, "expenseAutomationJESchedulesView/saveAccountSettingsFailure">, saveAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
54
66
|
data: Partial<AccountSettingsLocalData>;
|
|
55
|
-
}, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">,
|
|
67
|
+
}, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">, saveNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
68
|
+
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
69
|
+
}], {
|
|
70
|
+
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
71
|
+
}, "expenseAutomationJESchedulesView/saveNewSchedule", never, never>, saveNewScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
72
|
+
status: ZeniAPIStatus;
|
|
73
|
+
}, "expenseAutomationJESchedulesView/saveNewScheduleFailure">, saveNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveNewScheduleSuccess">, searchTransactionsForNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
74
|
+
query: string;
|
|
75
|
+
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
76
|
+
}], {
|
|
77
|
+
query: string;
|
|
78
|
+
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
79
|
+
}, "expenseAutomationJESchedulesView/searchTransactionsForNewSchedule", never, never>, searchTransactionsForNewScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
80
|
+
status: ZeniAPIStatus;
|
|
81
|
+
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleFailure">, searchTransactionsForNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
82
|
+
searchResults: JEScheduleTransactionKey[];
|
|
83
|
+
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
84
|
accountPayload: AccountMetadataPayload[];
|
|
57
85
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
86
|
status: ZeniAPIStatus;
|
|
59
|
-
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
87
|
+
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJEScheduleTypeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<"prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue" | null, "expenseAutomationJESchedulesView/updateJEScheduleTypeFilter">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
60
88
|
localData: Partial<JEScheduleLocalData>;
|
|
61
89
|
scheduledJournalEntryID: ID;
|
|
62
90
|
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod], {
|
|
63
91
|
jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[];
|
|
64
92
|
selectedPeriod: MonthYearPeriod;
|
|
65
|
-
}, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>,
|
|
93
|
+
}, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
|
+
localData: Partial<NewScheduleLocalDataFixedAssets>;
|
|
95
|
+
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
96
|
+
}, "expenseAutomationJESchedulesView/updateNewScheduleLocalData">, updateRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountTypeRecommendationPayload, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettings">, updateRecommendationForAccountSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
66
97
|
status: ZeniAPIStatus;
|
|
67
98
|
}, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettingsFailure">;
|
|
68
99
|
declare const _default: import("redux").Reducer<JESchedulesViewState>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
|
|
4
|
+
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
7
7
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
8
8
|
const accountPayload_1 = require("../../../entity/account/accountPayload");
|
|
9
9
|
const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
|
|
10
10
|
const accountTypeRecommendationPayload_1 = require("../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload");
|
|
11
|
+
const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
|
|
11
12
|
exports.accountSettingsInitialState = {
|
|
12
13
|
localData: {
|
|
13
14
|
selectedPrepaidExpensesAccountIds: [],
|
|
@@ -39,16 +40,34 @@ exports.accountSettingsInitialState = {
|
|
|
39
40
|
accruedExpensesNestedAccountListHierarchy: [],
|
|
40
41
|
accruedExpensesRecommendations: [],
|
|
41
42
|
};
|
|
43
|
+
const getBaseNewScheduleLocalData = (scheduleType) => ({
|
|
44
|
+
scheduleType,
|
|
45
|
+
jeScheduleDetails: [],
|
|
46
|
+
});
|
|
47
|
+
exports.getBaseNewScheduleLocalData = getBaseNewScheduleLocalData;
|
|
48
|
+
exports.newScheduleInitialState = {
|
|
49
|
+
fixed_assets: (0, exports.getBaseNewScheduleLocalData)('fixed_assets'),
|
|
50
|
+
prepaid_expenses: (0, exports.getBaseNewScheduleLocalData)('prepaid_expenses'),
|
|
51
|
+
};
|
|
52
|
+
exports.searchTransactionsInitialState = {
|
|
53
|
+
searchResults: [],
|
|
54
|
+
fetchState: 'Not-Started',
|
|
55
|
+
error: undefined,
|
|
56
|
+
};
|
|
42
57
|
exports.initialState = {
|
|
43
58
|
jeScheduleTransactionKeysByPeriod: {},
|
|
59
|
+
jeScheduleAccruedKeysByPeriod: {},
|
|
44
60
|
failedJeScheduleTransactionKeysByPeriod: {},
|
|
45
61
|
postStatusById: {},
|
|
46
62
|
ignoreStatusById: {},
|
|
47
63
|
jeScheduleLocalDataById: {},
|
|
48
64
|
uiState: {
|
|
49
|
-
|
|
65
|
+
createdGroupCollapsed: false,
|
|
66
|
+
pendingGroupCollapsed: false,
|
|
50
67
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
51
|
-
|
|
68
|
+
searchString: '',
|
|
69
|
+
selectedJETypeFilter: null,
|
|
70
|
+
selectedPageTab: 'schedules',
|
|
52
71
|
sortKey: 'transactionDate',
|
|
53
72
|
sortOrder: 'descending',
|
|
54
73
|
totalCount: 0,
|
|
@@ -59,6 +78,13 @@ exports.initialState = {
|
|
|
59
78
|
error: undefined,
|
|
60
79
|
},
|
|
61
80
|
accountSettings: exports.accountSettingsInitialState,
|
|
81
|
+
newSchedule: {
|
|
82
|
+
newScheduleState: exports.newScheduleInitialState,
|
|
83
|
+
saveStatus: { fetchState: 'Not-Started', error: undefined },
|
|
84
|
+
searchTransactions: exports.searchTransactionsInitialState,
|
|
85
|
+
fetchState: 'Not-Started',
|
|
86
|
+
error: undefined,
|
|
87
|
+
},
|
|
62
88
|
fetchState: 'Not-Started',
|
|
63
89
|
error: undefined,
|
|
64
90
|
hasValidState() {
|
|
@@ -103,9 +129,10 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
103
129
|
},
|
|
104
130
|
},
|
|
105
131
|
fetchJeSchedulesSuccess(draft, action) {
|
|
106
|
-
const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
|
|
132
|
+
const { jeSchedules, selectedPeriod, failedJeSchedules, accruedJeSchedules, refreshViewInBackground, } = action.payload;
|
|
107
133
|
const jeScheduleTransactionKeys = jeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
|
|
108
134
|
const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
|
|
135
|
+
const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleKey)(schedule));
|
|
109
136
|
if (refreshViewInBackground === true &&
|
|
110
137
|
draft.refreshStatus.fetchState === 'In-Progress') {
|
|
111
138
|
draft.refreshStatus = { fetchState: 'Completed', error: undefined };
|
|
@@ -115,6 +142,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
115
142
|
draft.error = undefined;
|
|
116
143
|
}
|
|
117
144
|
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleTransactionKeys;
|
|
145
|
+
draft.jeScheduleAccruedKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] =
|
|
146
|
+
jeScheduleAccruedKeys;
|
|
118
147
|
draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = failedJeScheduleTransactionKeys;
|
|
119
148
|
},
|
|
120
149
|
fetchJeSchedulesFailure(draft, action) {
|
|
@@ -125,8 +154,9 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
125
154
|
else {
|
|
126
155
|
draft.fetchState = 'Error';
|
|
127
156
|
draft.error = status;
|
|
157
|
+
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
158
|
+
draft.jeScheduleAccruedKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
128
159
|
}
|
|
129
|
-
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
130
160
|
},
|
|
131
161
|
retryJeSchedule(draft, action) {
|
|
132
162
|
const { scheduledJournalEntryID } = action.payload;
|
|
@@ -372,6 +402,91 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
372
402
|
clearJeAccountSettingsLocalData(draft) {
|
|
373
403
|
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
374
404
|
},
|
|
405
|
+
initializeNewSchedule: {
|
|
406
|
+
prepare({ scheduleType, }) {
|
|
407
|
+
return { payload: { scheduleType } };
|
|
408
|
+
},
|
|
409
|
+
reducer() {
|
|
410
|
+
// Purely an epic-trigger action — the epic fans out the account/class
|
|
411
|
+
// list fetches plus resetNewScheduleLocalData.
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
resetNewScheduleLocalData: {
|
|
415
|
+
prepare({ scheduleType, }) {
|
|
416
|
+
return { payload: { scheduleType } };
|
|
417
|
+
},
|
|
418
|
+
reducer(draft, action) {
|
|
419
|
+
const { scheduleType } = action.payload;
|
|
420
|
+
draft.newSchedule.newScheduleState[scheduleType] =
|
|
421
|
+
(0, exports.getBaseNewScheduleLocalData)(scheduleType);
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
updateNewScheduleLocalData(draft, action) {
|
|
425
|
+
const { scheduleType, localData } = action.payload;
|
|
426
|
+
draft.newSchedule.newScheduleState[scheduleType] = {
|
|
427
|
+
...draft.newSchedule.newScheduleState[scheduleType],
|
|
428
|
+
...localData,
|
|
429
|
+
};
|
|
430
|
+
},
|
|
431
|
+
searchTransactionsForNewSchedule: {
|
|
432
|
+
prepare({ query, scheduleType, }) {
|
|
433
|
+
return { payload: { query, scheduleType } };
|
|
434
|
+
},
|
|
435
|
+
reducer(draft, action) {
|
|
436
|
+
const trimmed = action.payload.query.trim();
|
|
437
|
+
// Cleared or too-short query: no API (see epic) — reset immediately.
|
|
438
|
+
if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
|
|
439
|
+
draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
draft.newSchedule.searchTransactions = {
|
|
443
|
+
...draft.newSchedule.searchTransactions,
|
|
444
|
+
searchString: action.payload.query,
|
|
445
|
+
fetchState: 'In-Progress',
|
|
446
|
+
};
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
searchTransactionsForNewScheduleSuccess(draft, action) {
|
|
450
|
+
draft.newSchedule.searchTransactions = {
|
|
451
|
+
...draft.newSchedule.searchTransactions,
|
|
452
|
+
searchResults: action.payload.searchResults,
|
|
453
|
+
fetchState: 'Completed',
|
|
454
|
+
error: undefined,
|
|
455
|
+
};
|
|
456
|
+
},
|
|
457
|
+
searchTransactionsForNewScheduleFailure(draft, action) {
|
|
458
|
+
draft.newSchedule.searchTransactions = {
|
|
459
|
+
...draft.newSchedule.searchTransactions,
|
|
460
|
+
fetchState: 'Error',
|
|
461
|
+
error: action.payload.status,
|
|
462
|
+
};
|
|
463
|
+
},
|
|
464
|
+
clearSearchTransactionsForNewSchedule(draft) {
|
|
465
|
+
draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
|
|
466
|
+
},
|
|
467
|
+
saveNewSchedule: {
|
|
468
|
+
prepare({ scheduleType, }) {
|
|
469
|
+
return { payload: { scheduleType } };
|
|
470
|
+
},
|
|
471
|
+
reducer(draft) {
|
|
472
|
+
draft.newSchedule.saveStatus = {
|
|
473
|
+
fetchState: 'In-Progress',
|
|
474
|
+
error: undefined,
|
|
475
|
+
};
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
saveNewScheduleSuccess(draft) {
|
|
479
|
+
draft.newSchedule.saveStatus = {
|
|
480
|
+
fetchState: 'Completed',
|
|
481
|
+
error: undefined,
|
|
482
|
+
};
|
|
483
|
+
},
|
|
484
|
+
saveNewScheduleFailure(draft, action) {
|
|
485
|
+
draft.newSchedule.saveStatus = {
|
|
486
|
+
fetchState: 'Error',
|
|
487
|
+
error: action.payload.status,
|
|
488
|
+
};
|
|
489
|
+
},
|
|
375
490
|
updateJESchedulesUIState(draft, action) {
|
|
376
491
|
if (action.payload.sortKey != null) {
|
|
377
492
|
draft.uiState.sortKey = action.payload.sortKey;
|
|
@@ -385,16 +500,27 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
385
500
|
if (action.payload.scrollPosition != null) {
|
|
386
501
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
387
502
|
}
|
|
388
|
-
if (action.payload.
|
|
389
|
-
draft.uiState.
|
|
503
|
+
if (action.payload.selectedPageTab != null) {
|
|
504
|
+
draft.uiState.selectedPageTab = action.payload.selectedPageTab;
|
|
390
505
|
}
|
|
391
506
|
},
|
|
507
|
+
updateJEScheduleTypeFilter(draft, action) {
|
|
508
|
+
draft.uiState.selectedJETypeFilter = action.payload;
|
|
509
|
+
},
|
|
510
|
+
toggleJEPendingGroupCollapsed(draft) {
|
|
511
|
+
draft.uiState.pendingGroupCollapsed =
|
|
512
|
+
!draft.uiState.pendingGroupCollapsed;
|
|
513
|
+
},
|
|
514
|
+
toggleJECreatedGroupCollapsed(draft) {
|
|
515
|
+
draft.uiState.createdGroupCollapsed =
|
|
516
|
+
!draft.uiState.createdGroupCollapsed;
|
|
517
|
+
},
|
|
392
518
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
393
519
|
Object.assign(draft, exports.initialState);
|
|
394
520
|
},
|
|
395
521
|
},
|
|
396
522
|
});
|
|
397
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
523
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
398
524
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
399
525
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
400
526
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
|
+
import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
+
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
4
|
+
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
+
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
|
+
import { ClassBase } from '../../../entity/class/classState';
|
|
7
|
+
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
|
+
import { ScheduleTransaction } from '../../../entity/transaction/stateTypes/scheduleTransaction';
|
|
9
|
+
import { NewScheduleLocalData, NewScheduleLocalDataFixedAssets } from '../types/jeSchedulesViewState';
|
|
10
|
+
export interface NewScheduleSearchTransactionsView {
|
|
11
|
+
searchTransactionsFetchState: FetchStateAndError;
|
|
12
|
+
searchTransactionsResults: ScheduleTransaction[];
|
|
13
|
+
searchTransactionsString?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface NewScheduleView extends SelectorView, NewScheduleSearchTransactionsView {
|
|
16
|
+
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
17
|
+
allAccountList: AccountBase[];
|
|
18
|
+
allClassList: ClassBase[];
|
|
19
|
+
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
20
|
+
newScheduleLocalData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets;
|
|
21
|
+
saveStatus: FetchStateAndError;
|
|
22
|
+
scheduleType: ScheduleTypes;
|
|
23
|
+
allDepreciationAccountList?: AccountBase[];
|
|
24
|
+
allDepreciationAccountListNestedAccountHierarchy?: NestedAccountHierarchyForReport[];
|
|
25
|
+
}
|
|
@@ -4,12 +4,30 @@ import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonSta
|
|
|
4
4
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
7
|
-
import {
|
|
8
|
-
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
7
|
+
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
8
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
10
9
|
import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
11
|
-
import {
|
|
10
|
+
import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
11
|
+
import { JEScheduleRow, JEScheduledTransactionWithFailedEntries } from '../selectors/jeSchedulesViewSelector';
|
|
12
12
|
import { JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
13
|
+
export interface JEKpiSummary {
|
|
14
|
+
aiAccountant: {
|
|
15
|
+
amount: number;
|
|
16
|
+
count: number;
|
|
17
|
+
};
|
|
18
|
+
manual: {
|
|
19
|
+
amount: number;
|
|
20
|
+
count: number;
|
|
21
|
+
};
|
|
22
|
+
needsReview: {
|
|
23
|
+
amount: number;
|
|
24
|
+
count: number;
|
|
25
|
+
};
|
|
26
|
+
total: {
|
|
27
|
+
amount: number;
|
|
28
|
+
count: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
13
31
|
export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
14
32
|
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
15
33
|
accountSettingsView: JEAccountSettingsView;
|
|
@@ -18,13 +36,19 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
18
36
|
allDepreciationAccountList: AccountBase[];
|
|
19
37
|
allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
20
38
|
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
21
|
-
completedSchedules: JEScheduledTransaction[];
|
|
22
39
|
completionStatus: CompletionStatusType;
|
|
23
|
-
|
|
40
|
+
createdSchedules: JEScheduleRow[];
|
|
41
|
+
createdTotal: number;
|
|
24
42
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
25
43
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
jeScheduleTypeCounts: {
|
|
45
|
+
active: Record<ScheduleTypes, number>;
|
|
46
|
+
ongoing: Record<ScheduleTypes, number>;
|
|
47
|
+
};
|
|
48
|
+
kpiSummary: JEKpiSummary;
|
|
49
|
+
newScheduleView: NewScheduleView | undefined;
|
|
50
|
+
pendingReviewSchedules: JEScheduleRow[];
|
|
51
|
+
pendingReviewTotal: number;
|
|
28
52
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
29
53
|
refreshStatus: FetchStateAndError;
|
|
30
54
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RootState } from '../../../reducer';
|
|
2
|
+
import { NewScheduleSearchTransactionsView, NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
3
|
+
/**
|
|
4
|
+
* The Base Transaction search is shared across schedule types (one search
|
|
5
|
+
* box, not one per prepaid_expenses/fixed_assets) — split out from
|
|
6
|
+
* getNewScheduleView so a consumer can read it without supplying an
|
|
7
|
+
* otherwise-irrelevant scheduleType.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getNewScheduleSearchTransactionsView: (state: RootState) => NewScheduleSearchTransactionsView;
|
|
10
|
+
export declare const getNewScheduleView: (state: RootState, scheduleType: "fixed_assets" | "prepaid_expenses") => NewScheduleView;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNewScheduleView = exports.getNewScheduleSearchTransactionsView = void 0;
|
|
4
|
+
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
5
|
+
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
6
|
+
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
7
|
+
const classListSelector_1 = require("../../classList/classListSelector");
|
|
8
|
+
const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper");
|
|
9
|
+
const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailSelector");
|
|
10
|
+
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
11
|
+
/**
|
|
12
|
+
* The Base Transaction search is shared across schedule types (one search
|
|
13
|
+
* box, not one per prepaid_expenses/fixed_assets) — split out from
|
|
14
|
+
* getNewScheduleView so a consumer can read it without supplying an
|
|
15
|
+
* otherwise-irrelevant scheduleType.
|
|
16
|
+
*/
|
|
17
|
+
const getNewScheduleSearchTransactionsView = (state) => {
|
|
18
|
+
const { searchTransactions } = state.expenseAutomationJESchedulesViewState.newSchedule;
|
|
19
|
+
const searchTransactionsResults = searchTransactions.searchResults
|
|
20
|
+
.map((key) => (0, transactionSelector_1.getScheduleTransactionById)(state.transactionState, key))
|
|
21
|
+
.filter((transaction) => transaction != null);
|
|
22
|
+
return {
|
|
23
|
+
searchTransactionsResults,
|
|
24
|
+
searchTransactionsFetchState: {
|
|
25
|
+
fetchState: searchTransactions.fetchState,
|
|
26
|
+
error: searchTransactions.error,
|
|
27
|
+
},
|
|
28
|
+
searchTransactionsString: searchTransactions.searchString,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.getNewScheduleSearchTransactionsView = getNewScheduleSearchTransactionsView;
|
|
32
|
+
const getNewScheduleView = (state, scheduleType) => {
|
|
33
|
+
const { accountState, accountListState, classState, classListState } = state;
|
|
34
|
+
const { newSchedule } = state.expenseAutomationJESchedulesViewState;
|
|
35
|
+
const searchTransactionsView = (0, exports.getNewScheduleSearchTransactionsView)(state);
|
|
36
|
+
const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
|
|
37
|
+
const newScheduleAccountTypes = (0, scheduleDetailLocalDataHelper_1.getAccountsTypesForScheduleDetails)(scheduleType);
|
|
38
|
+
const newScheduleAccountIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, newScheduleAccountTypes);
|
|
39
|
+
const allAccountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, accountType.accountListKey);
|
|
40
|
+
const filteredAccounts = allAccountList.accounts.filter((account) => newScheduleAccountIds.includes(account.accountId));
|
|
41
|
+
const accountListNestedAccountHierarchy = (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)((0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey), filteredAccounts.map((account) => account.accountId));
|
|
42
|
+
const allClassList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
43
|
+
const classListNestedAccountHierarchy = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
44
|
+
let allDepreciationAccountList;
|
|
45
|
+
let allDepreciationAccountListNestedAccountHierarchy;
|
|
46
|
+
if (scheduleType === 'fixed_assets') {
|
|
47
|
+
const depreciationCategoryIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, [
|
|
48
|
+
'fixed_assets',
|
|
49
|
+
'other_assets',
|
|
50
|
+
]);
|
|
51
|
+
const accountLabel = (0, scheduleListHelper_1.getAccountLabelForScheduleType)('fixed_assets');
|
|
52
|
+
const fixedAssetLabelAccountIds = accountLabel != null
|
|
53
|
+
? (0, accountListSelector_1.getAccountIdsForLabel)(accountListState, accountType.accountListKey, accountLabel)
|
|
54
|
+
: [];
|
|
55
|
+
allDepreciationAccountList = allAccountList.accounts.filter((account) => depreciationCategoryIds.includes(account.accountId) &&
|
|
56
|
+
!fixedAssetLabelAccountIds.includes(account.accountId));
|
|
57
|
+
allDepreciationAccountListNestedAccountHierarchy =
|
|
58
|
+
(0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)((0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey), allDepreciationAccountList.map((account) => account.accountId));
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
scheduleType,
|
|
62
|
+
accountListNestedAccountHierarchy,
|
|
63
|
+
allAccountList: filteredAccounts,
|
|
64
|
+
allClassList: allClassList.classes,
|
|
65
|
+
allDepreciationAccountList,
|
|
66
|
+
allDepreciationAccountListNestedAccountHierarchy,
|
|
67
|
+
classListNestedAccountHierarchy,
|
|
68
|
+
newScheduleLocalData: newSchedule.newScheduleState[scheduleType],
|
|
69
|
+
saveStatus: newSchedule.saveStatus,
|
|
70
|
+
...searchTransactionsView,
|
|
71
|
+
fetchState: newSchedule.fetchState,
|
|
72
|
+
error: newSchedule.error,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
exports.getNewScheduleView = getNewScheduleView;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { JEScheduledTransaction, ScheduledJournalEntry } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
1
|
+
import { JEAccruedSchedule, JEScheduledTransaction, ScheduledJournalEntry } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
2
2
|
import { RootState } from '../../../reducer';
|
|
3
3
|
import { ExpenseAutomationJESchedulesViewSelector } from '../selectorTypes/jeSchedulesSelectorTypes';
|
|
4
|
+
export declare const isAiAccountantSchedule: (schedule: JEScheduleRow) => boolean;
|
|
5
|
+
export declare function isAccruedScheduleRow(schedule: JEScheduleRow): schedule is JEAccruedSchedule;
|
|
4
6
|
export declare function getExpenseAutomationJESchedulesView(state: RootState): ExpenseAutomationJESchedulesViewSelector;
|
|
5
7
|
export interface JEScheduledTransactionWithFailedEntries extends Omit<JEScheduledTransaction, 'scheduledJournalEntry'> {
|
|
6
8
|
scheduledJournalEntry: ScheduledJournalEntry;
|
|
7
9
|
}
|
|
10
|
+
export type JEScheduleRow = JEAccruedSchedule | JEScheduledTransaction | JEScheduledTransactionWithFailedEntries;
|