@zeniai/client-epic-state 5.1.93 → 5.1.95-betaAK0
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 +16 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +22 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +7 -0
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +3 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +25 -2
- package/lib/entity/aiCfo/aiCfoState.d.ts +7 -0
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classSelectorV2.d.ts +2 -1
- package/lib/entity/class/classSelectorV2.js +7 -7
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyPayload.d.ts +4 -0
- package/lib/entity/company/companyPayload.js +18 -8
- package/lib/entity/company/companyStateTypes.d.ts +4 -0
- package/lib/entity/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
- package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +6 -2
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +9 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +7 -0
- 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/sectionClassesViewV2/sectionClassesViewSelector.d.ts +2 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewSelector.js +3 -3
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +2 -1
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +4 -4
- package/lib/entity/snackbar/snackbarApiError.d.ts +8 -0
- package/lib/entity/snackbar/snackbarApiError.js +15 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +31 -0
- package/lib/entity/tenant/tenantReducer.d.ts +5 -1
- package/lib/entity/tenant/tenantReducer.js +21 -2
- package/lib/epic.d.ts +7 -1
- package/lib/epic.js +9 -1
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +17 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +23 -1
- package/lib/esm/entity/class/classSelectorV2.js +7 -7
- package/lib/esm/entity/company/companyPayload.js +18 -8
- package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +4 -1
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +6 -0
- package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewSelector.js +3 -3
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +4 -4
- package/lib/esm/entity/snackbar/snackbarApiError.js +11 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +31 -0
- package/lib/esm/entity/tenant/tenantReducer.js +20 -1
- package/lib/esm/epic.js +9 -1
- package/lib/esm/index.js +19 -12
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewEpic.js +30 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewPayload.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewReducer.js +132 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewSelector.js +90 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewState.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.js +61 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.js +63 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewEpic.js +30 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewPayload.js +1 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewReducer.js +128 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewSelector.js +90 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewState.js +1 -0
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +4 -1
- package/lib/esm/view/companyView/companyViewReducer.js +58 -1
- package/lib/esm/view/companyView/epic/updateCompanyProductServicesEpic.js +91 -0
- package/lib/esm/view/companyView/epic/updateCompanyQboRealmIdEpic.js +58 -0
- package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +52 -0
- package/lib/esm/view/companyView/types/cockpitTypes.js +13 -1
- package/lib/esm/view/companyView/types/companyManagementViewState.js +2 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +26 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +26 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +37 -10
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +39 -10
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +5 -4
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +35 -5
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +25 -3
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +26 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +16 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +34 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +26 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +20 -3
- package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +65 -18
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +35 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +26 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +16 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +9 -1
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +50 -1
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +14 -1
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +31 -10
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +30 -5
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +26 -4
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +22 -14
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +49 -7
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +30 -9
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +56 -1
- package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +45 -10
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +7 -2
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +1 -1
- package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +4 -1
- package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +4 -1
- package/lib/index.d.ts +32 -18
- package/lib/index.js +90 -50
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewEpic.d.ts +6 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewEpic.js +34 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewPayload.d.ts +20 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewPayload.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewReducer.d.ts +34 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewReducer.js +136 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelector.d.ts +7 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelector.js +94 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.d.ts +7 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewState.d.ts +23 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewState.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.d.ts +9 -0
- package/lib/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.js +66 -0
- package/lib/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.d.ts +10 -0
- package/lib/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.js +68 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewEpic.d.ts +6 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewEpic.js +34 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewPayload.d.ts +20 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewPayload.js +2 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewReducer.d.ts +33 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewReducer.js +132 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelector.d.ts +7 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelector.js +94 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.d.ts +18 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.js +2 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewState.d.ts +22 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewState.js +2 -0
- 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/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +5 -2
- package/lib/view/companyView/companyViewReducer.d.ts +22 -1
- package/lib/view/companyView/companyViewReducer.js +60 -3
- package/lib/view/companyView/epic/updateCompanyProductServicesEpic.d.ts +10 -0
- package/lib/view/companyView/epic/updateCompanyProductServicesEpic.js +95 -0
- package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.d.ts +8 -0
- package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.js +62 -0
- package/lib/view/companyView/selector/companyManagementViewSelector.d.ts +3 -0
- package/lib/view/companyView/selector/companyManagementViewSelector.js +55 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +7 -3
- package/lib/view/companyView/types/cockpitTypes.js +15 -1
- package/lib/view/companyView/types/companyManagementViewState.d.ts +2 -0
- package/lib/view/companyView/types/companyManagementViewState.js +2 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +4 -0
- package/lib/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +25 -3
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -1
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +25 -3
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +22 -8
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +2 -1
- package/lib/view/invoicing/discountAction/discountActionEpic.js +35 -8
- package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +2 -1
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +37 -8
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +5 -4
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +34 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +24 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +25 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.d.ts +4 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +15 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +17 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.d.ts +7 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +37 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +25 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +19 -2
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +2 -1
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +63 -16
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +15 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +34 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +11 -31
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +22 -1
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.d.ts +7 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +30 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +20 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewEpics.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.d.ts +12 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +11 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.d.ts +21 -4
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +51 -2
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.d.ts +3 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +16 -2
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewState.d.ts +13 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +2 -1
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +30 -9
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +29 -4
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +25 -3
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +24 -7
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +23 -16
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +2 -1
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +48 -6
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +2 -1
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +28 -7
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +10 -1
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +44 -2
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +59 -2
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +2 -1
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +43 -8
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +1 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +7 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +5 -2
- package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
- package/lib/view/vendorTabView/vendorTabViewReducer.js +5 -2
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ import { createSelector } from '@reduxjs/toolkit';
|
|
|
2
2
|
import recordGet from 'lodash/get';
|
|
3
3
|
import orderBy from 'lodash/orderBy';
|
|
4
4
|
import { getSortOrder } from '../../../commonPayloadTypes/sortOrderPayload';
|
|
5
|
+
import { getCompanyByCompanyId } from '../../../entity/company/companySelector';
|
|
5
6
|
import { customerRatingValues, teamRatingValues, } from '../../../entity/customerSatisfaction/customerSatisfactionState';
|
|
6
7
|
import { getUserByUserId, getUserName, getUserNameById, } from '../../../entity/user/userSelector';
|
|
7
8
|
import { date as zeniDate } from '../../../zeniDayJS';
|
|
@@ -122,6 +123,29 @@ const getCategoryValueForCompany = (key, company) => {
|
|
|
122
123
|
if (key === 'annualRecurringRevenue' || key === 'monthlyRecurringRevenue') {
|
|
123
124
|
return company.primarySubscription?.summary.summary[key].amount.toString();
|
|
124
125
|
}
|
|
126
|
+
if (key === 'productVerticals') {
|
|
127
|
+
const featuresActivationInfo = company.company.company.featuresActivationInfo;
|
|
128
|
+
const enabledVerticals = [];
|
|
129
|
+
if (featuresActivationInfo?.isBookkeepingEnabled === true) {
|
|
130
|
+
enabledVerticals.push('bookkeeping');
|
|
131
|
+
}
|
|
132
|
+
if (featuresActivationInfo?.isBillPayFeatureEnabled === true) {
|
|
133
|
+
enabledVerticals.push('billPay');
|
|
134
|
+
}
|
|
135
|
+
if (featuresActivationInfo?.isReimbursementFeatureEnabled === true) {
|
|
136
|
+
enabledVerticals.push('reimbursement');
|
|
137
|
+
}
|
|
138
|
+
if (featuresActivationInfo?.isTaxEnabled === true) {
|
|
139
|
+
enabledVerticals.push('tax');
|
|
140
|
+
}
|
|
141
|
+
if (featuresActivationInfo?.isPayrollEnabled === true) {
|
|
142
|
+
enabledVerticals.push('payroll');
|
|
143
|
+
}
|
|
144
|
+
if (featuresActivationInfo?.isCfoEnabled === true) {
|
|
145
|
+
enabledVerticals.push('cfo');
|
|
146
|
+
}
|
|
147
|
+
return enabledVerticals;
|
|
148
|
+
}
|
|
125
149
|
return company.company.company.managementInfo[key];
|
|
126
150
|
};
|
|
127
151
|
const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredCompanies = [], index = 0) => {
|
|
@@ -192,6 +216,8 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
192
216
|
updatedCompanies.forEach((company) => {
|
|
193
217
|
switch (sortKey) {
|
|
194
218
|
case 'companyName':
|
|
219
|
+
case 'productVerticals':
|
|
220
|
+
case 'realmId':
|
|
195
221
|
companiesWithSortKeyValue.push(company);
|
|
196
222
|
break;
|
|
197
223
|
case 'status':
|
|
@@ -427,6 +453,12 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
427
453
|
primarySortValue = (company.company.company.companyInfo.bookCloseDate ??
|
|
428
454
|
zeniDate('1970-01-01T00:00:00.000Z')).valueOf();
|
|
429
455
|
break;
|
|
456
|
+
case 'productVerticals':
|
|
457
|
+
case 'realmId':
|
|
458
|
+
// Not a meaningful sort axis (both are cockpit action columns);
|
|
459
|
+
// keep stable order rather than falling through to the status/group
|
|
460
|
+
// default sort.
|
|
461
|
+
break;
|
|
430
462
|
case 'status':
|
|
431
463
|
default: {
|
|
432
464
|
isMultiSortApplicable = true;
|
|
@@ -480,3 +512,23 @@ export const getTotalRecurringRevenue = (companies) => companies.reduce((prev, c
|
|
|
480
512
|
currencySymbol: '',
|
|
481
513
|
},
|
|
482
514
|
});
|
|
515
|
+
export function getCompanyProductServicesUpdateStatus(state, companyId) {
|
|
516
|
+
return (state.companyViewState.managementView
|
|
517
|
+
.productServicesUpdateStatusByCompanyId[companyId] ?? {
|
|
518
|
+
fetchState: 'Not-Started',
|
|
519
|
+
error: undefined,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
export function getCompanyQboRealmIdUpdateStatus(state, companyId) {
|
|
523
|
+
return (state.companyViewState.managementView.qboRealmIdUpdateStatusByCompanyId[companyId] ?? {
|
|
524
|
+
fetchState: 'Not-Started',
|
|
525
|
+
error: undefined,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
// Cockpit populates companyState (with a companyId->tenantId mapping) but not
|
|
529
|
+
// tenantState, so resolve from company first and fall back to tenant.
|
|
530
|
+
export function resolveTenantIdByCompanyId(state, companyId) {
|
|
531
|
+
return (getCompanyByCompanyId(state.companyState, companyId)?.company.companyInfo
|
|
532
|
+
.tenantId ??
|
|
533
|
+
Object.values(state.tenantState.tenantsById).find((tenant) => tenant?.companyId === companyId)?.tenantId);
|
|
534
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
1
|
+
import { stringToUnion, stringToUnionStrict, } from '../../../commonStateTypes/stringToUnion';
|
|
2
2
|
const ALL_PORTFOLIO_SORT_KEYS = [
|
|
3
3
|
'companyName',
|
|
4
4
|
'cashBalance',
|
|
@@ -13,6 +13,8 @@ const ALL_MANAGEMENT_SORT_KEYS = [
|
|
|
13
13
|
'status',
|
|
14
14
|
'group',
|
|
15
15
|
'plans',
|
|
16
|
+
'productVerticals',
|
|
17
|
+
'realmId',
|
|
16
18
|
'controller',
|
|
17
19
|
'customerSuccessManager',
|
|
18
20
|
'reviewer',
|
|
@@ -83,3 +85,13 @@ export const MANAGEMENT_STATUS_CODES = [
|
|
|
83
85
|
'terminated',
|
|
84
86
|
];
|
|
85
87
|
export const toManagementStatusCodeType = (v) => stringToUnion(v, MANAGEMENT_STATUS_CODES);
|
|
88
|
+
export const ALL_PRODUCT_VERTICALS = [
|
|
89
|
+
'bookkeeping',
|
|
90
|
+
'billPay',
|
|
91
|
+
'reimbursement',
|
|
92
|
+
'tax',
|
|
93
|
+
'payroll',
|
|
94
|
+
'cfo',
|
|
95
|
+
];
|
|
96
|
+
export const toProductVertical = (v) => stringToUnion(v, ALL_PRODUCT_VERTICALS);
|
|
97
|
+
export const toProductVerticalStrict = (v) => stringToUnionStrict(v ?? '', ALL_PRODUCT_VERTICALS);
|
|
@@ -19,6 +19,8 @@ export function getCompanyManagementPendingUpdates(companyId, state) {
|
|
|
19
19
|
export const initialCompanyManagementView = {
|
|
20
20
|
...initialCommonState,
|
|
21
21
|
updatesByCompanyId: {},
|
|
22
|
+
productServicesUpdateStatusByCompanyId: {},
|
|
23
|
+
qboRealmIdUpdateStatusByCompanyId: {},
|
|
22
24
|
uiState: {
|
|
23
25
|
sortKey: 'status',
|
|
24
26
|
sortOrder: 'ascending',
|
|
@@ -8,6 +8,8 @@ import { reduceAnyCompletedFetchState } from '../../commonStateTypes/reduceFetch
|
|
|
8
8
|
import { toTimeframeTick, } from '../../commonStateTypes/timeframeTick';
|
|
9
9
|
import { extractThisPeriod } from '../../commonStateTypes/viewAndReport/thisPeriodHelpers';
|
|
10
10
|
import { getBalanceSheet } from '../balanceSheet/balanceSheetSelector';
|
|
11
|
+
import { getBalanceSheetClassesView } from '../balanceSheetClassesView/balanceSheetClassesViewSelector';
|
|
12
|
+
import { getBalanceSheetProjectView } from '../balanceSheetProjectView/balanceSheetProjectViewSelector';
|
|
11
13
|
import { getCashFlow } from '../cashFlow/cashFlowSelector';
|
|
12
14
|
import { getProfitAndLossReport, } from '../profitAndLoss/profitAndLossSelector';
|
|
13
15
|
import { getProfitAndLossClassesHorizontalView } from '../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
|
|
@@ -37,7 +39,7 @@ function getFirstMonthOfFY(profitAndLossState, balanceSheetState, cashFlowState)
|
|
|
37
39
|
cashFlowState.firstMonthOfFY ??
|
|
38
40
|
1);
|
|
39
41
|
}
|
|
40
|
-
export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.profitAndLossProjectViewState, (state) => state.balanceSheetState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, projectState, sectionProjectViewState, profitAndLossProjectViewState, balanceSheetState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
|
|
42
|
+
export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.profitAndLossProjectViewState, (state) => state.balanceSheetState, (state) => state.balanceSheetClassesViewState, (state) => state.balanceSheetProjectViewState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, projectState, sectionProjectViewState, profitAndLossProjectViewState, balanceSheetState, balanceSheetClassesViewState, balanceSheetProjectViewState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
|
|
41
43
|
// to get min and max dates across three reports
|
|
42
44
|
let allTimeframeTicks = [];
|
|
43
45
|
let balancesInTimeframe = [];
|
|
@@ -77,6 +79,10 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
77
79
|
? thisPeriod
|
|
78
80
|
: undefined);
|
|
79
81
|
const balanceSheetReport = getBalanceSheet(filter, accountState, accountGroupState, sectionAccountsViewState, balanceSheetState);
|
|
82
|
+
const balanceSheetClassFilter = newBalancesFilterClassesView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, balanceSheetClassesViewState.uiState.classesToFilterOut);
|
|
83
|
+
const balanceSheetByClassReport = getBalanceSheetClassesView(balanceSheetClassFilter, accountState, classState, sectionsState, balanceSheetClassesViewState);
|
|
84
|
+
const balanceSheetProjectFilter = newBalancesFilterProjectView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, balanceSheetProjectViewState.uiState.projectsToFilterOut);
|
|
85
|
+
const balanceSheetByProjectReport = getBalanceSheetProjectView(balanceSheetProjectFilter, accountState, projectState, sectionProjectViewState, balanceSheetProjectViewState);
|
|
80
86
|
const cashFlowReport = getCashFlow(filter, accountState, accountGroupState, sectionAccountsViewState, cashFlowState);
|
|
81
87
|
const allReports = [
|
|
82
88
|
profitAndLossReport.reducedAnyFetchState,
|
|
@@ -105,6 +111,18 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
105
111
|
error: balanceSheetReport.error,
|
|
106
112
|
};
|
|
107
113
|
break;
|
|
114
|
+
case 'balance_sheet_by_classes':
|
|
115
|
+
selectedReportAndTimeframeFetchState = {
|
|
116
|
+
fetchState: balanceSheetByClassReport.fetchState,
|
|
117
|
+
error: balanceSheetByClassReport.error,
|
|
118
|
+
};
|
|
119
|
+
break;
|
|
120
|
+
case 'balance_sheet_by_projects':
|
|
121
|
+
selectedReportAndTimeframeFetchState = {
|
|
122
|
+
fetchState: balanceSheetByProjectReport.fetchState,
|
|
123
|
+
error: balanceSheetByProjectReport.error,
|
|
124
|
+
};
|
|
125
|
+
break;
|
|
108
126
|
case 'cash_flow':
|
|
109
127
|
selectedReportAndTimeframeFetchState = {
|
|
110
128
|
fetchState: cashFlowReport.fetchState,
|
|
@@ -132,6 +150,8 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
132
150
|
profitAndLossByProjectReport,
|
|
133
151
|
profitAndLossByClassHorizontalReport,
|
|
134
152
|
balanceSheetReport,
|
|
153
|
+
balanceSheetByClassReport,
|
|
154
|
+
balanceSheetByProjectReport,
|
|
135
155
|
cashFlowReport,
|
|
136
156
|
filter,
|
|
137
157
|
selectedReportId: financeStatementState.selectedReportId,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCreditNotes } from '../../../entity/invoicing/creditNote/creditNoteReducer';
|
|
4
|
+
import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
6
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
7
|
import { localDataToCreateCreditNotePayload, } from './createCreditNotePayload';
|
|
6
8
|
import { createCreditNoteFailure, createCreditNoteSuccess, submitCreateCreditNote, } from './createCreditNoteReducer';
|
|
@@ -15,9 +17,29 @@ export const createCreditNoteEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
15
17
|
return [
|
|
16
18
|
updateInvoicingCreditNotes([response.data], 'merge'),
|
|
17
19
|
createCreditNoteSuccess({ creditNoteId: response.data.id }),
|
|
20
|
+
openSnackbar({
|
|
21
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
22
|
+
messageText: 'success',
|
|
23
|
+
type: 'success',
|
|
24
|
+
}),
|
|
18
25
|
];
|
|
19
26
|
}
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
return from([
|
|
28
|
+
createCreditNoteFailure(response.status),
|
|
29
|
+
openSnackbar({
|
|
30
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
31
|
+
messageText: 'failed',
|
|
32
|
+
type: 'error',
|
|
33
|
+
variables: apiErrorSnackbarVariables(response.status),
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
36
|
+
}), catchError((error) => from([
|
|
37
|
+
createCreditNoteFailure(createZeniAPIStatus('Unexpected Error', 'Create credit note REST API call errored out ' +
|
|
38
|
+
JSON.stringify(error))),
|
|
39
|
+
openSnackbar({
|
|
40
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
41
|
+
messageText: 'failed',
|
|
42
|
+
type: 'error',
|
|
43
|
+
}),
|
|
44
|
+
])));
|
|
23
45
|
}));
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { extractInvoicingInvoiceAddresses } from '../../../entity/invoicing/invoice/invoicePayload';
|
|
5
5
|
import { updateInvoices } from '../../../entity/invoicing/invoice/invoiceReducer';
|
|
6
|
+
import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
|
|
7
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
8
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
9
|
import { addInvoiceToList } from '../invoiceList/invoiceListReducer';
|
|
8
10
|
import { createInvoice, createInvoiceFailure, createInvoiceSuccess, } from './createInvoiceReducer';
|
|
@@ -22,9 +24,29 @@ export const createInvoiceEpic = (actions$, _state$, zeniAPI) => actions$.pipe(f
|
|
|
22
24
|
status: response.data.status,
|
|
23
25
|
}),
|
|
24
26
|
createInvoiceSuccess({ invoiceId: response.data.id }),
|
|
27
|
+
openSnackbar({
|
|
28
|
+
messageSection: 'invoicing_invoice_saved',
|
|
29
|
+
messageText: 'success',
|
|
30
|
+
type: 'success',
|
|
31
|
+
}),
|
|
25
32
|
];
|
|
26
33
|
}
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
return from([
|
|
35
|
+
createInvoiceFailure(response.status),
|
|
36
|
+
openSnackbar({
|
|
37
|
+
messageSection: 'invoicing_invoice_saved',
|
|
38
|
+
messageText: 'failed',
|
|
39
|
+
type: 'error',
|
|
40
|
+
variables: apiErrorSnackbarVariables(response.status),
|
|
41
|
+
}),
|
|
42
|
+
]);
|
|
43
|
+
}), catchError((error) => from([
|
|
44
|
+
createInvoiceFailure(createZeniAPIStatus('Unexpected Error', 'Create invoice REST API call errored out ' +
|
|
45
|
+
JSON.stringify(error))),
|
|
46
|
+
openSnackbar({
|
|
47
|
+
messageSection: 'invoicing_invoice_saved',
|
|
48
|
+
messageText: 'failed',
|
|
49
|
+
type: 'error',
|
|
50
|
+
}),
|
|
51
|
+
])));
|
|
30
52
|
}));
|
|
@@ -1,25 +1,52 @@
|
|
|
1
|
+
import { getAddressByAddressId } from '../../../entity/address/addressSelector';
|
|
1
2
|
import { getInvoicingCatalogListView, getInvoicingCatalogPrices, } from '../invoicingCatalogListView/invoicingCatalogListViewSelector';
|
|
2
3
|
import { getInvoicingCustomerListView } from '../invoicingCustomerListView/invoicingCustomerListViewSelector';
|
|
3
4
|
import { getInvoicingSettings } from '../settingsView/settingsViewSelector';
|
|
5
|
+
/**
|
|
6
|
+
* Display name for a customer option: company, else the full name, else the
|
|
7
|
+
* email, else the raw id.
|
|
8
|
+
*/
|
|
9
|
+
const customerDisplayName = (customer) => {
|
|
10
|
+
const fullName = [customer.firstName, customer.lastName]
|
|
11
|
+
.filter((part) => part != null && part.trim() !== '')
|
|
12
|
+
.join(' ')
|
|
13
|
+
.trim();
|
|
14
|
+
const company = customer.company?.trim() ?? '';
|
|
15
|
+
const email = customer.email?.trim() ?? '';
|
|
16
|
+
return company !== ''
|
|
17
|
+
? company
|
|
18
|
+
: fullName !== ''
|
|
19
|
+
? fullName
|
|
20
|
+
: email !== ''
|
|
21
|
+
? email
|
|
22
|
+
: customer.id;
|
|
23
|
+
};
|
|
4
24
|
/**
|
|
5
25
|
* Single bundled view for the create-invoice screen — web-ui consumes only this.
|
|
6
26
|
* Carries the form draft (`localData`), the option sources the form needs
|
|
7
|
-
* (
|
|
8
|
-
* state/error, and the id of the invoice last created
|
|
9
|
-
* navigate on success).
|
|
10
|
-
* option shapes.
|
|
27
|
+
* (customer picker rows, catalog plan names, products, settings), the
|
|
28
|
+
* create-invoice fetch state/error, and the id of the invoice last created
|
|
29
|
+
* (`savedInvoiceId`, to navigate on success).
|
|
11
30
|
*/
|
|
12
31
|
export const getCreateInvoiceFormView = (state) => {
|
|
13
32
|
const createInvoiceState = state.invoicingCreateInvoiceState;
|
|
14
33
|
const catalogListView = getInvoicingCatalogListView(state);
|
|
15
|
-
const plans = getInvoicingCatalogPrices(catalogListView.plans);
|
|
16
34
|
return {
|
|
17
|
-
customers: getInvoicingCustomerListView(state).customers
|
|
35
|
+
customers: getInvoicingCustomerListView(state).customers.map((customer) => ({
|
|
36
|
+
billingAddress: customer.billingAddressId != null
|
|
37
|
+
? getAddressByAddressId(state.addressState, customer.billingAddressId)
|
|
38
|
+
: undefined,
|
|
39
|
+
email: customer.email,
|
|
40
|
+
id: customer.id,
|
|
41
|
+
name: customerDisplayName(customer),
|
|
42
|
+
})),
|
|
18
43
|
localData: createInvoiceState.formDraft,
|
|
19
|
-
planNames: plans
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
|
|
44
|
+
planNames: catalogListView.plans.flatMap((plan) => (plan.subFamilies ?? [])
|
|
45
|
+
.filter((subFamily) => (subFamily.name ?? '') !== '')
|
|
46
|
+
.map((subFamily) => ({
|
|
47
|
+
planName: plan.name ?? '',
|
|
48
|
+
subFamilyName: subFamily.name ?? '',
|
|
49
|
+
}))),
|
|
23
50
|
products: getInvoicingCatalogPrices(catalogListView.products),
|
|
24
51
|
savedInvoiceId: createInvoiceState.createdInvoiceId,
|
|
25
52
|
settings: getInvoicingSettings(state),
|
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
-
import {
|
|
4
|
+
import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
|
|
5
7
|
import { runInvoicingDiscountAction, runInvoicingDiscountActionFailure, runInvoicingDiscountActionSuccess, } from './discountActionReducer';
|
|
8
|
+
/** Snackbar copy per action kind; unlisted kinds run without one. */
|
|
9
|
+
const SNACKBAR_SECTION_BY_KIND = {
|
|
10
|
+
archive: 'invoicing_discount_archive',
|
|
11
|
+
delete: 'invoicing_discount_delete',
|
|
12
|
+
unarchive: 'invoicing_discount_unarchive',
|
|
13
|
+
};
|
|
6
14
|
export const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingDiscountAction.match), mergeMap((action) => {
|
|
7
15
|
const { action: kind, id } = action.payload;
|
|
8
16
|
const requestBody = { action: kind };
|
|
17
|
+
const snackbarSection = SNACKBAR_SECTION_BY_KIND[kind];
|
|
18
|
+
/** `status` surfaces the platform's error text; omit it to keep the generic copy. */
|
|
19
|
+
const snackbar = (messageText, status) => snackbarSection == null
|
|
20
|
+
? []
|
|
21
|
+
: [
|
|
22
|
+
openSnackbar({
|
|
23
|
+
messageSection: snackbarSection,
|
|
24
|
+
messageText,
|
|
25
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
26
|
+
variables: apiErrorSnackbarVariables(status),
|
|
27
|
+
}),
|
|
28
|
+
];
|
|
9
29
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/discounts/${encodeURIComponent(id)}/actions`;
|
|
10
30
|
return zeniAPI
|
|
11
31
|
.postAndGetJSON(apiUrl, requestBody)
|
|
@@ -14,15 +34,22 @@ export const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => ac
|
|
|
14
34
|
return [
|
|
15
35
|
updateInvoicingCoupons([response.data], 'merge'),
|
|
16
36
|
runInvoicingDiscountActionSuccess({ id }),
|
|
37
|
+
...snackbar('success'),
|
|
17
38
|
];
|
|
18
39
|
}
|
|
19
|
-
return
|
|
20
|
-
|
|
40
|
+
return from([
|
|
41
|
+
runInvoicingDiscountActionFailure({
|
|
42
|
+
error: response.status,
|
|
43
|
+
id,
|
|
44
|
+
}),
|
|
45
|
+
...snackbar('failed', response.status),
|
|
46
|
+
]);
|
|
47
|
+
}), catchError((error) => from([
|
|
48
|
+
runInvoicingDiscountActionFailure({
|
|
49
|
+
error: createZeniAPIStatus('Unexpected Error', 'Discount action REST API call errored out ' +
|
|
50
|
+
JSON.stringify(error)),
|
|
21
51
|
id,
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
JSON.stringify(error)),
|
|
26
|
-
id,
|
|
27
|
-
}))));
|
|
52
|
+
}),
|
|
53
|
+
...snackbar('failed'),
|
|
54
|
+
])));
|
|
28
55
|
}));
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingDunningCases } from '../../../entity/invoicing/dunningCase/dunningCaseReducer';
|
|
4
|
-
import {
|
|
4
|
+
import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
|
|
5
7
|
import { runInvoicingDunningAction, runInvoicingDunningActionFailure, runInvoicingDunningActionSuccess, } from './dunningActionReducer';
|
|
8
|
+
/**
|
|
9
|
+
* Snackbar copy is per action kind; anything not listed here runs without one.
|
|
10
|
+
*/
|
|
11
|
+
const SNACKBAR_SECTION_BY_KIND = {
|
|
12
|
+
cancel: 'invoicing_dunning_cancel',
|
|
13
|
+
resolve: 'invoicing_dunning_case_resolved',
|
|
14
|
+
retry: 'invoicing_dunning_retry',
|
|
15
|
+
};
|
|
6
16
|
export const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingDunningAction.match), mergeMap((action) => {
|
|
7
17
|
const { action: kind, body, id } = action.payload;
|
|
18
|
+
const snackbarSection = SNACKBAR_SECTION_BY_KIND[kind];
|
|
19
|
+
/** `status` surfaces the platform's error text; omit it to keep the generic copy. */
|
|
20
|
+
const snackbar = (messageText, status) => snackbarSection == null
|
|
21
|
+
? []
|
|
22
|
+
: [
|
|
23
|
+
openSnackbar({
|
|
24
|
+
messageSection: snackbarSection,
|
|
25
|
+
messageText,
|
|
26
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
27
|
+
variables: apiErrorSnackbarVariables(status),
|
|
28
|
+
}),
|
|
29
|
+
];
|
|
8
30
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/dunning/${encodeURIComponent(id)}/${kind}`;
|
|
9
31
|
return zeniAPI
|
|
10
32
|
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
@@ -13,15 +35,22 @@ export const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => act
|
|
|
13
35
|
return [
|
|
14
36
|
updateInvoicingDunningCases([response.data], 'merge'),
|
|
15
37
|
runInvoicingDunningActionSuccess({ id }),
|
|
38
|
+
...snackbar('success'),
|
|
16
39
|
];
|
|
17
40
|
}
|
|
18
|
-
return
|
|
19
|
-
|
|
41
|
+
return from([
|
|
42
|
+
runInvoicingDunningActionFailure({
|
|
43
|
+
error: response.status,
|
|
44
|
+
id,
|
|
45
|
+
}),
|
|
46
|
+
...snackbar('failed', response.status),
|
|
47
|
+
]);
|
|
48
|
+
}), catchError((error) => from([
|
|
49
|
+
runInvoicingDunningActionFailure({
|
|
50
|
+
error: createZeniAPIStatus('Unexpected Error', 'Dunning action REST API call errored out ' +
|
|
51
|
+
JSON.stringify(error)),
|
|
20
52
|
id,
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
JSON.stringify(error)),
|
|
25
|
-
id,
|
|
26
|
-
}))));
|
|
53
|
+
}),
|
|
54
|
+
...snackbar('failed'),
|
|
55
|
+
])));
|
|
27
56
|
}));
|
package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js
CHANGED
|
@@ -116,17 +116,21 @@ export const catalogDetailEditValuesToSavePayload = (values, itemType = 'plan',
|
|
|
116
116
|
export const createSubFamilyFormToPayload = (itemId, itemType, values) => {
|
|
117
117
|
const name = values.name.trim();
|
|
118
118
|
const priceCode = trimOrUndefined(values.priceCode) ?? toProductCode(name);
|
|
119
|
+
const tiered = isTieredCatalogPricingModel(values.pricingModel);
|
|
119
120
|
const payload = {
|
|
120
121
|
currency_code: 'USD',
|
|
121
122
|
free_quantity: Number(values.freeQuantity) || 0,
|
|
122
123
|
is_taxable: true,
|
|
123
124
|
item_id: itemId,
|
|
124
125
|
name,
|
|
125
|
-
price: values.priceDollars?.amount ?? 0,
|
|
126
|
+
price: tiered ? 0 : (values.priceDollars?.amount ?? 0),
|
|
126
127
|
price_code: priceCode,
|
|
127
128
|
pricing_model: values.pricingModel || 'flat_fee',
|
|
128
129
|
show_description_in_invoices: true,
|
|
129
130
|
};
|
|
131
|
+
if (tiered) {
|
|
132
|
+
payload.tiers = (values.tiers ?? []).map(tierToPayload);
|
|
133
|
+
}
|
|
130
134
|
const description = trimOrUndefined(values.description);
|
|
131
135
|
if (description != null) {
|
|
132
136
|
payload.description = description;
|
|
@@ -80,6 +80,8 @@ const buildSubFamilyPayload = (localData, subFamily, clearEmptyValues) => {
|
|
|
80
80
|
}
|
|
81
81
|
return payload;
|
|
82
82
|
};
|
|
83
|
+
/** `unit` is the item's unit of measure, not a currency; `CURRENCY_CODE` above prices sub-families. */
|
|
84
|
+
const DEFAULT_CATALOG_ITEM_UNIT = 'USD';
|
|
83
85
|
/**
|
|
84
86
|
* Build the parent catalog-item request body from the form draft. Creates omit
|
|
85
87
|
* both parent and sub-family IDs; edits retain returned sub-family IDs.
|
|
@@ -101,10 +103,9 @@ export const localDataToSaveInvoicingCatalogItemPayload = (localData, isCreate)
|
|
|
101
103
|
if (description != null) {
|
|
102
104
|
itemPayload.description = description;
|
|
103
105
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
106
|
+
// The form no longer collects a unit; an item that already has one keeps it.
|
|
107
|
+
itemPayload.unit =
|
|
108
|
+
trimOrUndefined(localData.unit) ?? DEFAULT_CATALOG_ITEM_UNIT;
|
|
108
109
|
if (localData.itemApplicability === 'restricted' &&
|
|
109
110
|
localData.applicableItems.length > 0) {
|
|
110
111
|
itemPayload.applicable_items = localData.applicableItems;
|
package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { forkJoin,
|
|
1
|
+
import { forkJoin, from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { mergeInvoicingPlanSubFamily, updateInvoicingPlans, } from '../../../entity/invoicing/plan/planReducer';
|
|
4
4
|
import { updateInvoicingProducts } from '../../../entity/invoicing/product/productReducer';
|
|
5
|
+
import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
7
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
6
8
|
import { addInvoicingCatalogItem } from '../invoicingCatalogListView/invoicingCatalogListViewReducer';
|
|
7
9
|
import { localDataToSaveInvoicingCatalogItemPayload, } from './editInvoicingCatalogItemDetailViewPayload';
|
|
@@ -38,7 +40,15 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
38
40
|
const failedProductResponse = productResponses.find((productResponse) => !isSuccessResponse(productResponse) ||
|
|
39
41
|
productResponse.data == null);
|
|
40
42
|
if (failedProductResponse != null) {
|
|
41
|
-
return
|
|
43
|
+
return from([
|
|
44
|
+
submitInvoicingCatalogItemFormFailure(failedProductResponse.status),
|
|
45
|
+
openSnackbar({
|
|
46
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
47
|
+
messageText: 'failed',
|
|
48
|
+
type: 'error',
|
|
49
|
+
variables: apiErrorSnackbarVariables(failedProductResponse.status),
|
|
50
|
+
}),
|
|
51
|
+
]);
|
|
42
52
|
}
|
|
43
53
|
const savedProducts = productResponses.flatMap((productResponse) => productResponse.data != null ? [productResponse.data] : []);
|
|
44
54
|
const resultActions = [
|
|
@@ -65,6 +75,11 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
65
75
|
: 'plan';
|
|
66
76
|
resultActions.push(addInvoicingCatalogItem({ id: savedItem.id, type: itemType }));
|
|
67
77
|
}
|
|
78
|
+
resultActions.push(openSnackbar({
|
|
79
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
80
|
+
messageText: 'success',
|
|
81
|
+
type: 'success',
|
|
82
|
+
}));
|
|
68
83
|
return resultActions;
|
|
69
84
|
};
|
|
70
85
|
const productUpdates = saveInvoicingCatalogItem.match(action)
|
|
@@ -75,7 +90,22 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
75
90
|
}
|
|
76
91
|
return forkJoin(productUpdates.map((productUpdate) => zeniAPI.putAndGetJSON(`${baseUrl}/catalog/products/${encodeURIComponent(productUpdate.id)}`, productUpdate.data))).pipe(mergeMap(completeSave));
|
|
77
92
|
}
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
return from([
|
|
94
|
+
submitInvoicingCatalogItemFormFailure(response.status),
|
|
95
|
+
openSnackbar({
|
|
96
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
97
|
+
messageText: 'failed',
|
|
98
|
+
type: 'error',
|
|
99
|
+
variables: apiErrorSnackbarVariables(response.status),
|
|
100
|
+
}),
|
|
101
|
+
]);
|
|
102
|
+
}), catchError((error) => from([
|
|
103
|
+
submitInvoicingCatalogItemFormFailure(createZeniAPIStatus('Unexpected Error', 'Save catalog item REST API call errored out ' +
|
|
104
|
+
JSON.stringify(error))),
|
|
105
|
+
openSnackbar({
|
|
106
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
107
|
+
messageText: 'failed',
|
|
108
|
+
type: 'error',
|
|
109
|
+
}),
|
|
110
|
+
])));
|
|
81
111
|
}));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
+
import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
6
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
7
|
import { addInvoicingCouponToList } from '../couponView/couponViewReducer';
|
|
6
8
|
import { localDataToSaveInvoicingCouponPayload, } from './editInvoicingCouponDetailViewPayload';
|
|
@@ -43,8 +45,28 @@ export const saveInvoicingCouponEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
43
45
|
status: couponPayload.status,
|
|
44
46
|
}));
|
|
45
47
|
}
|
|
48
|
+
resultActions.push(openSnackbar({
|
|
49
|
+
messageSection: 'invoicing_coupon_saved',
|
|
50
|
+
messageText: 'success',
|
|
51
|
+
type: 'success',
|
|
52
|
+
}));
|
|
46
53
|
return resultActions;
|
|
47
54
|
}
|
|
48
|
-
return
|
|
49
|
-
|
|
55
|
+
return from([
|
|
56
|
+
submitInvoicingCouponFormFailure(response.status),
|
|
57
|
+
openSnackbar({
|
|
58
|
+
messageSection: 'invoicing_coupon_saved',
|
|
59
|
+
messageText: 'failed',
|
|
60
|
+
type: 'error',
|
|
61
|
+
variables: apiErrorSnackbarVariables(response.status),
|
|
62
|
+
}),
|
|
63
|
+
]);
|
|
64
|
+
}), catchError((error) => from([
|
|
65
|
+
submitInvoicingCouponFormFailure(createZeniAPIStatus('Unexpected Error', 'Save coupon REST API call errored out ' + JSON.stringify(error))),
|
|
66
|
+
openSnackbar({
|
|
67
|
+
messageSection: 'invoicing_coupon_saved',
|
|
68
|
+
messageText: 'failed',
|
|
69
|
+
type: 'error',
|
|
70
|
+
}),
|
|
71
|
+
])));
|
|
50
72
|
}));
|