@zeniai/client-epic-state 5.2.22-betaAM1 → 5.2.22-betaRD0
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 +0 -24
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -40
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -26
- package/lib/epic.d.ts +2 -6
- package/lib/epic.js +2 -10
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -40
- package/lib/esm/epic.js +2 -10
- package/lib/esm/index.js +4 -8
- package/lib/esm/reducer.js +0 -3
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +11 -28
- package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +45 -7
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +13 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +35 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -5
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +7 -22
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -1
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +31 -7
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -3
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -5
- package/lib/index.d.ts +6 -11
- package/lib/index.js +49 -73
- package/lib/reducer.d.ts +0 -1
- package/lib/reducer.js +0 -3
- package/lib/rootStateTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +11 -28
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +45 -7
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +12 -5
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +12 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +39 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -5
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +7 -22
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +54 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +3 -3
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +13 -8
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +33 -9
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +3 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -5
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +0 -46
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +0 -7
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +0 -50
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +0 -60
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +0 -260
- package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +0 -1
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -200
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -22
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +0 -50
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +0 -5
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +0 -11
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +0 -54
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +0 -48
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +0 -48
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +0 -72
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +0 -65
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +0 -53
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +0 -264
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +0 -59
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +0 -2
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +0 -11
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -212
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +0 -81
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +0 -27
|
@@ -2,8 +2,8 @@ import { ID } from '../../../commonStateTypes/common';
|
|
|
2
2
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
3
3
|
import { AccountMetadataPayload } from '../../../entity/account/accountPayload';
|
|
4
4
|
import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
|
-
import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
6
5
|
import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
|
|
6
|
+
import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
7
7
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
8
8
|
import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
|
|
9
9
|
import { AccountSettingsLocalData, AccountSettingsState, JEPageTab, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState, NewOneTimeAccrualLocalData, NewScheduleLocalData, NewScheduleLocalDataFixedAssets, SearchTransactionsState } from '../types/jeSchedulesViewState';
|
|
@@ -25,10 +25,9 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
25
25
|
status: ZeniAPIStatus;
|
|
26
26
|
}, "expenseAutomationJESchedulesView/oneTimeAccrualActionFailure">, oneTimeAccrualActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
27
27
|
accrualId: ID;
|
|
28
|
-
}, "expenseAutomationJESchedulesView/oneTimeAccrualActionSuccess">, promoteOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, amount: number
|
|
28
|
+
}, "expenseAutomationJESchedulesView/oneTimeAccrualActionSuccess">, promoteOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, amount: number], {
|
|
29
29
|
accrualId: string;
|
|
30
30
|
amount: number;
|
|
31
|
-
edits: OneTimeAccrualEdits | undefined;
|
|
32
31
|
}, "expenseAutomationJESchedulesView/promoteOneTimeAccrual", never, never>, revertJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleId: string, jeScheduleTransactionKey: `${string}_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", reason: "duplicate" | "amount_off" | "wrong_period" | "created_by_mistake" | "other_revert", note?: string | undefined], {
|
|
33
32
|
jeScheduleId: string;
|
|
34
33
|
jeScheduleTransactionKey: `${string}_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`;
|
|
@@ -44,9 +43,10 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
44
43
|
accrualId: string;
|
|
45
44
|
reason: "duplicate" | "amount_off" | "wrong_period" | "other_revert" | "not_accrual";
|
|
46
45
|
note: string | undefined;
|
|
47
|
-
}, "expenseAutomationJESchedulesView/revertOneTimeAccrual", never, never>, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
46
|
+
}, "expenseAutomationJESchedulesView/revertOneTimeAccrual", never, never>, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any, selectedPageTab?: "schedules" | "existing_schedules" | undefined], {
|
|
48
47
|
period: TimePeriod;
|
|
49
48
|
refreshViewInBackground: any;
|
|
49
|
+
selectedPageTab: "schedules" | "existing_schedules" | undefined;
|
|
50
50
|
}, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
51
51
|
selectedPageTab: JEPageTab;
|
|
52
52
|
selectedPeriod: MonthYearPeriod;
|
|
@@ -90,7 +90,9 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
90
90
|
}, "expenseAutomationJESchedulesView/initializeNewSchedule", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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], {
|
|
91
91
|
failedJeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`;
|
|
92
92
|
selectedPeriod: MonthYearPeriod;
|
|
93
|
-
}, "expenseAutomationJESchedulesView/removeFailedJeScheduleTransactionKey", never, never>,
|
|
93
|
+
}, "expenseAutomationJESchedulesView/removeFailedJeScheduleTransactionKey", never, never>, removeJeOneTimeAccrualLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
|
+
accrualId: ID;
|
|
95
|
+
}, "expenseAutomationJESchedulesView/removeJeOneTimeAccrualLocalData">, removeJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
96
|
scheduledJournalEntryID: ID;
|
|
95
97
|
}, "expenseAutomationJESchedulesView/removeJeScheduleLocalDataById">, removeJeAccruedScheduleKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeAccruedScheduleKey: `${string}_${string}`], {
|
|
96
98
|
jeAccruedScheduleKey: `${string}_${string}`;
|
|
@@ -133,13 +135,16 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
133
135
|
accountPayload: AccountMetadataPayload[];
|
|
134
136
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
135
137
|
status: ZeniAPIStatus;
|
|
136
|
-
}, "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">,
|
|
138
|
+
}, "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">, updateJeOneTimeAccrualLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
139
|
+
accrualId: ID;
|
|
140
|
+
localData: OneTimeAccrualEdits;
|
|
141
|
+
}, "expenseAutomationJESchedulesView/updateJeOneTimeAccrualLocalData">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
137
142
|
localData: Partial<JEScheduleLocalData>;
|
|
138
143
|
scheduledJournalEntryID: ID;
|
|
139
|
-
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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, selectedPageTab: "schedules" | "
|
|
144
|
+
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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, selectedPageTab: "schedules" | "existing_schedules"], {
|
|
140
145
|
jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`)[];
|
|
141
146
|
selectedPeriod: MonthYearPeriod;
|
|
142
|
-
selectedPageTab: "schedules" | "
|
|
147
|
+
selectedPageTab: "schedules" | "existing_schedules";
|
|
143
148
|
}, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
144
149
|
localData: Partial<NewScheduleLocalDataFixedAssets>;
|
|
145
150
|
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
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 = void 0;
|
|
4
|
+
exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeJeOneTimeAccrualLocalData = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
|
|
5
|
+
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = void 0;
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
8
8
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
@@ -72,6 +72,7 @@ exports.initialState = {
|
|
|
72
72
|
ignoreStatusById: {},
|
|
73
73
|
revertStatusById: {},
|
|
74
74
|
jeScheduleLocalDataById: {},
|
|
75
|
+
oneTimeAccrualLocalDataById: {},
|
|
75
76
|
oneTimeAccrualActionStatusById: {},
|
|
76
77
|
oneTimeAccrualFetchStatusById: {},
|
|
77
78
|
uiState: {
|
|
@@ -133,11 +134,15 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
133
134
|
draft.error = undefined;
|
|
134
135
|
}
|
|
135
136
|
},
|
|
136
|
-
|
|
137
|
+
// `selectedPageTab` is for the prefetch, which fetches the tab the user is NOT on. Everyone
|
|
138
|
+
// else omits it and the epic uses the selected tab -- passing the visible tab explicitly
|
|
139
|
+
// would be the same thing.
|
|
140
|
+
prepare(period, refreshViewInBackground = false, selectedPageTab) {
|
|
137
141
|
return {
|
|
138
142
|
payload: {
|
|
139
143
|
period,
|
|
140
144
|
refreshViewInBackground,
|
|
145
|
+
selectedPageTab,
|
|
141
146
|
},
|
|
142
147
|
};
|
|
143
148
|
},
|
|
@@ -405,6 +410,24 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
405
410
|
const { scheduledJournalEntryID } = action.payload;
|
|
406
411
|
delete draft.jeScheduleLocalDataById[scheduledJournalEntryID];
|
|
407
412
|
},
|
|
413
|
+
/**
|
|
414
|
+
* Merge, not replace: the detail form reports one field at a time, so a full overwrite would
|
|
415
|
+
* drop every other edit on each keystroke.
|
|
416
|
+
*/
|
|
417
|
+
updateJeOneTimeAccrualLocalData(draft, action) {
|
|
418
|
+
const { accrualId, localData } = action.payload;
|
|
419
|
+
draft.oneTimeAccrualLocalDataById = {
|
|
420
|
+
...draft.oneTimeAccrualLocalDataById,
|
|
421
|
+
[accrualId]: {
|
|
422
|
+
...draft.oneTimeAccrualLocalDataById[accrualId],
|
|
423
|
+
...localData,
|
|
424
|
+
},
|
|
425
|
+
};
|
|
426
|
+
},
|
|
427
|
+
/** Called when the detail page unmounts and after a successful promote. */
|
|
428
|
+
removeJeOneTimeAccrualLocalData(draft, action) {
|
|
429
|
+
delete draft.oneTimeAccrualLocalDataById[action.payload.accrualId];
|
|
430
|
+
},
|
|
408
431
|
initializeAccountSettingsView(draft) {
|
|
409
432
|
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
410
433
|
},
|
|
@@ -581,13 +604,14 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
581
604
|
};
|
|
582
605
|
},
|
|
583
606
|
/**
|
|
584
|
-
* Promote applies the body and posts in one step
|
|
585
|
-
*
|
|
586
|
-
*
|
|
607
|
+
* Promote applies the body and posts in one step. The edits it applies come from
|
|
608
|
+
* `oneTimeAccrualLocalDataById`, not from this action -- the list's inline Post has no form, so
|
|
609
|
+
* it writes no local data and the epic falls back to the stored accrual. `amount` stays on the
|
|
610
|
+
* action because both callers already have it and `OneTimeAccrualEdits` has no slot for it.
|
|
587
611
|
*/
|
|
588
612
|
promoteOneTimeAccrual: {
|
|
589
|
-
prepare(accrualId, amount
|
|
590
|
-
return { payload: { accrualId, amount
|
|
613
|
+
prepare(accrualId, amount) {
|
|
614
|
+
return { payload: { accrualId, amount } };
|
|
591
615
|
},
|
|
592
616
|
reducer(draft, action) {
|
|
593
617
|
draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
|
|
@@ -691,7 +715,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
691
715
|
});
|
|
692
716
|
},
|
|
693
717
|
});
|
|
694
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, 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.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, 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;
|
|
718
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, 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.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, 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.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
695
719
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
696
720
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
697
721
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { MonthEndCloseChecksView } from '../../../view/monthEndCloseChecksView/m
|
|
|
6
6
|
import { CompanyMonthEndReportSelectorView } from '../../companyMonthEndReportView/companyMonthEndReportViewSelector';
|
|
7
7
|
import { ExpenseAutomationViewType } from '../expenseAutomationViewState';
|
|
8
8
|
import { TransactionsTab } from '../types/transactionsViewState';
|
|
9
|
-
import { ExpenseAutomationActualMatchingViewSelector } from './actualMatchingViewSelectorTypes';
|
|
10
9
|
import { ExpenseAutomationFluxAnalysisViewSelector } from './fluxAnalysisViewSelectorTypes';
|
|
11
10
|
import { ExpenseAutomationJESchedulesViewSelector } from './jeSchedulesSelectorTypes';
|
|
12
11
|
import { ExpenseAutomationMissingReceiptsViewSelector } from './missingReceiptsSelectorTypes';
|
|
@@ -22,7 +21,6 @@ export interface ExpenseAutomationStepDetails {
|
|
|
22
21
|
title: string;
|
|
23
22
|
}
|
|
24
23
|
export interface ExpenseAutomationViewSelector extends SelectorView {
|
|
25
|
-
actualMatching: ExpenseAutomationActualMatchingViewSelector;
|
|
26
24
|
allSteps: ExpenseAutomationStepDetails[];
|
|
27
25
|
completionStatus: CompletionStatusType;
|
|
28
26
|
currentSelectedView: ExpenseAutomationViewType;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { JEAccruedSchedule, JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
3
|
+
import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
|
|
3
4
|
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
4
5
|
import { RootState } from '../../../rootStateTypes';
|
|
5
6
|
import { ExpenseAutomationJESchedulesViewSelector, JEScheduleRow } from '../selectorTypes/jeSchedulesSelectorTypes';
|
|
@@ -22,6 +23,7 @@ export interface ExpenseAutomationJEOneTimeAccrualDetailView {
|
|
|
22
23
|
actionFetchState: FetchStateAndError;
|
|
23
24
|
detailFetchState: FetchStateAndError;
|
|
24
25
|
accrual?: JEOneTimeAccrual;
|
|
26
|
+
localData?: OneTimeAccrualEdits;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* One accrual plus the status of its promote / ignore request, for the detail screen.
|
|
@@ -382,9 +382,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
382
382
|
// reports undefined rather than 0, so the UI can hide the badge instead of asserting "none".
|
|
383
383
|
const scheduleCountsByTab = {};
|
|
384
384
|
jeSchedulesViewState_1.ALL_JE_PAGE_TABS.forEach((pageTab) => {
|
|
385
|
-
if (pageTab === 'actual_matching') {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
385
|
const periodTabKey = monthYearPeriodId != null
|
|
389
386
|
? (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(pageTab, monthYearPeriodId)
|
|
390
387
|
: null;
|
|
@@ -492,5 +489,6 @@ function getExpenseAutomationJEOneTimeAccrualDetailView(state, accrualId) {
|
|
|
492
489
|
fetchState: 'Not-Started',
|
|
493
490
|
error: undefined,
|
|
494
491
|
},
|
|
492
|
+
localData: state.expenseAutomationJESchedulesViewState.oneTimeAccrualLocalDataById[accrualId],
|
|
495
493
|
};
|
|
496
494
|
}
|
|
@@ -5,13 +5,14 @@ import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
|
5
5
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
6
6
|
import { MonthYearPeriodId, ScheduleDaysOfMonth } from '../../../commonStateTypes/timePeriod';
|
|
7
7
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
8
|
+
import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
|
|
8
9
|
import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, ScheduleJournalEntryStatusCodeType, ScheduleTransactionID, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
10
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
10
11
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
11
12
|
import { JETransactionLink } from '../../scheduleView/scheduleDetailView/scheduleDetailState';
|
|
12
13
|
export declare const toJEScheduleSortKey: (v: string) => "type" | "vendor" | "category" | "class" | "memo" | "jePostingDate" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "remainingMonths" | "totalAmount" | "transactionDate";
|
|
13
14
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
14
|
-
export declare const toJEPageTab: (v: string) => "schedules" | "
|
|
15
|
+
export declare const toJEPageTab: (v: string) => "schedules" | "existing_schedules";
|
|
15
16
|
export type JEPageTab = ReturnType<typeof toJEPageTab>;
|
|
16
17
|
export declare const ALL_JE_PAGE_TABS: readonly JEPageTab[];
|
|
17
18
|
export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
|
|
@@ -51,6 +52,7 @@ export interface JESchedulesViewState extends FetchedState {
|
|
|
51
52
|
newSchedule: NewJeScheduleState;
|
|
52
53
|
oneTimeAccrualActionStatusById: Record<ID, FetchStateAndError>;
|
|
53
54
|
oneTimeAccrualFetchStatusById: Record<ID, FetchStateAndError>;
|
|
55
|
+
oneTimeAccrualLocalDataById: Record<ID, OneTimeAccrualEdits>;
|
|
54
56
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
55
57
|
refreshStatus: FetchStateAndError;
|
|
56
58
|
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
@@ -20,11 +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 JE_PAGE_TABS = [
|
|
24
|
-
'schedules',
|
|
25
|
-
'actual_matching',
|
|
26
|
-
'existing_schedules',
|
|
27
|
-
];
|
|
23
|
+
const JE_PAGE_TABS = ['schedules', 'existing_schedules'];
|
|
28
24
|
const toJEPageTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_PAGE_TABS);
|
|
29
25
|
exports.toJEPageTab = toJEPageTab;
|
|
30
26
|
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.22-
|
|
3
|
+
"version": "5.2.22-betaRD0",
|
|
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",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
|
-
import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
|
-
import { clearAll } from '../../../../rootActions';
|
|
7
|
-
import { toServiceMonthFromPeriod, } from '../../payload/actualMatchingPayload';
|
|
8
|
-
import { fetchActualMatching, fetchActualMatchingFailure, fetchActualMatchingSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
9
|
-
export const fetchActualMatchingEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchActualMatching.match), mergeMap((action) => {
|
|
10
|
-
const state = state$.value;
|
|
11
|
-
const { period, refreshViewInBackground } = action.payload;
|
|
12
|
-
const currentTenant = getCurrentTenant(state);
|
|
13
|
-
const selectedPeriod = state.expenseAutomationViewState
|
|
14
|
-
.selectedPeriodByTenantId[currentTenant.tenantId] ?? {
|
|
15
|
-
month: period.start.month,
|
|
16
|
-
year: period.start.year,
|
|
17
|
-
};
|
|
18
|
-
const serviceMonth = toServiceMonthFromPeriod(period);
|
|
19
|
-
return zeniAPI
|
|
20
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals?service_month=${encodeURIComponent(serviceMonth)}&view=actual_matching`)
|
|
21
|
-
.pipe(mergeMap((response) => {
|
|
22
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
23
|
-
const accruals = response.data.accruals ?? [];
|
|
24
|
-
const updateActions = [];
|
|
25
|
-
if (accruals.length > 0) {
|
|
26
|
-
updateActions.push(updateJEOneTimeAccruals(accruals));
|
|
27
|
-
}
|
|
28
|
-
updateActions.push(fetchActualMatchingSuccess({
|
|
29
|
-
accruals,
|
|
30
|
-
selectedPeriod,
|
|
31
|
-
refreshViewInBackground,
|
|
32
|
-
}));
|
|
33
|
-
return from(updateActions);
|
|
34
|
-
}
|
|
35
|
-
return of(fetchActualMatchingFailure({
|
|
36
|
-
status: response.status,
|
|
37
|
-
selectedPeriod,
|
|
38
|
-
refreshViewInBackground,
|
|
39
|
-
}));
|
|
40
|
-
}), catchError((error) => of(fetchActualMatchingFailure({
|
|
41
|
-
status: createZeniAPIStatus('Unexpected Error', 'fetch actual matching REST API call errored out' +
|
|
42
|
-
JSON.stringify(error)),
|
|
43
|
-
selectedPeriod,
|
|
44
|
-
refreshViewInBackground,
|
|
45
|
-
}))), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
46
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { fetchActualMatching, fetchActualMatchingPage, } from '../../reducers/actualMatchingViewReducer';
|
|
4
|
-
export const fetchActualMatchingPageEpic = (actions$) => actions$.pipe(filter(fetchActualMatchingPage.match), mergeMap((action) => {
|
|
5
|
-
const { period, refreshViewInBackground } = action.payload;
|
|
6
|
-
return of(fetchActualMatching(period, refreshViewInBackground));
|
|
7
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
|
-
import { convertToPeriod, toAbsoluteDay, } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
|
-
import { clearAll } from '../../../../rootActions';
|
|
7
|
-
import { toMatchAndReverseResult, } from '../../payload/actualMatchingPayload';
|
|
8
|
-
import { clearMatchNewModal, fetchActualMatching, matchAndReverseAccruals, matchAndReverseAccrualsFailure, matchAndReverseAccrualsSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
9
|
-
function refreshActualMatchingList(state) {
|
|
10
|
-
const selectedMonthYear = state.expenseAutomationViewState.selectedPeriodByTenantId[getCurrentTenant(state).tenantId];
|
|
11
|
-
if (selectedMonthYear == null) {
|
|
12
|
-
return [];
|
|
13
|
-
}
|
|
14
|
-
const period = convertToPeriod(selectedMonthYear);
|
|
15
|
-
const start = toAbsoluteDay(period.start);
|
|
16
|
-
const end = toAbsoluteDay(period.end);
|
|
17
|
-
if (start == null || end == null) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
return [fetchActualMatching({ start, end }, true)];
|
|
21
|
-
}
|
|
22
|
-
export const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(matchAndReverseAccruals.match), mergeMap((action) => {
|
|
23
|
-
const { transactionId, transactionIntegrationId, transactionType, lineId, accrualIds, } = action.payload;
|
|
24
|
-
const body = {
|
|
25
|
-
transaction_id: transactionId,
|
|
26
|
-
transaction_integration_id: transactionIntegrationId,
|
|
27
|
-
transaction_type: transactionType,
|
|
28
|
-
line_id: lineId,
|
|
29
|
-
accrual_ids: accrualIds,
|
|
30
|
-
};
|
|
31
|
-
return zeniAPI
|
|
32
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/match-and-reverse`, body)
|
|
33
|
-
.pipe(mergeMap((response) => {
|
|
34
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
35
|
-
const results = (response.data.results ?? []).map(toMatchAndReverseResult);
|
|
36
|
-
const successActions = [
|
|
37
|
-
matchAndReverseAccrualsSuccess({ results }),
|
|
38
|
-
];
|
|
39
|
-
const anyReversed = results.some((result) => result.status === 'reversed');
|
|
40
|
-
if (anyReversed) {
|
|
41
|
-
successActions.push(...refreshActualMatchingList(state$.value), clearMatchNewModal());
|
|
42
|
-
}
|
|
43
|
-
return from(successActions);
|
|
44
|
-
}
|
|
45
|
-
return of(matchAndReverseAccrualsFailure({ status: response.status }));
|
|
46
|
-
}), catchError((error) => of(matchAndReverseAccrualsFailure({
|
|
47
|
-
status: createZeniAPIStatus('Unexpected Error', 'Match and reverse accruals REST API call errored out' +
|
|
48
|
-
JSON.stringify(error)),
|
|
49
|
-
}))), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
50
|
-
}));
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { from, merge, of } from 'rxjs';
|
|
2
|
-
import { catchError, debounceTime, filter, mergeMap, switchMap, } from 'rxjs/operators';
|
|
3
|
-
import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
-
import { searchMatchAccruals, searchMatchAccrualsFailure, searchMatchAccrualsSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
6
|
-
import { MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, } from '../../types/actualMatchingViewState';
|
|
7
|
-
export const searchMatchAccrualsEpic = (actions$, _state$, zeniAPI) => {
|
|
8
|
-
const searchActions$ = actions$.pipe(filter(searchMatchAccruals.match));
|
|
9
|
-
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
10
|
-
const newSearchDebounced$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null), debounceTime(MATCH_SEARCH_DEBOUNCE_MS));
|
|
11
|
-
return merge(pagination$, newSearchDebounced$).pipe(switchMap((action) => {
|
|
12
|
-
const { query, pageToken } = action.payload;
|
|
13
|
-
const offset = pageToken != null && pageToken.length > 0 ? Number(pageToken) : 0;
|
|
14
|
-
const searchText = encodeURIComponent(query);
|
|
15
|
-
const limit = MATCH_ACCRUAL_SEARCH_LIMIT;
|
|
16
|
-
return zeniAPI
|
|
17
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals?status=posted&reversal_policy=on_bill_match&search_text=${searchText}&limit=${limit}&offset=${offset}`)
|
|
18
|
-
.pipe(mergeMap((response) => {
|
|
19
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
20
|
-
const accruals = response.data.accruals ?? [];
|
|
21
|
-
const append = pageToken != null;
|
|
22
|
-
const nextOffset = offset + accruals.length;
|
|
23
|
-
const total = response.data.total ?? nextOffset;
|
|
24
|
-
const nextPageToken = nextOffset < total ? String(nextOffset) : null;
|
|
25
|
-
const actionsOut = [];
|
|
26
|
-
if (accruals.length > 0) {
|
|
27
|
-
actionsOut.push(updateJEOneTimeAccruals(accruals));
|
|
28
|
-
}
|
|
29
|
-
actionsOut.push(searchMatchAccrualsSuccess({
|
|
30
|
-
append,
|
|
31
|
-
nextPageToken,
|
|
32
|
-
results: accruals,
|
|
33
|
-
}));
|
|
34
|
-
return from(actionsOut);
|
|
35
|
-
}
|
|
36
|
-
return of(searchMatchAccrualsFailure({
|
|
37
|
-
error: response.status,
|
|
38
|
-
}));
|
|
39
|
-
}), catchError((error) => of(searchMatchAccrualsFailure({
|
|
40
|
-
error: createZeniAPIStatus('Unexpected Error', 'Search match accruals REST API call errored out' +
|
|
41
|
-
JSON.stringify(error)),
|
|
42
|
-
}))));
|
|
43
|
-
}));
|
|
44
|
-
};
|
package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { from, merge, of } from 'rxjs';
|
|
2
|
-
import { catchError, debounceTime, filter, mergeMap, switchMap, } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
4
|
-
import { toActualMatchingTransactionSearchResult, } from '../../payload/actualMatchingPayload';
|
|
5
|
-
import { openMatchNewModal, searchMatchAccruals, searchMatchTransactions, searchMatchTransactionsFailure, searchMatchTransactionsSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
6
|
-
import { MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, } from '../../types/actualMatchingViewState';
|
|
7
|
-
export const searchMatchTransactionsEpic = (actions$, _state$, zeniAPI) => {
|
|
8
|
-
const openModal$ = actions$.pipe(filter(openMatchNewModal.match), mergeMap(() => from([
|
|
9
|
-
searchMatchTransactions({ query: '' }),
|
|
10
|
-
searchMatchAccruals({ query: '' }),
|
|
11
|
-
])));
|
|
12
|
-
const searchActions$ = actions$.pipe(filter(searchMatchTransactions.match));
|
|
13
|
-
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
14
|
-
const newSearchDebounced$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null), debounceTime(MATCH_SEARCH_DEBOUNCE_MS));
|
|
15
|
-
const search$ = merge(pagination$, newSearchDebounced$).pipe(switchMap((action) => {
|
|
16
|
-
const { query, pageToken } = action.payload;
|
|
17
|
-
const queryParam = {
|
|
18
|
-
search_text: query,
|
|
19
|
-
page_size: MATCH_TRANSACTION_SEARCH_PAGE_SIZE,
|
|
20
|
-
...(pageToken != null ? { page_token: pageToken } : {}),
|
|
21
|
-
};
|
|
22
|
-
return zeniAPI
|
|
23
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/match-transaction-search?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
24
|
-
.pipe(mergeMap((response) => {
|
|
25
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
26
|
-
const { transactions, next_page_token } = response.data;
|
|
27
|
-
const append = pageToken != null;
|
|
28
|
-
const results = (transactions ?? []).map(toActualMatchingTransactionSearchResult);
|
|
29
|
-
return of(searchMatchTransactionsSuccess({
|
|
30
|
-
append,
|
|
31
|
-
nextPageToken: next_page_token ?? null,
|
|
32
|
-
results,
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
return of(searchMatchTransactionsFailure({
|
|
36
|
-
error: response.status,
|
|
37
|
-
}));
|
|
38
|
-
}), catchError((error) => of(searchMatchTransactionsFailure({
|
|
39
|
-
error: createZeniAPIStatus('Unexpected Error', 'Search match transactions REST API call errored out' +
|
|
40
|
-
JSON.stringify(error)),
|
|
41
|
-
}))));
|
|
42
|
-
}));
|
|
43
|
-
return merge(openModal$, search$);
|
|
44
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { toString } from '../../../commonStateTypes/timePeriod';
|
|
2
|
-
import { toMatchAndReverseResultStatus, } from '../types/actualMatchingViewState';
|
|
3
|
-
export function toServiceMonthFromPeriod(period) {
|
|
4
|
-
return toString(period.start).slice(0, 7);
|
|
5
|
-
}
|
|
6
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
7
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
8
|
-
function resolveMatchSearchAmount(payload) {
|
|
9
|
-
const raw = payload.total_amount ?? payload.amount;
|
|
10
|
-
if (typeof raw === 'number' && Number.isFinite(raw)) {
|
|
11
|
-
return raw;
|
|
12
|
-
}
|
|
13
|
-
if (typeof raw === 'string' && raw !== '') {
|
|
14
|
-
const parsed = Number(raw);
|
|
15
|
-
if (Number.isFinite(parsed)) {
|
|
16
|
-
return parsed;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
function resolveMatchSearchCurrencySymbol(payload, currencyCode) {
|
|
22
|
-
if (payload.currency_symbol != null && payload.currency_symbol !== '') {
|
|
23
|
-
return payload.currency_symbol;
|
|
24
|
-
}
|
|
25
|
-
return currencyCode === DEFAULT_CURRENCY_CODE
|
|
26
|
-
? DEFAULT_CURRENCY_SYMBOL
|
|
27
|
-
: currencyCode;
|
|
28
|
-
}
|
|
29
|
-
export function toActualMatchingTransactionSearchResult(payload) {
|
|
30
|
-
const currencyCode = payload.currency_code != null && payload.currency_code !== ''
|
|
31
|
-
? payload.currency_code
|
|
32
|
-
: DEFAULT_CURRENCY_CODE;
|
|
33
|
-
return {
|
|
34
|
-
transactionId: payload.transaction_id,
|
|
35
|
-
transactionIntegrationId: payload.transaction_integration_id,
|
|
36
|
-
transactionType: payload.transaction_type,
|
|
37
|
-
lineId: payload.line_id,
|
|
38
|
-
vendorId: payload.vendor_id ?? undefined,
|
|
39
|
-
vendorName: payload.vendor_name ?? '',
|
|
40
|
-
amount: resolveMatchSearchAmount(payload),
|
|
41
|
-
transactionDate: payload.transaction_date,
|
|
42
|
-
accountId: payload.account_id ?? undefined,
|
|
43
|
-
accountName: payload.account_name ?? undefined,
|
|
44
|
-
accountDescription: payload.account_description ?? undefined,
|
|
45
|
-
accountingClassId: payload.accounting_class_id ?? undefined,
|
|
46
|
-
accountingClassName: payload.accounting_class_name ?? undefined,
|
|
47
|
-
currencyCode,
|
|
48
|
-
currencySymbol: resolveMatchSearchCurrencySymbol(payload, currencyCode),
|
|
49
|
-
transactionMemo: payload.transaction_memo ?? undefined,
|
|
50
|
-
transactionDescription: payload.transaction_description ?? undefined,
|
|
51
|
-
transactionTypeName: payload.transaction_type_name ?? undefined,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export function toMatchAndReverseResult(payload) {
|
|
55
|
-
return {
|
|
56
|
-
accrualId: payload.accrual_id,
|
|
57
|
-
status: toMatchAndReverseResultStatus(payload.status),
|
|
58
|
-
reason: payload.reason ?? undefined,
|
|
59
|
-
};
|
|
60
|
-
}
|