@zeniai/client-epic-state 5.2.11-betaRD1 → 5.2.12
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/invoicing/invoicingCommonPayload.d.ts +27 -29
- package/lib/entity/invoicing/invoicingCommonPayload.js +37 -75
- package/lib/entity/invoicing/product/productPayload.d.ts +10 -0
- package/lib/entity/invoicing/product/productPayload.js +14 -2
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +0 -1
- package/lib/entity/jeSchedules/jeScheduleHelper.js +0 -7
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -66
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -135
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -4
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -11
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +3 -38
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -79
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -24
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -88
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +0 -2
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -2
- package/lib/epic.d.ts +2 -10
- package/lib/epic.js +10 -21
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +33 -73
- package/lib/esm/entity/invoicing/product/productPayload.js +14 -2
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +0 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +1 -135
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -36
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -78
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/esm/epic.js +6 -17
- package/lib/esm/index.js +13 -18
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +5 -41
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +0 -55
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -306
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +22 -294
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +25 -9
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +6 -1
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +40 -0
- package/lib/esm/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +27 -0
- package/lib/esm/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +19 -0
- package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +19 -0
- package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +39 -0
- package/lib/esm/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +25 -0
- package/lib/esm/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +48 -0
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +25 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +41 -0
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/lib/index.d.ts +19 -22
- package/lib/index.js +59 -96
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +3 -39
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +3 -72
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -58
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +12 -91
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -308
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +7 -36
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +0 -34
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +21 -302
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -82
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +12 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +25 -9
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +6 -1
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +10 -1
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +43 -1
- package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.d.ts +6 -0
- package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +31 -0
- package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.d.ts +6 -0
- package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +23 -0
- package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.d.ts +6 -0
- package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +23 -0
- package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.d.ts +6 -0
- package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +43 -0
- package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +5 -0
- package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.d.ts +11 -0
- package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +29 -0
- package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.d.ts +34 -0
- package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +53 -0
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +4 -1
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +26 -2
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +35 -0
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +43 -1
- package/lib/view/invoicing/settingsView/settingsViewState.d.ts +8 -0
- package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +2 -4
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/package.json +1 -1
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
- package/lib/entity/invoicing/coupon/couponConstants.d.ts +0 -11
- package/lib/entity/invoicing/coupon/couponConstants.js +0 -29
- package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +0 -26
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -45
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -99
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -25
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -110
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -79
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -139
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -106
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -22
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -140
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -106
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -25
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -15
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +0 -92
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -18
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -16
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -1
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -60
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -12
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +0 -20
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -49
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -103
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -29
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +0 -45
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -114
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -83
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +0 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -146
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +0 -64
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -110
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -26
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +0 -36
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -145
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +0 -42
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +0 -21
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -112
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -29
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -19
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +0 -12
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +0 -99
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +0 -13
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -20
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +0 -11
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -2
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +0 -7
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -64
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +0 -12
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -15
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +0 -9
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -2
- /package/lib/esm/view/{expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js → invoicing/settingsView/epics/settingsViewActionType.js} +0 -0
- /package/lib/view/{expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js → invoicing/settingsView/epics/settingsViewActionType.js} +0 -0
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prepareNewSchedulePayload = exports.computeNewScheduleJeDetails = void 0;
|
|
4
|
-
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
-
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
6
|
-
const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
7
|
-
const timePeriod_2 = require("../../../commonStateTypes/timePeriod");
|
|
8
|
-
const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper");
|
|
9
|
-
const scheduleDetailPayload_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailPayload");
|
|
10
|
-
const getNewScheduleMemo = (vendorName, schedulePostingDate, currentPeriod, totalPeriod, assetId) => {
|
|
11
|
-
const addAsset = assetId != null && assetId !== '' ? ` - ${assetId}` : '';
|
|
12
|
-
return `${vendorName} - ${schedulePostingDate.format(formatZeniDateFY_1.MONTH_YEAR_FORMAT)} (${currentPeriod} of ${totalPeriod})${addAsset}`;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Computes the month-by-month JE schedule breakdown for a brand-new schedule
|
|
16
|
-
* (no linked transaction yet) — replicates createNewSchedulesHelper's math
|
|
17
|
-
* (scheduleDetailLocalDataHelper.ts) exactly: lump-sum total split evenly
|
|
18
|
-
* across months with the rounding remainder absorbed by the last month, and a
|
|
19
|
-
* running balance that decrements each month and is forced to exactly 0 on
|
|
20
|
-
* the last row.
|
|
21
|
-
*/
|
|
22
|
-
const computeNewScheduleJeDetails = (localData, totalAmount, vendorName) => {
|
|
23
|
-
const period = localData.selectedMonths;
|
|
24
|
-
const startingMonth = localData.selectedDate;
|
|
25
|
-
if (startingMonth == null || period == null) {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
const assetId = 'assetId' in localData ? localData.assetId : undefined;
|
|
29
|
-
const averageAmount = Math.abs(Math.round((totalAmount.amount / period) * 100) / 100);
|
|
30
|
-
const lastMonthAmount = Math.abs(Math.round((Math.abs(totalAmount.amount) - averageAmount * (period - 1)) * 100) / 100);
|
|
31
|
-
let runningBalance = Math.abs(totalAmount.amount);
|
|
32
|
-
const negativeNumbers = totalAmount.amount < 0 || runningBalance < 0;
|
|
33
|
-
const newJeDetails = [];
|
|
34
|
-
for (let index = 0; index < period; index++) {
|
|
35
|
-
if (runningBalance > averageAmount) {
|
|
36
|
-
runningBalance = Math.round((runningBalance - averageAmount) * 100) / 100;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
runningBalance = 0;
|
|
40
|
-
}
|
|
41
|
-
const amount = index === period - 1 ? lastMonthAmount : averageAmount;
|
|
42
|
-
runningBalance = index === period - 1 ? 0 : runningBalance;
|
|
43
|
-
const schedulePostingDate = startingMonth.add(index, 'month');
|
|
44
|
-
const { postingDate, postingStatus } = (0, scheduleDetailLocalDataHelper_1.getPostingDateAndStatusForIndex)(schedulePostingDate.month(), schedulePostingDate.year(), localData.lastDayOfMonth === true
|
|
45
|
-
? undefined
|
|
46
|
-
: localData.selectedDayOfMonth);
|
|
47
|
-
newJeDetails.push({
|
|
48
|
-
postingDate,
|
|
49
|
-
amount: (0, amount_1.toAmount)(negativeNumbers ? -amount : amount, totalAmount.currencyCode, totalAmount.currencySymbol),
|
|
50
|
-
runningBalance: (0, amount_1.toAmount)(negativeNumbers ? -runningBalance : runningBalance, totalAmount.currencyCode, totalAmount.currencySymbol),
|
|
51
|
-
postingStatus,
|
|
52
|
-
memo: getNewScheduleMemo(vendorName, schedulePostingDate, index + 1, period, assetId),
|
|
53
|
-
jeLink: { type: 'unknown' },
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return newJeDetails;
|
|
57
|
-
};
|
|
58
|
-
exports.computeNewScheduleJeDetails = computeNewScheduleJeDetails;
|
|
59
|
-
const mapNewJeDetailsToScheduledJournalEntryPayload = (jeScheduleDetails) => jeScheduleDetails.map((journalEntry) => ({
|
|
60
|
-
status: {
|
|
61
|
-
code: journalEntry.postingStatus,
|
|
62
|
-
label: journalEntry.postingStatus,
|
|
63
|
-
},
|
|
64
|
-
transaction_memo: journalEntry.memo,
|
|
65
|
-
third_party_id: journalEntry.jeLink.thirdPartyTransactionId ?? null,
|
|
66
|
-
expected_post_date: journalEntry.postingDate.format(timePeriod_1.DEFAULT_DATE_FORMAT),
|
|
67
|
-
amount: journalEntry.amount.amount,
|
|
68
|
-
balance: journalEntry.runningBalance.amount,
|
|
69
|
-
// Brand-new schedule — there is no prior scheduled-journal-entry history
|
|
70
|
-
// to cross-reference (unlike the legacy edit flow's equivalent mapper).
|
|
71
|
-
scheduled_journal_entry_id: null,
|
|
72
|
-
actual_post_date: null,
|
|
73
|
-
is_platform_generated: null,
|
|
74
|
-
je_schedule_id: null,
|
|
75
|
-
update_time: null,
|
|
76
|
-
create_time: null,
|
|
77
|
-
}));
|
|
78
|
-
/**
|
|
79
|
-
* Builds a savable schedule payload directly from a Base Transaction search
|
|
80
|
-
* result and the New Schedule form's local data — bypassing the legacy
|
|
81
|
-
* getJEScheduledTransactionByJEScheduleTransactionKey selector entirely,
|
|
82
|
-
* since that selector throws unless the entity has already round-tripped
|
|
83
|
-
* through a real GET /1.0/schedules/:id. A brand-new schedule has no such
|
|
84
|
-
* history, so this reads only from data already in hand (the selected
|
|
85
|
-
* transaction/line plus what the user filled into the form).
|
|
86
|
-
*/
|
|
87
|
-
const prepareNewSchedulePayload = (transaction, localData, scheduleType) => {
|
|
88
|
-
if (transaction.thirdPartyTransactionId == null ||
|
|
89
|
-
transaction.thirdPartyTransactionId === '') {
|
|
90
|
-
return { ok: false, reason: 'missing_third_party_id' };
|
|
91
|
-
}
|
|
92
|
-
const scheduleTransaction = transaction;
|
|
93
|
-
const vendorId = localData.selectedVendor?.id ?? transaction.vendorId ?? '';
|
|
94
|
-
const vendorName = localData.selectedVendor?.name ?? transaction.vendorName ?? '';
|
|
95
|
-
if (vendorId === '' || vendorName === '') {
|
|
96
|
-
return { ok: false, reason: 'missing_vendor' };
|
|
97
|
-
}
|
|
98
|
-
const vendor = {
|
|
99
|
-
vendor_id: vendorId,
|
|
100
|
-
vendor_name: vendorName,
|
|
101
|
-
};
|
|
102
|
-
const jeScheduleDetails = (0, exports.computeNewScheduleJeDetails)(localData, scheduleTransaction.amount, vendorName);
|
|
103
|
-
const postingDate = localData.selectedDayOfMonth ??
|
|
104
|
-
(localData.lastDayOfMonth === true ? timePeriod_2.LAST_SCHEDULE_DAY_OF_MONTH : null);
|
|
105
|
-
const firstJEScheduleDate = jeScheduleDetails.length > 0
|
|
106
|
-
? jeScheduleDetails[0].postingDate.format(timePeriod_1.DEFAULT_DATE_FORMAT)
|
|
107
|
-
: null;
|
|
108
|
-
const lastJEScheduleDate = jeScheduleDetails.length > 0
|
|
109
|
-
? jeScheduleDetails[jeScheduleDetails.length - 1].postingDate.format(timePeriod_1.DEFAULT_DATE_FORMAT)
|
|
110
|
-
: null;
|
|
111
|
-
const isFixedAssets = scheduleType === 'fixed_assets';
|
|
112
|
-
const assetId = 'assetId' in localData ? localData.assetId : undefined;
|
|
113
|
-
const selectedAccumulatedDepreciationCategory = 'selectedAccumulatedDepreciationCategory' in localData
|
|
114
|
-
? localData.selectedAccumulatedDepreciationCategory
|
|
115
|
-
: undefined;
|
|
116
|
-
const status = { code: 'new', label: 'New' };
|
|
117
|
-
const jeSchedulePayload = {
|
|
118
|
-
status,
|
|
119
|
-
vendor,
|
|
120
|
-
currency_code: scheduleTransaction.currency.currencyCode,
|
|
121
|
-
currency_symbol: scheduleTransaction.currency.currencySymbol,
|
|
122
|
-
period: localData.selectedMonths ?? null,
|
|
123
|
-
je_schedule_type: scheduleType,
|
|
124
|
-
posting_date: postingDate,
|
|
125
|
-
balance: scheduleTransaction.amount.amount,
|
|
126
|
-
start_date: firstJEScheduleDate,
|
|
127
|
-
end_date: lastJEScheduleDate,
|
|
128
|
-
je_credit_accounting_class_id: scheduleTransaction.classBase?.classId ?? null,
|
|
129
|
-
je_credit_account_id: isFixedAssets
|
|
130
|
-
? (selectedAccumulatedDepreciationCategory ?? null)
|
|
131
|
-
: scheduleTransaction.account.accountId,
|
|
132
|
-
je_debit_account_id: localData.selectedAccount ?? null,
|
|
133
|
-
je_debit_accounting_class_id: localData.selectedClass ?? null,
|
|
134
|
-
other_attributes: assetId != null ? { asset_id: assetId } : {},
|
|
135
|
-
base_transaction: (0, scheduleDetailPayload_1.mapScheduleTransactionToBaseScheduleTransactionPayload)(scheduleTransaction),
|
|
136
|
-
};
|
|
137
|
-
return {
|
|
138
|
-
ok: true,
|
|
139
|
-
payload: {
|
|
140
|
-
je_schedules: [jeSchedulePayload],
|
|
141
|
-
scheduled_journal_entries: mapNewJeDetailsToScheduledJournalEntryPayload(jeScheduleDetails),
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
exports.prepareNewSchedulePayload = prepareNewSchedulePayload;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
|
-
import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
-
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
4
|
-
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
-
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
|
-
import { ClassBase } from '../../../entity/class/classState';
|
|
7
|
-
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
|
-
import { ScheduleTransaction } from '../../../entity/transaction/stateTypes/scheduleTransaction';
|
|
9
|
-
import { NewScheduleLocalData, NewScheduleLocalDataFixedAssets } from '../types/jeSchedulesViewState';
|
|
10
|
-
export interface NewScheduleSearchTransactionsView {
|
|
11
|
-
searchTransactionsFetchState: FetchStateAndError;
|
|
12
|
-
searchTransactionsResults: ScheduleTransaction[];
|
|
13
|
-
searchTransactionsString?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Accounts and request status for both accrual creation forms — the one-time accrual and the
|
|
17
|
-
* recurring accrued schedule. Deliberately not NewScheduleView: neither has a base transaction to
|
|
18
|
-
* search, and both need a second account hierarchy (the accrued liability) that no schedule type
|
|
19
|
-
* has. A one-time accrual additionally has no local-data slot in newScheduleState, since it is not
|
|
20
|
-
* a schedule type at all.
|
|
21
|
-
*/
|
|
22
|
-
export interface NewAccrualAccountsView {
|
|
23
|
-
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
24
|
-
accruedAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
25
|
-
accruedScheduleSaveStatus: FetchStateAndError;
|
|
26
|
-
allAccountList: AccountBase[];
|
|
27
|
-
allAccruedExpenseList: AccountBase[];
|
|
28
|
-
allClassList: ClassBase[];
|
|
29
|
-
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
30
|
-
createStatus: FetchStateAndError;
|
|
31
|
-
}
|
|
32
|
-
export interface NewScheduleView extends SelectorView, NewScheduleSearchTransactionsView {
|
|
33
|
-
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
34
|
-
allAccountList: AccountBase[];
|
|
35
|
-
allClassList: ClassBase[];
|
|
36
|
-
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
37
|
-
newScheduleLocalData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets;
|
|
38
|
-
saveStatus: FetchStateAndError;
|
|
39
|
-
scheduleType: ScheduleTypes;
|
|
40
|
-
allDepreciationAccountList?: AccountBase[];
|
|
41
|
-
allDepreciationAccountListNestedAccountHierarchy?: NestedAccountHierarchyForReport[];
|
|
42
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../reducer';
|
|
2
|
-
import { NewAccrualAccountsView, NewScheduleSearchTransactionsView, NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
3
|
-
/**
|
|
4
|
-
* The Base Transaction search is shared across schedule types (one search
|
|
5
|
-
* box, not one per prepaid_expenses/fixed_assets) — split out from
|
|
6
|
-
* getNewScheduleView so a consumer can read it without supplying an
|
|
7
|
-
* otherwise-irrelevant scheduleType.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getNewScheduleSearchTransactionsView: (state: RootState) => NewScheduleSearchTransactionsView;
|
|
10
|
-
/**
|
|
11
|
-
* Account + class options and request status shared by both accrual creation forms — the one-time
|
|
12
|
-
* accrual and the recurring accrued schedule.
|
|
13
|
-
*
|
|
14
|
-
* getAccountsTypesForScheduleDetails('accrued_expenses') deliberately includes
|
|
15
|
-
* other_current_liabilities, because the accrued liability accounts live there —
|
|
16
|
-
* so the debit list has to subtract them back out, and the credit list keeps only
|
|
17
|
-
* them. Mirrors getScheduleAccruedDetailView, which is the form this one is
|
|
18
|
-
* modelled on.
|
|
19
|
-
*/
|
|
20
|
-
export declare const getNewAccrualAccountsView: (state: RootState) => NewAccrualAccountsView;
|
|
21
|
-
export declare const getNewScheduleView: (state: RootState, scheduleType: "fixed_assets" | "prepaid_expenses") => NewScheduleView;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNewScheduleView = exports.getNewAccrualAccountsView = exports.getNewScheduleSearchTransactionsView = void 0;
|
|
4
|
-
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
5
|
-
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
6
|
-
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
7
|
-
const classListSelector_1 = require("../../classList/classListSelector");
|
|
8
|
-
const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper");
|
|
9
|
-
const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailSelector");
|
|
10
|
-
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
11
|
-
/**
|
|
12
|
-
* The Base Transaction search is shared across schedule types (one search
|
|
13
|
-
* box, not one per prepaid_expenses/fixed_assets) — split out from
|
|
14
|
-
* getNewScheduleView so a consumer can read it without supplying an
|
|
15
|
-
* otherwise-irrelevant scheduleType.
|
|
16
|
-
*/
|
|
17
|
-
const getNewScheduleSearchTransactionsView = (state) => {
|
|
18
|
-
const { searchTransactions } = state.expenseAutomationJESchedulesViewState.newSchedule;
|
|
19
|
-
const searchTransactionsResults = searchTransactions.searchResults
|
|
20
|
-
.map((key) => (0, transactionSelector_1.getScheduleTransactionById)(state.transactionState, key))
|
|
21
|
-
.filter((transaction) => transaction != null);
|
|
22
|
-
return {
|
|
23
|
-
searchTransactionsResults,
|
|
24
|
-
searchTransactionsFetchState: {
|
|
25
|
-
fetchState: searchTransactions.fetchState,
|
|
26
|
-
error: searchTransactions.error,
|
|
27
|
-
},
|
|
28
|
-
searchTransactionsString: searchTransactions.searchString,
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
exports.getNewScheduleSearchTransactionsView = getNewScheduleSearchTransactionsView;
|
|
32
|
-
const ACCRUED_EXPENSE_ACCOUNT_LABELS = ['accrued_expenses'];
|
|
33
|
-
/**
|
|
34
|
-
* Account + class options and request status shared by both accrual creation forms — the one-time
|
|
35
|
-
* accrual and the recurring accrued schedule.
|
|
36
|
-
*
|
|
37
|
-
* getAccountsTypesForScheduleDetails('accrued_expenses') deliberately includes
|
|
38
|
-
* other_current_liabilities, because the accrued liability accounts live there —
|
|
39
|
-
* so the debit list has to subtract them back out, and the credit list keeps only
|
|
40
|
-
* them. Mirrors getScheduleAccruedDetailView, which is the form this one is
|
|
41
|
-
* modelled on.
|
|
42
|
-
*/
|
|
43
|
-
const getNewAccrualAccountsView = (state) => {
|
|
44
|
-
const { accountState, accountListState, classState, classListState } = state;
|
|
45
|
-
const { newSchedule } = state.expenseAutomationJESchedulesViewState;
|
|
46
|
-
const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
|
|
47
|
-
const accrualAccountIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, (0, scheduleDetailLocalDataHelper_1.getAccountsTypesForScheduleDetails)('accrued_expenses'));
|
|
48
|
-
const accruedCategoryIds = (0, accountSelector_1.getAccountIdsForLabels)(accountState, ACCRUED_EXPENSE_ACCOUNT_LABELS);
|
|
49
|
-
const allAccountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, accountType.accountListKey);
|
|
50
|
-
const nestedAccountHierarchy = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey);
|
|
51
|
-
const debitAccounts = allAccountList.accounts.filter((account) => accrualAccountIds.includes(account.accountId) &&
|
|
52
|
-
!accruedCategoryIds.includes(account.accountId));
|
|
53
|
-
const creditAccounts = allAccountList.accounts.filter((account) => accruedCategoryIds.includes(account.accountId));
|
|
54
|
-
const allClassList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
55
|
-
return {
|
|
56
|
-
accountListNestedAccountHierarchy: (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)(nestedAccountHierarchy, debitAccounts.map((account) => account.accountId)),
|
|
57
|
-
accruedAccountListNestedAccountHierarchy: (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)(nestedAccountHierarchy, creditAccounts.map((account) => account.accountId)),
|
|
58
|
-
allAccountList: debitAccounts,
|
|
59
|
-
allAccruedExpenseList: creditAccounts,
|
|
60
|
-
allClassList: allClassList.classes,
|
|
61
|
-
classListNestedAccountHierarchy: (0, classListSelector_1.getNestedClassListHierarchy)(classListState),
|
|
62
|
-
createStatus: newSchedule.createOneTimeAccrualStatus,
|
|
63
|
-
// The recurring accrued schedule saves through the accrued detail epics that the Vendor tab
|
|
64
|
-
// already uses, so its status is that slice's updateStatus rather than anything new here.
|
|
65
|
-
accruedScheduleSaveStatus: state.scheduleAccruedDetailState.updateStatus,
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
exports.getNewAccrualAccountsView = getNewAccrualAccountsView;
|
|
69
|
-
const getNewScheduleView = (state, scheduleType) => {
|
|
70
|
-
const { accountState, accountListState, classState, classListState } = state;
|
|
71
|
-
const { newSchedule } = state.expenseAutomationJESchedulesViewState;
|
|
72
|
-
const searchTransactionsView = (0, exports.getNewScheduleSearchTransactionsView)(state);
|
|
73
|
-
const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
|
|
74
|
-
const newScheduleAccountTypes = (0, scheduleDetailLocalDataHelper_1.getAccountsTypesForScheduleDetails)(scheduleType);
|
|
75
|
-
const newScheduleAccountIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, newScheduleAccountTypes);
|
|
76
|
-
const allAccountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, accountType.accountListKey);
|
|
77
|
-
const filteredAccounts = allAccountList.accounts.filter((account) => newScheduleAccountIds.includes(account.accountId));
|
|
78
|
-
const accountListNestedAccountHierarchy = (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)((0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey), filteredAccounts.map((account) => account.accountId));
|
|
79
|
-
const allClassList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
80
|
-
const classListNestedAccountHierarchy = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
81
|
-
let allDepreciationAccountList;
|
|
82
|
-
let allDepreciationAccountListNestedAccountHierarchy;
|
|
83
|
-
if (scheduleType === 'fixed_assets') {
|
|
84
|
-
const depreciationCategoryIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, [
|
|
85
|
-
'fixed_assets',
|
|
86
|
-
'other_assets',
|
|
87
|
-
]);
|
|
88
|
-
const accountLabel = (0, scheduleListHelper_1.getAccountLabelForScheduleType)('fixed_assets');
|
|
89
|
-
const fixedAssetLabelAccountIds = accountLabel != null
|
|
90
|
-
? (0, accountListSelector_1.getAccountIdsForLabel)(accountListState, accountType.accountListKey, accountLabel)
|
|
91
|
-
: [];
|
|
92
|
-
allDepreciationAccountList = allAccountList.accounts.filter((account) => depreciationCategoryIds.includes(account.accountId) &&
|
|
93
|
-
!fixedAssetLabelAccountIds.includes(account.accountId));
|
|
94
|
-
allDepreciationAccountListNestedAccountHierarchy =
|
|
95
|
-
(0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)((0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey), allDepreciationAccountList.map((account) => account.accountId));
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
scheduleType,
|
|
99
|
-
accountListNestedAccountHierarchy,
|
|
100
|
-
allAccountList: filteredAccounts,
|
|
101
|
-
allClassList: allClassList.classes,
|
|
102
|
-
allDepreciationAccountList,
|
|
103
|
-
allDepreciationAccountListNestedAccountHierarchy,
|
|
104
|
-
classListNestedAccountHierarchy,
|
|
105
|
-
newScheduleLocalData: newSchedule.newScheduleState[scheduleType],
|
|
106
|
-
saveStatus: newSchedule.saveStatus,
|
|
107
|
-
...searchTransactionsView,
|
|
108
|
-
fetchState: newSchedule.fetchState,
|
|
109
|
-
error: newSchedule.error,
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
exports.getNewScheduleView = getNewScheduleView;
|
|
@@ -1,6 +0,0 @@
|
|
|
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>;
|
|
@@ -1,29 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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>;
|
|
@@ -1,19 +0,0 @@
|
|
|
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;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../rootStateTypes';
|
|
6
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
|
-
import { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, invoicingStripeConnectionFailure, saveInvoicingSettings, saveInvoicingSettingsFailure, saveInvoicingSettingsSuccess, updateInvoicingSettings, updateInvoicingSettingsFailure, updateInvoicingStripeConnection } from './settingsViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchInvoicingSettings> | ReturnType<typeof updateInvoicingSettings> | ReturnType<typeof updateInvoicingSettingsFailure> | ReturnType<typeof saveInvoicingSettings> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof connectInvoicingStripe> | ReturnType<typeof disconnectInvoicingStripe> | ReturnType<typeof updateInvoicingStripeConnection> | ReturnType<typeof invoicingStripeConnectionFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof openSnackbar>;
|
|
9
|
-
export declare const fetchInvoicingSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
10
|
-
export declare const connectInvoicingStripeEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
11
|
-
export declare const disconnectInvoicingStripeEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
12
|
-
export declare const saveInvoicingSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveInvoicingSettingsEpic = exports.disconnectInvoicingStripeEpic = exports.connectInvoicingStripeEpic = exports.fetchInvoicingSettingsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
|
-
const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
|
|
8
|
-
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
10
|
-
const settingsViewReducer_1 = require("./settingsViewReducer");
|
|
11
|
-
const fetchInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchInvoicingSettings.match), (0, operators_1.switchMap)(() => {
|
|
12
|
-
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings`;
|
|
13
|
-
return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
|
|
14
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
-
const address = response.data.address;
|
|
16
|
-
return [
|
|
17
|
-
...(address != null ? [(0, addressReducer_1.updateAddresses)([address])] : []),
|
|
18
|
-
(0, settingsViewReducer_1.updateInvoicingSettings)(response.data),
|
|
19
|
-
];
|
|
20
|
-
}
|
|
21
|
-
return (0, rxjs_1.of)((0, settingsViewReducer_1.updateInvoicingSettingsFailure)(response.status));
|
|
22
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.updateInvoicingSettingsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch settings REST API call errored out ' +
|
|
23
|
-
JSON.stringify(error))))));
|
|
24
|
-
}));
|
|
25
|
-
exports.fetchInvoicingSettingsEpic = fetchInvoicingSettingsEpic;
|
|
26
|
-
const connectInvoicingStripeEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.connectInvoicingStripe.match), (0, operators_1.mergeMap)((action) => {
|
|
27
|
-
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings/stripe-connect/setup`;
|
|
28
|
-
const { api_key, publishable_key, webhook_secret } = action.payload;
|
|
29
|
-
const body = {
|
|
30
|
-
api_key,
|
|
31
|
-
publishable_key,
|
|
32
|
-
...(webhook_secret != null && webhook_secret !== ''
|
|
33
|
-
? { webhook_secret }
|
|
34
|
-
: {}),
|
|
35
|
-
};
|
|
36
|
-
return zeniAPI
|
|
37
|
-
.postAndGetJSON(apiUrl, body)
|
|
38
|
-
.pipe((0, operators_1.switchMap)((response) => {
|
|
39
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
40
|
-
return (0, rxjs_1.of)((0, settingsViewReducer_1.updateInvoicingStripeConnection)({
|
|
41
|
-
stripe_connected: response.data.stripe_connected,
|
|
42
|
-
publishable_key: response.data.publishable_key,
|
|
43
|
-
}), (0, settingsViewReducer_1.fetchInvoicingSettings)());
|
|
44
|
-
}
|
|
45
|
-
return (0, rxjs_1.of)((0, settingsViewReducer_1.invoicingStripeConnectionFailure)(response.status));
|
|
46
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.invoicingStripeConnectionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Stripe connect setup REST API call errored out ' +
|
|
47
|
-
JSON.stringify(error))))));
|
|
48
|
-
}));
|
|
49
|
-
exports.connectInvoicingStripeEpic = connectInvoicingStripeEpic;
|
|
50
|
-
const disconnectInvoicingStripeEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.disconnectInvoicingStripe.match), (0, operators_1.mergeMap)(() => {
|
|
51
|
-
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings/stripe-connect/callback`;
|
|
52
|
-
return zeniAPI
|
|
53
|
-
.deleteAndGetJSON(apiUrl)
|
|
54
|
-
.pipe((0, operators_1.switchMap)((response) => {
|
|
55
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
56
|
-
return (0, rxjs_1.of)((0, settingsViewReducer_1.updateInvoicingStripeConnection)({
|
|
57
|
-
stripe_connected: false,
|
|
58
|
-
publishable_key: '',
|
|
59
|
-
}), (0, settingsViewReducer_1.fetchInvoicingSettings)());
|
|
60
|
-
}
|
|
61
|
-
return (0, rxjs_1.of)((0, settingsViewReducer_1.invoicingStripeConnectionFailure)(response.status));
|
|
62
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.invoicingStripeConnectionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Stripe disconnect REST API call errored out ' +
|
|
63
|
-
JSON.stringify(error))))));
|
|
64
|
-
}));
|
|
65
|
-
exports.disconnectInvoicingStripeEpic = disconnectInvoicingStripeEpic;
|
|
66
|
-
const saveInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.saveInvoicingSettings.match), (0, operators_1.mergeMap)((action) => {
|
|
67
|
-
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings`;
|
|
68
|
-
const { settings, snackbarSection } = action.payload;
|
|
69
|
-
/** `status` surfaces the platform's error text; omit it to keep the generic copy. */
|
|
70
|
-
const snackbar = (messageText, status) => snackbarSection == null
|
|
71
|
-
? []
|
|
72
|
-
: [
|
|
73
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
74
|
-
messageSection: snackbarSection,
|
|
75
|
-
messageText,
|
|
76
|
-
type: messageText === 'success' ? 'success' : 'error',
|
|
77
|
-
variables: (0, snackbarApiError_1.apiErrorSnackbarVariables)(status),
|
|
78
|
-
}),
|
|
79
|
-
];
|
|
80
|
-
return zeniAPI
|
|
81
|
-
.putAndGetJSON(apiUrl, { ...settings })
|
|
82
|
-
.pipe((0, operators_1.switchMap)((response) => {
|
|
83
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
84
|
-
return (0, rxjs_1.from)([
|
|
85
|
-
(0, settingsViewReducer_1.saveInvoicingSettingsSuccess)(response.data),
|
|
86
|
-
...snackbar('success'),
|
|
87
|
-
]);
|
|
88
|
-
}
|
|
89
|
-
return (0, rxjs_1.from)([
|
|
90
|
-
(0, settingsViewReducer_1.saveInvoicingSettingsFailure)(response.status),
|
|
91
|
-
...snackbar('failed', response.status),
|
|
92
|
-
]);
|
|
93
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
94
|
-
(0, settingsViewReducer_1.saveInvoicingSettingsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save settings REST API call errored out ' +
|
|
95
|
-
JSON.stringify(error))),
|
|
96
|
-
...snackbar('failed'),
|
|
97
|
-
])));
|
|
98
|
-
}));
|
|
99
|
-
exports.saveInvoicingSettingsEpic = saveInvoicingSettingsEpic;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
|
@@ -1,22 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
|
@@ -1,22 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}>;
|