@zeniai/client-epic-state 5.2.7-betaAK2 → 5.2.7-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/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
- package/lib/entity/invoicing/coupon/couponConstants.d.ts +11 -0
- package/lib/entity/invoicing/coupon/couponConstants.js +29 -0
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -22
- package/lib/entity/invoicing/invoicingCommonPayload.js +5 -22
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
- package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +66 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +135 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +79 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -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 +9 -1
- package/lib/epic.js +16 -0
- package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +26 -0
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +5 -22
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +135 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/esm/epic.js +16 -0
- package/lib/esm/index.js +16 -9
- package/lib/esm/view/accountList/accountListReducer.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +99 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +139 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +106 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -0
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +306 -29
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +56 -11
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +294 -22
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
- package/lib/esm/view/expenseAutomationView/types/transactionGroup.js +21 -0
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +1 -2
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +0 -2
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +5 -10
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +25 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +15 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +3 -27
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +3 -7
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +18 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +16 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +1 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +60 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +12 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +1 -0
- package/lib/index.d.ts +19 -13
- package/lib/index.js +97 -48
- package/lib/view/accountList/accountListReducer.js +1 -0
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +20 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +103 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -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 +83 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +12 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +146 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +64 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +110 -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/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +1 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +72 -3
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +11 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +91 -12
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +308 -29
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +6 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +57 -12
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +302 -21
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +82 -8
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/transactionGroup.d.ts +21 -0
- package/lib/view/expenseAutomationView/types/transactionGroup.js +25 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +11 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +0 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +0 -2
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +5 -10
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +29 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +19 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +1 -9
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +4 -30
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +4 -11
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +3 -7
- package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +22 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +13 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +20 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +11 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +2 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +7 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +64 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +12 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +15 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +9 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +2 -0
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ import { EntityRecommendationKey } from '../../recommendation/recommendationStat
|
|
|
19
19
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
20
20
|
import { TransactionFilters } from '../transactionFilterTypes';
|
|
21
21
|
import { CompletedSubTab } from './completedSubTab';
|
|
22
|
+
import { TransactionGroup } from './transactionGroup';
|
|
22
23
|
export declare const toTransactionsSortKey: (v: string) => "project" | "date" | "vendor" | "category" | "class" | "amount" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
23
24
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
24
25
|
export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
|
|
@@ -147,6 +148,16 @@ export type TransactionsViewState = {
|
|
|
147
148
|
parentTotalCountByTab: Record<TransactionsTab, Record<MonthYearPeriodId, number>>;
|
|
148
149
|
selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
|
|
149
150
|
selectedTransactionCategorizationTab: TransactionsTab;
|
|
151
|
+
/**
|
|
152
|
+
* Statement-level scope (`'expense' | 'income' | 'all'`) forwarded to the
|
|
153
|
+
* listing API as `transaction_group`. Unlike the in-memory {@link
|
|
154
|
+
* TransactionsTabViewState.filters}, a change here invalidates every tab /
|
|
155
|
+
* sub-tab / count and drives a server refetch (the backend re-scopes the
|
|
156
|
+
* whole dataset by account_type). Only surfaced in the UI when the
|
|
157
|
+
* `is_revenue_automation_enabled` gate is on; the backend gate is
|
|
158
|
+
* authoritative regardless of what is sent.
|
|
159
|
+
*/
|
|
160
|
+
selectedTransactionGroup: TransactionGroup;
|
|
150
161
|
transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
|
|
151
162
|
};
|
|
152
163
|
export interface TransactionLineUpdates {
|
|
@@ -37,11 +37,6 @@ export interface InvoicingCatalogItemFormView extends SelectorView {
|
|
|
37
37
|
* Folded in here so the screen never reaches for the config view itself.
|
|
38
38
|
*/
|
|
39
39
|
fieldHelp: InvoicingFieldHelpByCode;
|
|
40
|
-
/**
|
|
41
|
-
* True while the accounting lists are still loading, so the form can wait
|
|
42
|
-
* instead of mounting pickers whose options are not there yet.
|
|
43
|
-
*/
|
|
44
|
-
isQboPickerDataLoading: boolean;
|
|
45
40
|
localData: InvoicingCatalogItemFormLocalData;
|
|
46
41
|
mode: 'create' | 'edit';
|
|
47
42
|
periodUnitOptions: InvoicingNamedOption[];
|
|
@@ -59,7 +59,6 @@ const getInvoicingCatalogItemFormView = (state, id) => {
|
|
|
59
59
|
const { billingPeriodUnitOptions, catalogItemTypeOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
60
60
|
return {
|
|
61
61
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'catalog'),
|
|
62
|
-
isQboPickerDataLoading: (0, invoicingQboViewSelector_1.isInvoicingAccountingPickerDataLoading)(state),
|
|
63
62
|
qboClassHierarchy: isQboConnected
|
|
64
63
|
? (0, invoicingQboViewSelector_1.getInvoicingQboView)(state).nestedClassHierarchy
|
|
65
64
|
: [],
|
|
@@ -32,7 +32,6 @@ export interface InvoicingOnboardingGateView {
|
|
|
32
32
|
acceptTermsState: FetchStateAndError;
|
|
33
33
|
enableState: FetchStateAndError;
|
|
34
34
|
fetchState: FetchState;
|
|
35
|
-
isQboConnected: boolean;
|
|
36
35
|
status?: InvoicingOnboardingStatus;
|
|
37
36
|
}
|
|
38
37
|
export declare const getInvoicingOnboardingGateView: (state: RootState) => InvoicingOnboardingGateView;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.invoicingFieldHelpForGroup = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = void 0;
|
|
4
|
-
const invoicingQboViewSelector_1 = require("../invoicingQboView/invoicingQboViewSelector");
|
|
5
4
|
const invoicingConfigViewPayload_1 = require("./invoicingConfigViewPayload");
|
|
6
5
|
const getInvoicingConfigView = (state) => {
|
|
7
6
|
const { acceptTermsFetchState, enableFetchState, ...configState } = state.invoicingConfigViewState;
|
|
@@ -19,7 +18,6 @@ const getInvoicingOnboardingGateView = (state) => {
|
|
|
19
18
|
acceptTermsState: acceptTermsFetchState,
|
|
20
19
|
enableState: enableFetchState,
|
|
21
20
|
fetchState,
|
|
22
|
-
isQboConnected: (0, invoicingQboViewSelector_1.isInvoicingQboConnected)(state),
|
|
23
21
|
status: (0, invoicingConfigViewPayload_1.deriveInvoicingOnboardingStatus)(state.invoicingConfigViewState.isInvoicingTosAccepted, state.invoicingConfigViewState.isInvoicingEnabled),
|
|
24
22
|
};
|
|
25
23
|
};
|
|
@@ -12,17 +12,12 @@ const invoicingQboViewSelector_1 = require("../invoicingQboViewSelector");
|
|
|
12
12
|
const fetchInvoicingAccountingPickersEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(invoicingQboViewReducer_1.fetchInvoicingAccountingPickers.match), (0, operators_1.withLatestFrom)(state$), (0, operators_1.mergeMap)(([, state]) => {
|
|
13
13
|
const actions = [];
|
|
14
14
|
const accountList = state.accountListState.byReportId[invoicingQboViewSelector_1.INVOICING_ACCOUNT_LIST_KEY];
|
|
15
|
-
|
|
16
|
-
// returned anything usable. The shared bucket can be Completed and empty
|
|
17
|
-
// because a screen that needs fewer accounts filled it first, which would
|
|
18
|
-
// leave the invoicing pickers empty with no request in flight to fix it.
|
|
19
|
-
const isAccountListUsable = accountList.hasValidState() && accountList.accountIds.length > 0;
|
|
20
|
-
if (isAccountListUsable === false &&
|
|
15
|
+
if (accountList.hasValidState() === false &&
|
|
21
16
|
accountList.fetchState !== 'In-Progress') {
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
actions.push((0, accountListReducer_1.fetchAccountList)(invoicingQboViewSelector_1.INVOICING_ACCOUNT_LIST_KEY, true));
|
|
17
|
+
// AP/AR accounts cannot back an invoicing mapping, so they are excluded
|
|
18
|
+
// here — which is why this uses invoicing's own bucket rather than the
|
|
19
|
+
// general `accountList` other screens fill without those exclusions.
|
|
20
|
+
actions.push((0, accountListReducer_1.fetchAccountList)(invoicingQboViewSelector_1.INVOICING_ACCOUNT_LIST_KEY, true, true, true));
|
|
26
21
|
}
|
|
27
22
|
const classList = state.classListState;
|
|
28
23
|
if (classList.hasValidState() === false &&
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { InvoicingQboViewActionType } from './invoicingQboViewActionType';
|
|
6
|
+
export declare const fetchInvoicingQboAccountsEpic: (actions$: ActionsObservable<InvoicingQboViewActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<InvoicingQboViewActionType>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchInvoicingQboAccountsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const invoicingQboViewPayload_1 = require("../invoicingQboViewPayload");
|
|
8
|
+
const invoicingQboViewReducer_1 = require("../invoicingQboViewReducer");
|
|
9
|
+
const fetchInvoicingQboAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingQboViewReducer_1.fetchInvoicingQboAccounts.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
+
const { accountTypes } = action.payload;
|
|
11
|
+
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/qbo/accounts?account_types=${encodeURIComponent(accountTypes)}`;
|
|
12
|
+
return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.map)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
14
|
+
return (0, invoicingQboViewReducer_1.updateInvoicingQboAccounts)({
|
|
15
|
+
accountTypes,
|
|
16
|
+
accounts: (0, invoicingQboViewPayload_1.mapInvoicingQboAccountOptions)(response.data?.accounts ?? []),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return (0, invoicingQboViewReducer_1.updateInvoicingQboAccountsFailure)({
|
|
20
|
+
accountTypes,
|
|
21
|
+
status: response.status,
|
|
22
|
+
});
|
|
23
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingQboViewReducer_1.updateInvoicingQboAccountsFailure)({
|
|
24
|
+
accountTypes,
|
|
25
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch QBO accounts REST API call errored out ' +
|
|
26
|
+
JSON.stringify(error)),
|
|
27
|
+
}))));
|
|
28
|
+
}));
|
|
29
|
+
exports.fetchInvoicingQboAccountsEpic = fetchInvoicingQboAccountsEpic;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { InvoicingQboViewActionType } from './invoicingQboViewActionType';
|
|
6
|
+
export declare const fetchInvoicingQboClassesEpic: (actions$: ActionsObservable<InvoicingQboViewActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<InvoicingQboViewActionType>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchInvoicingQboClassesEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const invoicingQboViewPayload_1 = require("../invoicingQboViewPayload");
|
|
8
|
+
const invoicingQboViewReducer_1 = require("../invoicingQboViewReducer");
|
|
9
|
+
const fetchInvoicingQboClassesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingQboViewReducer_1.fetchInvoicingQboClasses.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/qbo/classes`;
|
|
11
|
+
return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.map)((response) => {
|
|
12
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
13
|
+
return (0, invoicingQboViewReducer_1.updateInvoicingQboClasses)((0, invoicingQboViewPayload_1.mapInvoicingQboAccountOptions)(response.data?.accounts ?? []));
|
|
14
|
+
}
|
|
15
|
+
return (0, invoicingQboViewReducer_1.updateInvoicingQboClassesFailure)(response.status);
|
|
16
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingQboViewReducer_1.updateInvoicingQboClassesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch QBO classes REST API call errored out ' +
|
|
17
|
+
JSON.stringify(error))))));
|
|
18
|
+
}));
|
|
19
|
+
exports.fetchInvoicingQboClassesEpic = fetchInvoicingQboClassesEpic;
|
|
@@ -4,17 +4,9 @@ import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
|
4
4
|
import { AccountType } from '../../../entity/account/accountState';
|
|
5
5
|
import { RootState } from '../../../rootStateTypes';
|
|
6
6
|
import { InvoicingQboConnection, InvoicingQboSyncHealth } from './invoicingQboViewPayload';
|
|
7
|
-
export declare const INVOICING_ACCOUNT_LIST_KEY: "
|
|
7
|
+
export declare const INVOICING_ACCOUNT_LIST_KEY: "invoicingAccountList";
|
|
8
8
|
/** Whether QBO is connected, without building the option lists to find out. */
|
|
9
9
|
export declare const isInvoicingQboConnected: (state: RootState) => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Whether the accounting pickers are still waiting on their data. Only true when
|
|
12
|
-
* QBO is connected: a tenant without it has no pickers to populate, so the form
|
|
13
|
-
* must not sit behind a skeleton waiting for lists it will never show.
|
|
14
|
-
*/
|
|
15
|
-
export declare const isInvoicingAccountingPickerDataLoading: (state: RootState) => boolean;
|
|
16
|
-
/** The QBO connection fetch on its own, without building the bundled view. */
|
|
17
|
-
export declare const getInvoicingQboConnectionFetchState: (state: RootState) => FetchStateAndError;
|
|
18
10
|
/**
|
|
19
11
|
* Account types that can back invoicing revenue. Named here so screens ask for
|
|
20
12
|
* "income accounts" rather than repeating the accounting service's vocabulary.
|
|
@@ -1,40 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingQboView = exports.invoicingAccountHierarchyForTypes = exports.invoicingAccountsForQboAccountTypes = exports.INVOICING_INCOME_ACCOUNT_TYPES = exports.
|
|
3
|
+
exports.getInvoicingQboView = exports.invoicingAccountHierarchyForTypes = exports.invoicingAccountsForQboAccountTypes = exports.INVOICING_INCOME_ACCOUNT_TYPES = exports.isInvoicingQboConnected = exports.INVOICING_ACCOUNT_LIST_KEY = void 0;
|
|
4
4
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
5
5
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
exports.INVOICING_ACCOUNT_LIST_KEY = 'accountList';
|
|
6
|
+
// Its own bucket: invoicing needs the AP/AR exclusions that the vendor and
|
|
7
|
+
// transaction screens sharing `accountList` do not pass.
|
|
8
|
+
exports.INVOICING_ACCOUNT_LIST_KEY = 'invoicingAccountList';
|
|
10
9
|
/** Whether QBO is connected, without building the option lists to find out. */
|
|
11
10
|
const isInvoicingQboConnected = (state) => state.invoicingQboViewState.connection?.connected === true;
|
|
12
11
|
exports.isInvoicingQboConnected = isInvoicingQboConnected;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the accounting pickers are still waiting on their data. Only true when
|
|
15
|
-
* QBO is connected: a tenant without it has no pickers to populate, so the form
|
|
16
|
-
* must not sit behind a skeleton waiting for lists it will never show.
|
|
17
|
-
*/
|
|
18
|
-
const isInvoicingAccountingPickerDataLoading = (state) => {
|
|
19
|
-
const isPending = (fetchState) => fetchState === 'Not-Started' || fetchState === 'In-Progress';
|
|
20
|
-
// The connection settles first and decides whether the lists are fetched at
|
|
21
|
-
// all, so it counts as loading too. Reporting "not loading" while it is in
|
|
22
|
-
// flight renders the form, then takes it away again the moment the tenant
|
|
23
|
-
// turns out to be connected.
|
|
24
|
-
if (isPending((0, exports.getInvoicingQboConnectionFetchState)(state).fetchState)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
if (!(0, exports.isInvoicingQboConnected)(state)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
const accountList = state.accountListState.byReportId[exports.INVOICING_ACCOUNT_LIST_KEY];
|
|
31
|
-
return (isPending(accountList.fetchState) ||
|
|
32
|
-
isPending(state.classListState.fetchState));
|
|
33
|
-
};
|
|
34
|
-
exports.isInvoicingAccountingPickerDataLoading = isInvoicingAccountingPickerDataLoading;
|
|
35
|
-
/** The QBO connection fetch on its own, without building the bundled view. */
|
|
36
|
-
const getInvoicingQboConnectionFetchState = (state) => state.invoicingQboViewState.connectionFetchState;
|
|
37
|
-
exports.getInvoicingQboConnectionFetchState = getInvoicingQboConnectionFetchState;
|
|
38
12
|
/**
|
|
39
13
|
* Account types that can back invoicing revenue. Named here so screens ask for
|
|
40
14
|
* "income accounts" rather than repeating the accounting service's vocabulary.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
2
|
import { InvoicingDunningActionOption, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
|
-
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
4
3
|
import { RootState } from '../../../rootStateTypes';
|
|
4
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
5
5
|
import { InvoicingBrandingFormLocalData } from './invoicingBrandingFormConfig';
|
|
6
6
|
/**
|
|
7
7
|
* Shared primitive: the raw invoicing settings. Consumed internally by other
|
|
@@ -53,12 +53,6 @@ export interface InvoicingSettingsHubView {
|
|
|
53
53
|
configFetchState: FetchState;
|
|
54
54
|
dunningScheduleActionOptions: InvoicingDunningActionOption[];
|
|
55
55
|
isEnablingInvoicing: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Whether the tenant has already enabled invoicing. The enable footer is for
|
|
58
|
-
* tenants that have not, so this — not `canEnableInvoicing` — decides whether
|
|
59
|
-
* it renders at all.
|
|
60
|
-
*/
|
|
61
|
-
isInvoicingEnabled: boolean;
|
|
62
56
|
isQboConfigured: boolean;
|
|
63
57
|
isStripeConnected: boolean;
|
|
64
58
|
qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[];
|
|
@@ -73,10 +67,9 @@ export interface InvoicingSettingsHubView {
|
|
|
73
67
|
* two integration prerequisites kept separate so the hub can name the step still
|
|
74
68
|
* outstanding instead of showing a dead button.
|
|
75
69
|
*
|
|
76
|
-
* `
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* disabled and naming what is left, rather than nothing at all.
|
|
70
|
+
* `canEnableInvoicing` folds in the onboarding step, so the screen does not need
|
|
71
|
+
* to re-check it: the footer is only offered mid-onboarding and only once both
|
|
72
|
+
* integrations are ready.
|
|
80
73
|
*
|
|
81
74
|
* Deliberately not folded into `getInvoicingConfigView`: that selector gates
|
|
82
75
|
* every invoicing route and stays a pure read of the config slice. The settings
|
|
@@ -70,10 +70,9 @@ function deriveInvoicingEnablePrerequisites(settings, isQboConnected, qboAccount
|
|
|
70
70
|
* two integration prerequisites kept separate so the hub can name the step still
|
|
71
71
|
* outstanding instead of showing a dead button.
|
|
72
72
|
*
|
|
73
|
-
* `
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* disabled and naming what is left, rather than nothing at all.
|
|
73
|
+
* `canEnableInvoicing` folds in the onboarding step, so the screen does not need
|
|
74
|
+
* to re-check it: the footer is only offered mid-onboarding and only once both
|
|
75
|
+
* integrations are ready.
|
|
77
76
|
*
|
|
78
77
|
* Deliberately not folded into `getInvoicingConfigView`: that selector gates
|
|
79
78
|
* every invoicing route and stays a pure read of the config slice. The settings
|
|
@@ -83,10 +82,7 @@ const getInvoicingSettingsHubView = (state) => {
|
|
|
83
82
|
const { dunningScheduleActionOptions, enableState, error: configError, fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, status, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
84
83
|
const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
|
|
85
84
|
return {
|
|
86
|
-
// Keeps the onboarding step in the gate: a tenant that has not accepted the
|
|
87
|
-
// terms cannot enable invoicing, whatever the integrations say.
|
|
88
85
|
canEnableInvoicing: status === 'settings' && canEnable,
|
|
89
|
-
isInvoicingEnabled: state.invoicingConfigViewState.isInvoicingEnabled === true,
|
|
90
86
|
configError,
|
|
91
87
|
configFetchState,
|
|
92
88
|
dunningScheduleActionOptions,
|
|
@@ -33,7 +33,7 @@ const fetchAccruedScheduleListEpic = (actions$, state$, zeniAPI) => actions$.pip
|
|
|
33
33
|
je_schedule_type: scheduleType,
|
|
34
34
|
sort_by: 'transaction_date',
|
|
35
35
|
sort_order: 'desc',
|
|
36
|
-
filter:
|
|
36
|
+
filter: action.payload.statusFilter,
|
|
37
37
|
};
|
|
38
38
|
return zeniAPI
|
|
39
39
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -10,9 +10,14 @@ const responsePayload_1 = require("../../../../responsePayload");
|
|
|
10
10
|
const scheduleListReducer_1 = require("../scheduleListReducer");
|
|
11
11
|
const scheduleListTypes_1 = require("../scheduleListTypes");
|
|
12
12
|
const fetchDownloadSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleListReducer_1.fetchDownloadSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { scheduleType, downloadCategories } = action.payload;
|
|
13
|
+
const { scheduleType, downloadCategories, statusFilter } = action.payload;
|
|
14
14
|
const scheduleListState = state$.value.scheduleListState;
|
|
15
15
|
// if parameters are provided, use those. else go to localdata
|
|
16
|
+
// Accrued is deliberately not served here. Its rows come back in a different shape, this
|
|
17
|
+
// epic writes them through updateJESchedules (the prepaid / fixed mapper), and
|
|
18
|
+
// doUpdateScheduleList never flips downloadState for accrued -- so a request would store the
|
|
19
|
+
// wrong data and then never report completion. Accrued downloads go through
|
|
20
|
+
// fetchAccruedScheduleList, which owns that shape end to end.
|
|
16
21
|
let scheduleState;
|
|
17
22
|
if (scheduleType !== 'accrued_expenses') {
|
|
18
23
|
scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState, scheduleType);
|
|
@@ -37,7 +42,7 @@ const fetchDownloadSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
37
42
|
base_txn_account_ids: downloadCategories,
|
|
38
43
|
sort_by: 'transaction_date',
|
|
39
44
|
sort_order: 'desc',
|
|
40
|
-
filter:
|
|
45
|
+
filter: statusFilter,
|
|
41
46
|
};
|
|
42
47
|
return zeniAPI
|
|
43
48
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/download?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -16,7 +16,7 @@ export declare const initialState: ScheduleListViewState;
|
|
|
16
16
|
export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory: {
|
|
17
17
|
selectedCategoryId: ID;
|
|
18
18
|
selectedTimeframe: TimeframeTick;
|
|
19
|
-
}, downloadCategories: string[], cacheOverride?: any], {
|
|
19
|
+
}, downloadCategories: string[], statusFilter?: "completed" | "new" | "ongoing" | "all" | undefined, cacheOverride?: any], {
|
|
20
20
|
timeframeAndCategory: {
|
|
21
21
|
selectedCategoryId: ID;
|
|
22
22
|
selectedTimeframe: TimeframeTick;
|
|
@@ -24,16 +24,18 @@ export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCr
|
|
|
24
24
|
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
25
25
|
cacheOverride: any;
|
|
26
26
|
downloadCategories: string[];
|
|
27
|
+
statusFilter: "completed" | "new" | "ongoing" | "all";
|
|
27
28
|
}, "scheduleListView/fetchDownloadSchedules", never, never>, fetchAccruedScheduleList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory?: {
|
|
28
29
|
selectedCategoryId: ID;
|
|
29
30
|
selectedTimeframe: TimeframeTick;
|
|
30
|
-
} | undefined, cacheOverride?: any], {
|
|
31
|
+
} | undefined, cacheOverride?: any, statusFilter?: "completed" | "new" | "ongoing" | "all" | undefined], {
|
|
31
32
|
timeframeAndCategory: {
|
|
32
33
|
selectedCategoryId: ID;
|
|
33
34
|
selectedTimeframe: TimeframeTick;
|
|
34
35
|
} | undefined;
|
|
35
36
|
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
36
37
|
cacheOverride: any;
|
|
38
|
+
statusFilter: "completed" | "new" | "ongoing" | "all";
|
|
37
39
|
}, "scheduleListView/fetchAccruedScheduleList", never, never>, fetchScheduleList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory?: {
|
|
38
40
|
selectedCategoryId: ID;
|
|
39
41
|
selectedTimeframe: TimeframeTick;
|
|
@@ -90,8 +90,8 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
90
90
|
reducers: {
|
|
91
91
|
fetchDownloadSchedules: {
|
|
92
92
|
reducer(draft, action) {
|
|
93
|
+
// Accrued is not downloaded through this action -- see fetchDownloadSchedulesEpic for why.
|
|
93
94
|
if (action.payload.scheduleType !== 'accrued_expenses') {
|
|
94
|
-
//if condition added for type narrowing
|
|
95
95
|
const state = getState(draft, action.payload.scheduleType);
|
|
96
96
|
const selectedTimeframe = action.payload.timeframeAndCategory.selectedTimeframe;
|
|
97
97
|
const selectedCategoryId = action.payload.timeframeAndCategory.selectedCategoryId;
|
|
@@ -115,13 +115,14 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
115
115
|
updateState(draft, action.payload.scheduleType, state);
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
-
prepare(scheduleType, timeframeAndCategory, downloadCategories, cacheOverride = false) {
|
|
118
|
+
prepare(scheduleType, timeframeAndCategory, downloadCategories, statusFilter = 'all', cacheOverride = false) {
|
|
119
119
|
return {
|
|
120
120
|
payload: {
|
|
121
121
|
timeframeAndCategory,
|
|
122
122
|
scheduleType,
|
|
123
123
|
cacheOverride,
|
|
124
124
|
downloadCategories,
|
|
125
|
+
statusFilter,
|
|
125
126
|
},
|
|
126
127
|
};
|
|
127
128
|
},
|
|
@@ -157,12 +158,13 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
157
158
|
updateState(draft, action.payload.scheduleType, state);
|
|
158
159
|
}
|
|
159
160
|
},
|
|
160
|
-
prepare(scheduleType, timeframeAndCategory, cacheOverride = false) {
|
|
161
|
+
prepare(scheduleType, timeframeAndCategory, cacheOverride = false, statusFilter = 'all') {
|
|
161
162
|
return {
|
|
162
163
|
payload: {
|
|
163
164
|
timeframeAndCategory,
|
|
164
165
|
scheduleType,
|
|
165
166
|
cacheOverride,
|
|
167
|
+
statusFilter,
|
|
166
168
|
},
|
|
167
169
|
};
|
|
168
170
|
},
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoIntroClosedByOutsideClickFailure, updateTreasuryPromoIntroClosedByOutsideClickSuccess } from '../treasurySetupViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClick> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickSuccess> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickFailure>;
|
|
8
|
+
export declare const updateTreasuryPromoIntroClosedByOutsideClickEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
9
|
+
const updateTreasuryPromoIntroClosedByOutsideClickEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClick.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_intro_closed_by_outside_click: true })
|
|
12
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
14
|
+
return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickSuccess)());
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)(response.status));
|
|
18
|
+
}
|
|
19
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo intro closed by outside click REST API call errored out' +
|
|
20
|
+
(error?.message ?? JSON.stringify(error)))))));
|
|
21
|
+
}));
|
|
22
|
+
exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = updateTreasuryPromoIntroClosedByOutsideClickEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTreasuryPromoRemindMeLaterClickedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { updateTreasuryPromoRemindMeLaterClicked, updateTreasuryPromoRemindMeLaterClickedFailure, updateTreasuryPromoRemindMeLaterClickedSuccess } from '../treasurySetupViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof updateTreasuryPromoRemindMeLaterClicked> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedForLoggedInUser> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedSuccess> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedFailure>;
|
|
8
|
+
export declare const updateTreasuryPromoRemindMeLaterClickedEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTreasuryPromoRemindMeLaterClickedEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
9
|
+
const updateTreasuryPromoRemindMeLaterClickedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClicked.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_remind_me_later_clicked: true })
|
|
12
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
14
|
+
return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoRemindMeLaterClickedForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedSuccess)());
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)(response.status));
|
|
18
|
+
}
|
|
19
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo remind me later REST API call errored out' +
|
|
20
|
+
(error?.message ?? JSON.stringify(error)))))));
|
|
21
|
+
}));
|
|
22
|
+
exports.updateTreasuryPromoRemindMeLaterClickedEpic = updateTreasuryPromoRemindMeLaterClickedEpic;
|
package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTreasuryVideoViewedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { updateTreasuryVideoViewed, updateTreasuryVideoViewedFailure, updateTreasuryVideoViewedSuccess } from '../treasurySetupViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof updateTreasuryVideoViewed> | ReturnType<typeof updateTreasuryVideoViewedForLoggedInUser> | ReturnType<typeof updateTreasuryVideoViewedSuccess> | ReturnType<typeof updateTreasuryVideoViewedFailure>;
|
|
8
|
+
export declare const updateTreasuryVideoViewedEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTreasuryVideoViewedEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
9
|
+
const updateTreasuryVideoViewedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryVideoViewed.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_played: true })
|
|
12
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
14
|
+
return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryVideoViewedForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryVideoViewedSuccess)());
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryVideoViewedFailure)(response.status));
|
|
18
|
+
}
|
|
19
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryVideoViewedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury video viewed REST API call errored out' +
|
|
20
|
+
(error?.message ?? JSON.stringify(error)))))));
|
|
21
|
+
}));
|
|
22
|
+
exports.updateTreasuryVideoViewedEpic = updateTreasuryVideoViewedEpic;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { updateAccounts } from '../../entity/account/accountReducer';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
+
import { fetchZeniAccountsPromoCard, updateZeniAccountsPromoCard, updateZeniAccountsPromoCardFailure } from './zeniAccountsPromoCardReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchZeniAccountsPromoCard> | ReturnType<typeof updateZeniAccountsPromoCard> | ReturnType<typeof updateZeniAccountsPromoCardFailure> | ReturnType<typeof updateAccounts>;
|
|
7
|
+
export declare const fetchZeniAccountsPromoCardEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
+
payload: import("./zeniAccountsPromoCardPayload").ZeniAccountsPromoCardPayload;
|
|
9
|
+
type: "zeniAccountsPromoCard/updateZeniAccountsPromoCard";
|
|
10
|
+
} | {
|
|
11
|
+
payload: import("../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
12
|
+
type: "zeniAccountsPromoCard/updateZeniAccountsPromoCardFailure";
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchZeniAccountsPromoCardEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
7
|
+
const zeniAccountsPromoCardReducer_1 = require("./zeniAccountsPromoCardReducer");
|
|
8
|
+
const fetchZeniAccountsPromoCardEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(zeniAccountsPromoCardReducer_1.fetchZeniAccountsPromoCard.match), (0, operators_1.switchMap)(() => zeniAPI
|
|
9
|
+
.getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/promo-card`)
|
|
10
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
11
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
12
|
+
return (0, rxjs_1.of)((0, zeniAccountsPromoCardReducer_1.updateZeniAccountsPromoCard)(response.data) // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return (0, rxjs_1.of)((0, zeniAccountsPromoCardReducer_1.updateZeniAccountsPromoCardFailure)(response.status));
|
|
17
|
+
}
|
|
18
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, zeniAccountsPromoCardReducer_1.updateZeniAccountsPromoCardFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Zeni Accounts Promo Card REST API call errored out' +
|
|
19
|
+
JSON.stringify(error))))))));
|
|
20
|
+
exports.fetchZeniAccountsPromoCardEpic = fetchZeniAccountsPromoCardEpic;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
+
export interface ZeniAccountsPromoCardPayload {
|
|
4
|
+
is_show_deposit_accounts_promo_card: boolean;
|
|
5
|
+
max_apy: number;
|
|
6
|
+
max_cash_balance_available: number | null;
|
|
7
|
+
max_insured_amount: number;
|
|
8
|
+
max_possible_interest: number | null;
|
|
9
|
+
primary_deposit_account_id: ID | null;
|
|
10
|
+
}
|
|
11
|
+
export type ZeniAccountsPromoCardResponse = ZeniAPIResponse<ZeniAccountsPromoCardPayload>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
+
import { ZeniAccountsPromoCardPayload } from './zeniAccountsPromoCardPayload';
|
|
3
|
+
import { ZeniAccountsPromoCardState } from './zeniAccountsPromoCardState';
|
|
4
|
+
export declare const initialState: ZeniAccountsPromoCardState;
|
|
5
|
+
export declare const fetchZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"zeniAccountsPromoCard/fetchZeniAccountsPromoCard">, updateZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAccountsPromoCardPayload, "zeniAccountsPromoCard/updateZeniAccountsPromoCard">, updateZeniAccountsPromoCardFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "zeniAccountsPromoCard/updateZeniAccountsPromoCardFailure">, clearZeniAccountsPromoCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"zeniAccountsPromoCard/clearZeniAccountsPromoCard">;
|
|
6
|
+
declare const _default: import("redux").Reducer<ZeniAccountsPromoCardState>;
|
|
7
|
+
export default _default;
|