@zeniai/client-epic-state 5.1.80 → 5.1.81-betaAK1
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/viewAndReport/reportIDHelper.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +13 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +3 -0
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +42 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +66 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +21 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +5 -1
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/epic.d.ts +9 -1
- package/lib/epic.js +14 -1
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +11 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +3 -0
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +61 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +21 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -0
- package/lib/esm/epic.js +14 -1
- package/lib/esm/index.js +19 -4
- package/lib/esm/reducer.js +12 -0
- package/lib/esm/view/dashboard/dashboardSelector.js +14 -10
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +4 -18
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +6 -1
- package/lib/esm/view/invoicing/createCreditNote/createCreditNotePayload.js +1 -8
- package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +33 -9
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +35 -9
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +4 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +10 -11
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +8 -10
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +43 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +2 -5
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +1 -2
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +7 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +3 -0
- 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/epics/fetchInvoicingQboConnectionEpic.js +15 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.js +15 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.js +1 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +26 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +18 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewPayload.js +47 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewReducer.js +128 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +20 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewState.js +1 -0
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNotePayload.js +4 -11
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +9 -12
- package/lib/esm/view/invoicing/recordPayment/recordPaymentFormConfig.js +0 -1
- package/lib/esm/view/invoicing/recordPayment/recordPaymentPayload.js +5 -14
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +26 -8
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeForTimeframeProjectViewEpic.js +45 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewEpic.js +30 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewPayload.js +1 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewReducer.js +111 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelector.js +65 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewState.js +1 -0
- package/lib/esm/view/opExProjectView/opExForTimeframeProjectViewEpic.js +43 -0
- package/lib/esm/view/opExProjectView/opExProjectViewEpic.js +30 -0
- package/lib/esm/view/opExProjectView/opExProjectViewPayload.js +1 -0
- package/lib/esm/view/opExProjectView/opExProjectViewReducer.js +111 -0
- package/lib/esm/view/opExProjectView/opExProjectViewSelector.js +52 -0
- package/lib/esm/view/opExProjectView/opExProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/opExProjectView/opExProjectViewState.js +1 -0
- package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
- package/lib/esm/view/reportsResync/reportsProjectViewRefetchingEpic.js +30 -0
- package/lib/esm/view/reportsResync/reportsResyncEpic.js +11 -3
- package/lib/esm/view/reportsResync/reportsResyncReducer.js +9 -1
- package/lib/esm/view/revenueProjectView/revenueForTimeframeProjectViewEpic.js +35 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewEpic.js +30 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewPayload.js +1 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewReducer.js +111 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewSelector.js +58 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewState.js +1 -0
- package/lib/index.d.ts +29 -5
- package/lib/index.js +106 -51
- package/lib/reducer.d.ts +12 -0
- package/lib/reducer.js +12 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/dashboard/dashboardSelector.d.ts +2 -3
- package/lib/view/dashboard/dashboardSelector.js +13 -9
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +3 -17
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +6 -1
- package/lib/view/invoicing/createCreditNote/createCreditNotePayload.js +1 -8
- package/lib/view/invoicing/createCreditNote/createCreditNoteState.d.ts +3 -1
- package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +2 -1
- package/lib/view/invoicing/discountAction/discountActionEpic.js +32 -8
- package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +2 -1
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +34 -8
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +4 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +10 -11
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +10 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +8 -10
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +2 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +3 -3
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +2 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.d.ts +9 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +45 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +2 -5
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +1 -2
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +4 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +6 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +4 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +3 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +4 -1
- 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/epics/fetchInvoicingQboConnectionEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboConnectionEpic.js +19 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.js +19 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +2 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.js +2 -0
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +30 -0
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +22 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewPayload.d.ts +79 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewPayload.js +52 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewReducer.d.ts +25 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewReducer.js +132 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +21 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +24 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewState.d.ts +14 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewState.js +2 -0
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.js +4 -11
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +15 -7
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +11 -15
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteState.d.ts +3 -2
- package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.js +0 -1
- package/lib/view/invoicing/recordPayment/recordPaymentPayload.js +5 -14
- package/lib/view/invoicing/recordPayment/recordPaymentState.d.ts +4 -2
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +2 -1
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +25 -7
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +10 -1
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeForTimeframeProjectViewEpic.js +49 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewEpic.d.ts +6 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewEpic.js +34 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewPayload.d.ts +11 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewPayload.js +2 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewReducer.d.ts +33 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewReducer.js +115 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelector.d.ts +13 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelector.js +69 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelectorTypes.d.ts +21 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelectorTypes.js +2 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewState.d.ts +20 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewState.js +2 -0
- package/lib/view/opExProjectView/opExForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/opExProjectView/opExForTimeframeProjectViewEpic.js +47 -0
- package/lib/view/opExProjectView/opExProjectViewEpic.d.ts +6 -0
- package/lib/view/opExProjectView/opExProjectViewEpic.js +34 -0
- package/lib/view/opExProjectView/opExProjectViewPayload.d.ts +6 -0
- package/lib/view/opExProjectView/opExProjectViewPayload.js +2 -0
- package/lib/view/opExProjectView/opExProjectViewReducer.d.ts +33 -0
- package/lib/view/opExProjectView/opExProjectViewReducer.js +115 -0
- package/lib/view/opExProjectView/opExProjectViewSelector.d.ts +12 -0
- package/lib/view/opExProjectView/opExProjectViewSelector.js +56 -0
- package/lib/view/opExProjectView/opExProjectViewSelectorTypes.d.ts +19 -0
- package/lib/view/opExProjectView/opExProjectViewSelectorTypes.js +2 -0
- package/lib/view/opExProjectView/opExProjectViewState.d.ts +20 -0
- package/lib/view/opExProjectView/opExProjectViewState.js +2 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +1 -2
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
- package/lib/view/reportsResync/reportsProjectViewRefetchingEpic.d.ts +10 -0
- package/lib/view/reportsResync/reportsProjectViewRefetchingEpic.js +34 -0
- package/lib/view/reportsResync/reportsResyncEpic.d.ts +2 -2
- package/lib/view/reportsResync/reportsResyncEpic.js +10 -2
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +5 -3
- package/lib/view/reportsResync/reportsResyncReducer.js +10 -2
- package/lib/view/revenueProjectView/revenueForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/revenueProjectView/revenueForTimeframeProjectViewEpic.js +39 -0
- package/lib/view/revenueProjectView/revenueProjectViewEpic.d.ts +6 -0
- package/lib/view/revenueProjectView/revenueProjectViewEpic.js +34 -0
- package/lib/view/revenueProjectView/revenueProjectViewPayload.d.ts +9 -0
- package/lib/view/revenueProjectView/revenueProjectViewPayload.js +2 -0
- package/lib/view/revenueProjectView/revenueProjectViewReducer.d.ts +33 -0
- package/lib/view/revenueProjectView/revenueProjectViewReducer.js +115 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelector.d.ts +12 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelector.js +62 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelectorTypes.d.ts +19 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelectorTypes.js +2 -0
- package/lib/view/revenueProjectView/revenueProjectViewState.d.ts +20 -0
- package/lib/view/revenueProjectView/revenueProjectViewState.js +2 -0
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/package.json +1 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.js +0 -44
- package/lib/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.d.ts +0 -5
- package/lib/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.js +0 -48
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { RootState } from '../../../reducer';
|
|
5
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
7
|
import { runInvoicingDiscountAction, runInvoicingDiscountActionFailure, runInvoicingDiscountActionSuccess } from './discountActionReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof runInvoicingDiscountAction> | ReturnType<typeof runInvoicingDiscountActionSuccess> | ReturnType<typeof runInvoicingDiscountActionFailure> | ReturnType<typeof updateInvoicingCoupons>;
|
|
8
|
+
export type ActionType = ReturnType<typeof runInvoicingDiscountAction> | ReturnType<typeof runInvoicingDiscountActionSuccess> | ReturnType<typeof runInvoicingDiscountActionFailure> | ReturnType<typeof updateInvoicingCoupons> | ReturnType<typeof openSnackbar>;
|
|
8
9
|
export declare const runInvoicingDiscountActionEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,11 +4,28 @@ exports.runInvoicingDiscountActionEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const couponReducer_1 = require("../../../entity/invoicing/coupon/couponReducer");
|
|
7
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
8
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
9
|
const discountActionReducer_1 = require("./discountActionReducer");
|
|
10
|
+
/** Snackbar copy per action kind; unlisted kinds run without one. */
|
|
11
|
+
const SNACKBAR_SECTION_BY_KIND = {
|
|
12
|
+
archive: 'invoicing_discount_archive',
|
|
13
|
+
delete: 'invoicing_discount_delete',
|
|
14
|
+
unarchive: 'invoicing_discount_unarchive',
|
|
15
|
+
};
|
|
9
16
|
const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(discountActionReducer_1.runInvoicingDiscountAction.match), (0, operators_1.mergeMap)((action) => {
|
|
10
17
|
const { action: kind, id } = action.payload;
|
|
11
18
|
const requestBody = { action: kind };
|
|
19
|
+
const snackbarSection = SNACKBAR_SECTION_BY_KIND[kind];
|
|
20
|
+
const snackbar = (messageText) => snackbarSection == null
|
|
21
|
+
? []
|
|
22
|
+
: [
|
|
23
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
24
|
+
messageSection: snackbarSection,
|
|
25
|
+
messageText,
|
|
26
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
27
|
+
}),
|
|
28
|
+
];
|
|
12
29
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/discounts/${encodeURIComponent(id)}/actions`;
|
|
13
30
|
return zeniAPI
|
|
14
31
|
.postAndGetJSON(apiUrl, requestBody)
|
|
@@ -17,16 +34,23 @@ const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => actions$.
|
|
|
17
34
|
return [
|
|
18
35
|
(0, couponReducer_1.updateInvoicingCoupons)([response.data], 'merge'),
|
|
19
36
|
(0, discountActionReducer_1.runInvoicingDiscountActionSuccess)({ id }),
|
|
37
|
+
...snackbar('success'),
|
|
20
38
|
];
|
|
21
39
|
}
|
|
22
|
-
return (0, rxjs_1.
|
|
23
|
-
|
|
40
|
+
return (0, rxjs_1.from)([
|
|
41
|
+
(0, discountActionReducer_1.runInvoicingDiscountActionFailure)({
|
|
42
|
+
error: response.status,
|
|
43
|
+
id,
|
|
44
|
+
}),
|
|
45
|
+
...snackbar('failed'),
|
|
46
|
+
]);
|
|
47
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
48
|
+
(0, discountActionReducer_1.runInvoicingDiscountActionFailure)({
|
|
49
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Discount action REST API call errored out ' +
|
|
50
|
+
JSON.stringify(error)),
|
|
24
51
|
id,
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
JSON.stringify(error)),
|
|
29
|
-
id,
|
|
30
|
-
}))));
|
|
52
|
+
}),
|
|
53
|
+
...snackbar('failed'),
|
|
54
|
+
])));
|
|
31
55
|
}));
|
|
32
56
|
exports.runInvoicingDiscountActionEpic = runInvoicingDiscountActionEpic;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateInvoicingDunningCases } from '../../../entity/invoicing/dunningCase/dunningCaseReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { RootState } from '../../../reducer';
|
|
5
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
7
|
import { runInvoicingDunningAction, runInvoicingDunningActionFailure, runInvoicingDunningActionSuccess } from './dunningActionReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof runInvoicingDunningAction> | ReturnType<typeof runInvoicingDunningActionSuccess> | ReturnType<typeof runInvoicingDunningActionFailure> | ReturnType<typeof updateInvoicingDunningCases>;
|
|
8
|
+
export type ActionType = ReturnType<typeof runInvoicingDunningAction> | ReturnType<typeof runInvoicingDunningActionSuccess> | ReturnType<typeof runInvoicingDunningActionFailure> | ReturnType<typeof updateInvoicingDunningCases> | ReturnType<typeof openSnackbar>;
|
|
8
9
|
export declare const runInvoicingDunningActionEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,10 +4,29 @@ exports.runInvoicingDunningActionEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const dunningCaseReducer_1 = require("../../../entity/invoicing/dunningCase/dunningCaseReducer");
|
|
7
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
8
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
9
|
const dunningActionReducer_1 = require("./dunningActionReducer");
|
|
10
|
+
/**
|
|
11
|
+
* Snackbar copy is per action kind; anything not listed here runs without one.
|
|
12
|
+
*/
|
|
13
|
+
const SNACKBAR_SECTION_BY_KIND = {
|
|
14
|
+
cancel: 'invoicing_dunning_cancel',
|
|
15
|
+
resolve: 'invoicing_dunning_case_resolved',
|
|
16
|
+
retry: 'invoicing_dunning_retry',
|
|
17
|
+
};
|
|
9
18
|
const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(dunningActionReducer_1.runInvoicingDunningAction.match), (0, operators_1.mergeMap)((action) => {
|
|
10
19
|
const { action: kind, body, id } = action.payload;
|
|
20
|
+
const snackbarSection = SNACKBAR_SECTION_BY_KIND[kind];
|
|
21
|
+
const snackbar = (messageText) => snackbarSection == null
|
|
22
|
+
? []
|
|
23
|
+
: [
|
|
24
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
25
|
+
messageSection: snackbarSection,
|
|
26
|
+
messageText,
|
|
27
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
28
|
+
}),
|
|
29
|
+
];
|
|
11
30
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/dunning/${encodeURIComponent(id)}/${kind}`;
|
|
12
31
|
return zeniAPI
|
|
13
32
|
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
@@ -16,16 +35,23 @@ const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
16
35
|
return [
|
|
17
36
|
(0, dunningCaseReducer_1.updateInvoicingDunningCases)([response.data], 'merge'),
|
|
18
37
|
(0, dunningActionReducer_1.runInvoicingDunningActionSuccess)({ id }),
|
|
38
|
+
...snackbar('success'),
|
|
19
39
|
];
|
|
20
40
|
}
|
|
21
|
-
return (0, rxjs_1.
|
|
22
|
-
|
|
41
|
+
return (0, rxjs_1.from)([
|
|
42
|
+
(0, dunningActionReducer_1.runInvoicingDunningActionFailure)({
|
|
43
|
+
error: response.status,
|
|
44
|
+
id,
|
|
45
|
+
}),
|
|
46
|
+
...snackbar('failed'),
|
|
47
|
+
]);
|
|
48
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
49
|
+
(0, dunningActionReducer_1.runInvoicingDunningActionFailure)({
|
|
50
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Dunning action REST API call errored out ' +
|
|
51
|
+
JSON.stringify(error)),
|
|
23
52
|
id,
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
JSON.stringify(error)),
|
|
28
|
-
id,
|
|
29
|
-
}))));
|
|
53
|
+
}),
|
|
54
|
+
...snackbar('failed'),
|
|
55
|
+
])));
|
|
30
56
|
}));
|
|
31
57
|
exports.runInvoicingDunningActionEpic = runInvoicingDunningActionEpic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
1
2
|
import type { InvoicingPlan } from '../../../entity/invoicing/plan/planState';
|
|
2
3
|
import type { InvoicingProduct } from '../../../entity/invoicing/product/productState';
|
|
3
4
|
import type { InvoicingCatalogItemFormSubFamily } from './editInvoicingCatalogItemDetailViewState';
|
|
@@ -39,12 +40,12 @@ export interface CreateSubFamilyFormValues {
|
|
|
39
40
|
period: string;
|
|
40
41
|
periodUnit: string;
|
|
41
42
|
priceCode: string;
|
|
42
|
-
priceDollars: string;
|
|
43
43
|
pricingModel: string;
|
|
44
44
|
prorationType: string;
|
|
45
45
|
trialEndAction: string;
|
|
46
46
|
trialPeriod: string;
|
|
47
47
|
trialPeriodUnit: string;
|
|
48
|
+
priceDollars?: Amount;
|
|
48
49
|
}
|
|
49
50
|
/** Build POST /catalog/products body for Create sub-family. */
|
|
50
51
|
export declare const createSubFamilyFormToPayload: (itemId: string, itemType: string, values: CreateSubFamilyFormValues) => Record<string, unknown>;
|
|
@@ -35,7 +35,7 @@ const tierToPayload = (tier) => ({
|
|
|
35
35
|
package_size: hasValue(tier.packageSize)
|
|
36
36
|
? Number(tier.packageSize)
|
|
37
37
|
: undefined,
|
|
38
|
-
price:
|
|
38
|
+
price: tier.price?.amount ?? 0,
|
|
39
39
|
pricing_type: tier.pricingType,
|
|
40
40
|
starting_unit: Number(tier.startingUnit) || 1,
|
|
41
41
|
});
|
|
@@ -49,7 +49,7 @@ const subFamilyToProductUpdate = (subFamily, itemType) => {
|
|
|
49
49
|
is_taxable: subFamily.isTaxable,
|
|
50
50
|
period: hasValue(subFamily.period) ? Number(subFamily.period) : null,
|
|
51
51
|
period_unit: hasValue(subFamily.period) ? subFamily.periodUnit : null,
|
|
52
|
-
price: tiered ? 0 :
|
|
52
|
+
price: tiered ? 0 : (subFamily.priceDollars?.amount ?? 0),
|
|
53
53
|
pricing_model: subFamily.pricingModel,
|
|
54
54
|
show_description_in_quotes: subFamily.showDescriptionInQuotes,
|
|
55
55
|
tiers: tiered ? subFamily.tiers.map(tierToPayload) : [],
|
|
@@ -117,7 +117,6 @@ const catalogDetailEditValuesToSavePayload = (values, itemType = 'plan', origina
|
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
119
|
exports.catalogDetailEditValuesToSavePayload = catalogDetailEditValuesToSavePayload;
|
|
120
|
-
const toAmountValue = (value) => Number(value) || 0;
|
|
121
120
|
/** Build POST /catalog/products body for Create sub-family. */
|
|
122
121
|
const createSubFamilyFormToPayload = (itemId, itemType, values) => {
|
|
123
122
|
const name = values.name.trim();
|
|
@@ -128,7 +127,7 @@ const createSubFamilyFormToPayload = (itemId, itemType, values) => {
|
|
|
128
127
|
is_taxable: true,
|
|
129
128
|
item_id: itemId,
|
|
130
129
|
name,
|
|
131
|
-
price:
|
|
130
|
+
price: values.priceDollars?.amount ?? 0,
|
|
132
131
|
price_code: priceCode,
|
|
133
132
|
pricing_model: values.pricingModel || 'flat_fee',
|
|
134
133
|
show_description_in_invoices: true,
|
|
@@ -168,7 +167,7 @@ const productToCreateSubFamilyFormValues = (product) => ({
|
|
|
168
167
|
period: product?.period != null ? String(product.period) : '1',
|
|
169
168
|
periodUnit: product?.periodUnit ?? 'month',
|
|
170
169
|
priceCode: '',
|
|
171
|
-
priceDollars: product?.price
|
|
170
|
+
priceDollars: product?.price,
|
|
172
171
|
pricingModel: product?.pricingModel ?? 'flat_fee',
|
|
173
172
|
prorationType: product?.prorationType ?? 'site_default',
|
|
174
173
|
trialEndAction: product?.trialEndAction ?? 'site_default',
|
|
@@ -10,17 +10,16 @@ const toProductCode = (value) => value
|
|
|
10
10
|
.toLowerCase()
|
|
11
11
|
.replace(/[^a-z0-9]+/g, '-')
|
|
12
12
|
.replace(/^-|-$/g, '');
|
|
13
|
-
const
|
|
14
|
-
const buildAccountingDetail = (localData) => {
|
|
13
|
+
const buildAccountingDetail = (subFamily) => {
|
|
15
14
|
const detail = {};
|
|
16
|
-
if (
|
|
17
|
-
detail.sku =
|
|
15
|
+
if (subFamily.sku.trim() !== '') {
|
|
16
|
+
detail.sku = subFamily.sku.trim();
|
|
18
17
|
}
|
|
19
|
-
if (
|
|
20
|
-
detail.accounting_code =
|
|
18
|
+
if (subFamily.accountingCode.trim() !== '') {
|
|
19
|
+
detail.accounting_code = subFamily.accountingCode.trim();
|
|
21
20
|
}
|
|
22
|
-
if (
|
|
23
|
-
detail.accounting_category_1 =
|
|
21
|
+
if (subFamily.accountingCategory.trim() !== '') {
|
|
22
|
+
detail.accounting_category_1 = subFamily.accountingCategory.trim();
|
|
24
23
|
}
|
|
25
24
|
return Object.keys(detail).length > 0 ? detail : undefined;
|
|
26
25
|
};
|
|
@@ -34,7 +33,7 @@ const buildSubFamilyPayload = (localData, subFamily, clearEmptyValues) => {
|
|
|
34
33
|
free_quantity: Number(subFamily.freeQuantity) || 0,
|
|
35
34
|
is_taxable: subFamily.isTaxable,
|
|
36
35
|
name,
|
|
37
|
-
price: tiered ? 0 :
|
|
36
|
+
price: tiered ? 0 : (subFamily.priceDollars?.amount ?? 0),
|
|
38
37
|
price_code: priceCode,
|
|
39
38
|
pricing_model: subFamily.pricingModel,
|
|
40
39
|
show_description_in_invoices: subFamily.showDescriptionInInvoices,
|
|
@@ -73,12 +72,12 @@ const buildSubFamilyPayload = (localData, subFamily, clearEmptyValues) => {
|
|
|
73
72
|
payload.tiers = subFamily.tiers.map((tier) => ({
|
|
74
73
|
ending_unit: tier.endingUnit.trim() !== '' ? Number(tier.endingUnit) : undefined,
|
|
75
74
|
package_size: tier.packageSize.trim() !== '' ? Number(tier.packageSize) : undefined,
|
|
76
|
-
price:
|
|
75
|
+
price: tier.price?.amount ?? 0,
|
|
77
76
|
pricing_type: tier.pricingType,
|
|
78
77
|
starting_unit: Number(tier.startingUnit) || 1,
|
|
79
78
|
}));
|
|
80
79
|
}
|
|
81
|
-
const accountingDetail = buildAccountingDetail(
|
|
80
|
+
const accountingDetail = buildAccountingDetail(subFamily);
|
|
82
81
|
if (accountingDetail != null) {
|
|
83
82
|
payload.accounting_detail = accountingDetail;
|
|
84
83
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
1
2
|
import { FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
3
|
import { InvoicingCatalogItemKind } from '../invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState';
|
|
3
4
|
/** A single pricing tier within a sub-family (values kept as raw strings). */
|
|
4
5
|
export interface InvoicingCatalogItemFormTier {
|
|
5
6
|
endingUnit: string;
|
|
6
7
|
packageSize: string;
|
|
7
|
-
price: string;
|
|
8
8
|
pricingType: string;
|
|
9
9
|
startingUnit: string;
|
|
10
|
+
/** Unset until entered, so a blank field is distinguishable from a real 0. */
|
|
11
|
+
price?: Amount;
|
|
10
12
|
}
|
|
11
13
|
/** A sub-family (price point) of a catalog item. */
|
|
12
14
|
export interface InvoicingCatalogItemFormSubFamily {
|
|
15
|
+
/** Accounting integration is per sub-family: the API carries
|
|
16
|
+
* `accounting_detail` on each product, not on the parent item. */
|
|
17
|
+
accountingCategory: string;
|
|
18
|
+
accountingCode: string;
|
|
13
19
|
billingCycles: string;
|
|
14
20
|
description: string;
|
|
15
21
|
freeQuantity: string;
|
|
@@ -20,15 +26,17 @@ export interface InvoicingCatalogItemFormSubFamily {
|
|
|
20
26
|
period: string;
|
|
21
27
|
periodUnit: string;
|
|
22
28
|
priceCode: string;
|
|
23
|
-
priceDollars: string;
|
|
24
29
|
pricingModel: string;
|
|
25
30
|
prorationType: string;
|
|
26
31
|
showDescriptionInInvoices: boolean;
|
|
27
32
|
showDescriptionInQuotes: boolean;
|
|
33
|
+
sku: string;
|
|
28
34
|
tiers: InvoicingCatalogItemFormTier[];
|
|
29
35
|
trialEndAction: string;
|
|
30
36
|
trialPeriod: string;
|
|
31
37
|
trialPeriodUnit: string;
|
|
38
|
+
/** Unset until entered, so a blank field is distinguishable from a real 0. */
|
|
39
|
+
priceDollars?: Amount;
|
|
32
40
|
}
|
|
33
41
|
/**
|
|
34
42
|
* Draft form state for the create/edit catalog item (plan / add-on / one-time
|
|
@@ -37,8 +45,6 @@ export interface InvoicingCatalogItemFormSubFamily {
|
|
|
37
45
|
* every type is persisted as a parent catalog item through `/catalog/plans`.
|
|
38
46
|
*/
|
|
39
47
|
export interface InvoicingCatalogItemFormLocalData {
|
|
40
|
-
accountingCategory: string;
|
|
41
|
-
accountingCode: string;
|
|
42
48
|
applicableItems: string[];
|
|
43
49
|
catalogType: string;
|
|
44
50
|
description: string;
|
|
@@ -46,7 +52,6 @@ export interface InvoicingCatalogItemFormLocalData {
|
|
|
46
52
|
itemApplicability: string;
|
|
47
53
|
name: string;
|
|
48
54
|
productCode: string;
|
|
49
|
-
sku: string;
|
|
50
55
|
subFamilies: InvoicingCatalogItemFormSubFamily[];
|
|
51
56
|
unit: string;
|
|
52
57
|
}
|
package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js
CHANGED
|
@@ -48,12 +48,13 @@ exports.isTieredCatalogPricingModel = isTieredCatalogPricingModel;
|
|
|
48
48
|
const blankInvoicingCatalogTier = (startingUnit = '1') => ({
|
|
49
49
|
endingUnit: '',
|
|
50
50
|
packageSize: '',
|
|
51
|
-
price: '',
|
|
52
51
|
pricingType: 'per_unit',
|
|
53
52
|
startingUnit,
|
|
54
53
|
});
|
|
55
54
|
exports.blankInvoicingCatalogTier = blankInvoicingCatalogTier;
|
|
56
55
|
const blankInvoicingCatalogSubFamily = () => ({
|
|
56
|
+
accountingCategory: '',
|
|
57
|
+
accountingCode: '',
|
|
57
58
|
billingCycles: '',
|
|
58
59
|
description: '',
|
|
59
60
|
freeQuantity: '0',
|
|
@@ -63,12 +64,12 @@ const blankInvoicingCatalogSubFamily = () => ({
|
|
|
63
64
|
name: '',
|
|
64
65
|
period: '1',
|
|
65
66
|
periodUnit: 'month',
|
|
66
|
-
priceDollars: '',
|
|
67
67
|
priceCode: '',
|
|
68
68
|
pricingModel: 'flat_fee',
|
|
69
69
|
prorationType: 'site_default',
|
|
70
70
|
showDescriptionInInvoices: true,
|
|
71
71
|
showDescriptionInQuotes: true,
|
|
72
|
+
sku: '',
|
|
72
73
|
tiers: [(0, exports.blankInvoicingCatalogTier)('1')],
|
|
73
74
|
trialEndAction: 'site_default',
|
|
74
75
|
trialPeriod: '',
|
|
@@ -82,7 +83,10 @@ const invoicingProductToCatalogItemFormSubFamily = (product) => {
|
|
|
82
83
|
}
|
|
83
84
|
return {
|
|
84
85
|
...base,
|
|
86
|
+
accountingCategory: product.accountingDetail?.accountingCategory1 ?? '',
|
|
87
|
+
accountingCode: product.accountingDetail?.accountingCode ?? '',
|
|
85
88
|
billingCycles: product.billingCycles != null ? String(product.billingCycles) : '',
|
|
89
|
+
sku: product.accountingDetail?.sku ?? '',
|
|
86
90
|
description: product.description ?? '',
|
|
87
91
|
freeQuantity: product.freeQuantity != null ? String(product.freeQuantity) : '0',
|
|
88
92
|
id: product.id,
|
|
@@ -91,7 +95,7 @@ const invoicingProductToCatalogItemFormSubFamily = (product) => {
|
|
|
91
95
|
name: product.name ?? '',
|
|
92
96
|
period: product.period != null ? String(product.period) : '1',
|
|
93
97
|
periodUnit: product.periodUnit ?? 'month',
|
|
94
|
-
priceDollars: product.price
|
|
98
|
+
priceDollars: product.price,
|
|
95
99
|
priceCode: product.priceCode ?? '',
|
|
96
100
|
pricingModel: product.pricingModel ?? 'flat_fee',
|
|
97
101
|
prorationType: product.prorationType ?? 'site_default',
|
|
@@ -101,7 +105,7 @@ const invoicingProductToCatalogItemFormSubFamily = (product) => {
|
|
|
101
105
|
? product.tiers.map((tier) => ({
|
|
102
106
|
endingUnit: tier.endingUnit != null ? String(tier.endingUnit) : '',
|
|
103
107
|
packageSize: tier.packageSize != null ? String(tier.packageSize) : '',
|
|
104
|
-
price:
|
|
108
|
+
price: tier.price,
|
|
105
109
|
pricingType: tier.pricingType ?? 'per_unit',
|
|
106
110
|
startingUnit: String(tier.startingUnit ?? 1),
|
|
107
111
|
}))
|
|
@@ -113,8 +117,6 @@ const invoicingProductToCatalogItemFormSubFamily = (product) => {
|
|
|
113
117
|
};
|
|
114
118
|
exports.invoicingProductToCatalogItemFormSubFamily = invoicingProductToCatalogItemFormSubFamily;
|
|
115
119
|
exports.initialInvoicingCatalogItemFormLocalData = {
|
|
116
|
-
accountingCategory: '',
|
|
117
|
-
accountingCode: '',
|
|
118
120
|
applicableItems: [],
|
|
119
121
|
catalogType: 'plan',
|
|
120
122
|
description: '',
|
|
@@ -122,7 +124,6 @@ exports.initialInvoicingCatalogItemFormLocalData = {
|
|
|
122
124
|
itemApplicability: 'all',
|
|
123
125
|
name: '',
|
|
124
126
|
productCode: '',
|
|
125
|
-
sku: '',
|
|
126
127
|
subFamilies: [(0, exports.blankInvoicingCatalogSubFamily)()],
|
|
127
128
|
unit: '',
|
|
128
129
|
};
|
|
@@ -143,8 +144,6 @@ const entityToInvoicingCatalogItemFormLocalData = (item) => {
|
|
|
143
144
|
? 'addon'
|
|
144
145
|
: 'plan';
|
|
145
146
|
return {
|
|
146
|
-
accountingCategory: plan.subFamilies?.[0]?.accountingDetail?.accountingCategory1 ?? '',
|
|
147
|
-
accountingCode: plan.subFamilies?.[0]?.accountingDetail?.accountingCode ?? '',
|
|
148
147
|
applicableItems: item.applicableItems ?? [],
|
|
149
148
|
catalogType,
|
|
150
149
|
description: item.description ?? '',
|
|
@@ -152,7 +151,6 @@ const entityToInvoicingCatalogItemFormLocalData = (item) => {
|
|
|
152
151
|
itemApplicability: item.itemApplicability ?? 'all',
|
|
153
152
|
name: item.name ?? '',
|
|
154
153
|
productCode: item.productCode ?? '',
|
|
155
|
-
sku: plan.subFamilies?.[0]?.accountingDetail?.sku ?? '',
|
|
156
154
|
subFamilies: plan?.subFamilies != null && plan.subFamilies.length > 0
|
|
157
155
|
? plan.subFamilies.map(exports.invoicingProductToCatalogItemFormSubFamily)
|
|
158
156
|
: [(0, exports.invoicingProductToCatalogItemFormSubFamily)()],
|
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js
CHANGED
|
@@ -25,8 +25,8 @@ const localDataToSaveInvoicingCouponPayload = (localData, isCreate) => {
|
|
|
25
25
|
data.discount_percentage = Number(localData.discountPercentage);
|
|
26
26
|
}
|
|
27
27
|
if (localData.discountType === 'fixed_amount') {
|
|
28
|
-
if (localData.discountAmount
|
|
29
|
-
data.discount_amount =
|
|
28
|
+
if (localData.discountAmount != null) {
|
|
29
|
+
data.discount_amount = localData.discountAmount.amount;
|
|
30
30
|
}
|
|
31
31
|
data.currency_code = 'USD';
|
|
32
32
|
}
|
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js
CHANGED
|
@@ -3,12 +3,12 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.resetEditInvoicingCouponDetailView = exports.submitInvoicingCouponFormFailure = exports.submitInvoicingCouponFormSuccess = exports.saveInvoicingCoupon = exports.submitInvoicingCouponForm = exports.updateInvoicingCouponFormDraft = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const
|
|
6
|
+
const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetailViewState");
|
|
7
7
|
exports.initialState = {
|
|
8
8
|
fetchState: 'Not-Started',
|
|
9
9
|
error: undefined,
|
|
10
10
|
editDraftById: {},
|
|
11
|
-
newCouponDraft: { ...
|
|
11
|
+
newCouponDraft: { ...editInvoicingCouponDetailViewState_1.initialInvoicingCouponFormLocalData },
|
|
12
12
|
savedCouponId: undefined,
|
|
13
13
|
hasValidState() {
|
|
14
14
|
return this.fetchState === 'Completed';
|
|
@@ -61,7 +61,7 @@ const editInvoicingCouponDetailView = (0, toolkit_1.createSlice)({
|
|
|
61
61
|
draft.error = undefined;
|
|
62
62
|
draft.savedCouponId = undefined;
|
|
63
63
|
draft.editDraftById = {};
|
|
64
|
-
draft.newCouponDraft = { ...
|
|
64
|
+
draft.newCouponDraft = { ...editInvoicingCouponDetailViewState_1.initialInvoicingCouponFormLocalData };
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
});
|
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getInvoicingCouponFormView = exports.getEditInvoicingCouponDetailViewState = void 0;
|
|
4
4
|
const couponConstants_1 = require("../../../entity/invoicing/coupon/couponConstants");
|
|
5
5
|
const couponSelector_1 = require("../../../entity/invoicing/coupon/couponSelector");
|
|
6
|
-
const
|
|
6
|
+
const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetailViewState");
|
|
7
7
|
/**
|
|
8
8
|
* Bundled view for the discount create/edit form: the save fetch state/error,
|
|
9
9
|
* the id of the coupon last saved, and — when a `couponId` is passed (edit
|
|
@@ -33,7 +33,7 @@ const getInvoicingCouponFormView = (state, couponId) => {
|
|
|
33
33
|
const { editDraftById, newCouponDraft } = state.editInvoicingCouponDetailViewState;
|
|
34
34
|
const localData = couponId != null
|
|
35
35
|
? (editDraftById[couponId] ??
|
|
36
|
-
(0,
|
|
36
|
+
(0, editInvoicingCouponDetailViewState_1.entityToInvoicingCouponFormLocalData)(base.coupon))
|
|
37
37
|
: newCouponDraft;
|
|
38
38
|
return {
|
|
39
39
|
...base,
|
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
1
2
|
import { FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
|
+
import { InvoicingCoupon } from '../../../entity/invoicing/coupon/couponState';
|
|
2
4
|
/**
|
|
3
5
|
* Draft form state for the create/edit discount-coupon form. Held in CES so the
|
|
4
6
|
* form flows its data from here (mirrors the customer form pattern). Dates are
|
|
5
|
-
* stored as ISO `YYYY-MM-DD` strings;
|
|
7
|
+
* stored as ISO `YYYY-MM-DD` strings; the discount amount as an `Amount` (as on
|
|
8
|
+
* the coupon entity); remaining quantities as raw strings.
|
|
6
9
|
*/
|
|
7
10
|
export interface InvoicingCouponFormLocalData {
|
|
8
11
|
applyOn: string;
|
|
9
12
|
couponCode: string;
|
|
10
13
|
couponId: string;
|
|
11
|
-
discountAmount: string;
|
|
12
14
|
discountPercentage: string;
|
|
13
15
|
discountQuantity: string;
|
|
14
16
|
discountType: string;
|
|
@@ -21,9 +23,14 @@ export interface InvoicingCouponFormLocalData {
|
|
|
21
23
|
periodUnit: string;
|
|
22
24
|
validFrom: string;
|
|
23
25
|
validTill: string;
|
|
26
|
+
/** Unset until the user enters one, so an explicit 0 stays distinguishable. */
|
|
27
|
+
discountAmount?: Amount;
|
|
24
28
|
}
|
|
25
29
|
export interface EditInvoicingCouponDetailViewState extends FetchedState {
|
|
26
30
|
editDraftById: Record<ID, InvoicingCouponFormLocalData>;
|
|
27
31
|
newCouponDraft: InvoicingCouponFormLocalData;
|
|
28
32
|
savedCouponId?: ID;
|
|
29
33
|
}
|
|
34
|
+
export declare const initialInvoicingCouponFormLocalData: InvoicingCouponFormLocalData;
|
|
35
|
+
/** Seed the form draft from an existing coupon entity (edit mode). */
|
|
36
|
+
export declare const entityToInvoicingCouponFormLocalData: (coupon?: InvoicingCoupon) => InvoicingCouponFormLocalData;
|
package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js
CHANGED
|
@@ -1,2 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.entityToInvoicingCouponFormLocalData = exports.initialInvoicingCouponFormLocalData = void 0;
|
|
4
|
+
exports.initialInvoicingCouponFormLocalData = {
|
|
5
|
+
applyOn: 'invoice_amount',
|
|
6
|
+
couponCode: '',
|
|
7
|
+
couponId: '',
|
|
8
|
+
discountPercentage: '',
|
|
9
|
+
discountQuantity: '',
|
|
10
|
+
discountType: 'percentage',
|
|
11
|
+
durationType: 'one_time',
|
|
12
|
+
invoiceName: '',
|
|
13
|
+
invoiceNotes: '',
|
|
14
|
+
maxRedemptions: '',
|
|
15
|
+
name: '',
|
|
16
|
+
period: '',
|
|
17
|
+
periodUnit: 'month',
|
|
18
|
+
validFrom: '',
|
|
19
|
+
validTill: '',
|
|
20
|
+
};
|
|
21
|
+
/** Seed the form draft from an existing coupon entity (edit mode). */
|
|
22
|
+
const entityToInvoicingCouponFormLocalData = (coupon) => {
|
|
23
|
+
if (coupon == null) {
|
|
24
|
+
return { ...exports.initialInvoicingCouponFormLocalData };
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
applyOn: coupon.applyOn ?? 'invoice_amount',
|
|
28
|
+
couponCode: coupon.couponCode ?? '',
|
|
29
|
+
couponId: coupon.id ?? '',
|
|
30
|
+
discountAmount: coupon.discountAmount,
|
|
31
|
+
discountPercentage: coupon.discountPercentage != null
|
|
32
|
+
? String(coupon.discountPercentage)
|
|
33
|
+
: '',
|
|
34
|
+
discountQuantity: coupon.discountQuantity != null ? String(coupon.discountQuantity) : '',
|
|
35
|
+
discountType: coupon.discountType ?? 'percentage',
|
|
36
|
+
durationType: coupon.durationType ?? 'one_time',
|
|
37
|
+
invoiceName: coupon.invoiceName ?? '',
|
|
38
|
+
invoiceNotes: coupon.invoiceNotes ?? '',
|
|
39
|
+
maxRedemptions: coupon.maxRedemptions != null ? String(coupon.maxRedemptions) : '',
|
|
40
|
+
name: coupon.name ?? '',
|
|
41
|
+
period: coupon.period != null ? String(coupon.period) : '',
|
|
42
|
+
periodUnit: coupon.periodUnit ?? 'month',
|
|
43
|
+
validFrom: coupon.validFrom != null ? coupon.validFrom.format('YYYY-MM-DD') : '',
|
|
44
|
+
validTill: coupon.validTill != null ? coupon.validTill.format('YYYY-MM-DD') : '',
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
exports.entityToInvoicingCouponFormLocalData = entityToInvoicingCouponFormLocalData;
|
|
@@ -27,8 +27,7 @@ const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingAddress)
|
|
|
27
27
|
quantity: 1,
|
|
28
28
|
})),
|
|
29
29
|
];
|
|
30
|
-
const setupFee = localData.setupFee
|
|
31
|
-
const parsedSetupFee = Number.parseFloat(setupFee);
|
|
30
|
+
const setupFee = localData.setupFee?.amount;
|
|
32
31
|
const poNumber = localData.poNumber.trim();
|
|
33
32
|
const trialEnd = localData.trialEnd.trim();
|
|
34
33
|
return {
|
|
@@ -38,9 +37,7 @@ const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingAddress)
|
|
|
38
37
|
currency_code: localData.preferredCurrencyCode,
|
|
39
38
|
customer_id: localData.customerId,
|
|
40
39
|
subscription_items: items,
|
|
41
|
-
...(setupFee
|
|
42
|
-
? { setup_fee: parsedSetupFee }
|
|
43
|
-
: {}),
|
|
40
|
+
...(setupFee != null ? { setup_fee: setupFee } : {}),
|
|
44
41
|
...(poNumber !== '' ? { po_number: poNumber } : {}),
|
|
45
42
|
...(trialEnd !== '' ? { trial_end: trialEnd } : {}),
|
|
46
43
|
...(localData.couponId !== '' ? { coupon_ids: [localData.couponId] } : {}),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
1
2
|
import { FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
3
|
/**
|
|
3
4
|
* Draft form state for the create/edit subscription form. Held in CES so the
|
|
@@ -17,8 +18,9 @@ export interface InvoicingSubscriptionFormLocalData {
|
|
|
17
18
|
planQuantity: number;
|
|
18
19
|
poNumber: string;
|
|
19
20
|
preferredCurrencyCode: string;
|
|
20
|
-
setupFee: string;
|
|
21
21
|
trialEnd: string;
|
|
22
|
+
/** Unset until the user enters one, so an explicit 0 stays distinguishable. */
|
|
23
|
+
setupFee?: Amount;
|
|
22
24
|
}
|
|
23
25
|
export interface EditInvoicingSubscriptionDetailViewState extends FetchedState {
|
|
24
26
|
editDraftById: Record<ID, InvoicingSubscriptionFormLocalData>;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js
CHANGED
|
@@ -49,7 +49,6 @@ exports.initialInvoicingSubscriptionFormLocalData = {
|
|
|
49
49
|
planQuantity: 1,
|
|
50
50
|
poNumber: '',
|
|
51
51
|
preferredCurrencyCode: 'USD',
|
|
52
|
-
setupFee: '',
|
|
53
52
|
trialEnd: '',
|
|
54
53
|
};
|
|
55
54
|
/** Seed the form draft from an existing subscription entity (edit mode). */
|
|
@@ -71,7 +70,7 @@ const entityToInvoicingSubscriptionFormLocalData = (subscription) => {
|
|
|
71
70
|
planQuantity: planItem?.quantity ?? 1,
|
|
72
71
|
poNumber: subscription.poNumber ?? '',
|
|
73
72
|
preferredCurrencyCode: subscription.currencyCode ?? 'USD',
|
|
74
|
-
setupFee:
|
|
73
|
+
setupFee: subscription.setupFee,
|
|
75
74
|
trialEnd: subscription.trialEnd != null
|
|
76
75
|
? subscription.trialEnd.format('YYYY-MM-DD')
|
|
77
76
|
: '',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuditLogEntityRouteOptionWire, AuditLogListSortFieldOptionWire, AuditLogSourceLabelOptionWire, InvoicingCatalogLifecycleActionOptionWire, InvoicingDunningActionOption, InvoicingNamedOptionWire, InvoicingSubscriptionEditFieldOptionWire, InvoicingSubscriptionLifecycleActionOptionWire } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
1
|
+
import { AuditLogEntityRouteOptionWire, AuditLogListSortFieldOptionWire, AuditLogSourceLabelOptionWire, InvoicingCatalogLifecycleActionOptionWire, InvoicingDunningActionOption, InvoicingNamedOptionWire, InvoicingQboAccountMappingKindOptionWire, InvoicingSubscriptionEditFieldOptionWire, InvoicingSubscriptionLifecycleActionOptionWire } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
3
|
/**
|
|
4
4
|
* Wire payload of the invoicing config API (GET/PUT `/1.0/config`). Follows
|
|
@@ -27,6 +27,9 @@ export interface InvoicingConfigPayload {
|
|
|
27
27
|
invoicing_tos_acceptance_user_agent?: string | null;
|
|
28
28
|
invoicing_tos_acceptance_user_id?: string | null;
|
|
29
29
|
is_invoicing_settings_seeded?: boolean;
|
|
30
|
+
qbo_account_mapping_kind_options?: InvoicingQboAccountMappingKindOptionWire[];
|
|
31
|
+
qbo_customer_matching_options?: InvoicingNamedOptionWire[];
|
|
32
|
+
qbo_sync_status_options?: InvoicingNamedOptionWire[];
|
|
30
33
|
updated_at?: string | null;
|
|
31
34
|
}
|
|
32
35
|
export type InvoicingConfigResponse = ZeniAPIResponse<InvoicingConfigPayload>;
|
|
@@ -2,7 +2,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
|
|
|
2
2
|
import { InvoicingConfigPayload } from './invoicingConfigViewPayload';
|
|
3
3
|
import { InvoicingConfigViewState } from './invoicingConfigViewState';
|
|
4
4
|
export declare const initialState: InvoicingConfigViewState;
|
|
5
|
-
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
5
|
+
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
6
6
|
export declare const fetchInvoicingConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
7
7
|
cacheOverride?: boolean;
|
|
8
8
|
} | undefined], {
|