@zeniai/client-epic-state 5.1.92 → 5.1.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +0 -7
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +2 -3
- package/lib/entity/aiCfo/aiCfoReducer.js +2 -25
- package/lib/entity/aiCfo/aiCfoState.d.ts +0 -7
- package/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +8 -18
- package/lib/entity/company/companyStateTypes.d.ts +0 -4
- package/lib/entity/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
- package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +2 -6
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -31
- package/lib/entity/tenant/tenantReducer.d.ts +1 -5
- package/lib/entity/tenant/tenantReducer.js +2 -21
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -5
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +1 -23
- package/lib/esm/entity/company/companyPayload.js +8 -18
- package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +1 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -31
- package/lib/esm/entity/tenant/tenantReducer.js +1 -20
- package/lib/esm/epic.js +1 -5
- package/lib/esm/index.js +8 -9
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +1 -4
- package/lib/esm/view/companyView/companyViewReducer.js +1 -58
- package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +0 -52
- package/lib/esm/view/companyView/types/cockpitTypes.js +1 -13
- package/lib/esm/view/companyView/types/companyManagementViewState.js +0 -2
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +4 -26
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +4 -26
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +10 -37
- package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +10 -37
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +10 -39
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +1 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +4 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +5 -35
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +3 -25
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +4 -26
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +4 -26
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +3 -20
- package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +18 -65
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -30
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +29 -4
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +1 -9
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +1 -50
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +1 -14
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +10 -31
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +5 -30
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +4 -26
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +14 -22
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +7 -49
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +9 -30
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +1 -56
- package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +10 -45
- package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +1 -4
- package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +1 -4
- package/lib/index.d.ts +13 -17
- package/lib/index.js +50 -62
- package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +2 -5
- package/lib/view/companyView/companyViewReducer.d.ts +1 -22
- package/lib/view/companyView/companyViewReducer.js +3 -60
- package/lib/view/companyView/selector/companyManagementViewSelector.d.ts +0 -3
- package/lib/view/companyView/selector/companyManagementViewSelector.js +0 -55
- package/lib/view/companyView/types/cockpitTypes.d.ts +3 -7
- package/lib/view/companyView/types/cockpitTypes.js +1 -15
- package/lib/view/companyView/types/companyManagementViewState.d.ts +0 -2
- package/lib/view/companyView/types/companyManagementViewState.js +0 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +1 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +3 -25
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +1 -2
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +3 -25
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +8 -22
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +10 -37
- package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +1 -2
- package/lib/view/invoicing/discountAction/discountActionEpic.js +8 -35
- package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +1 -2
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +8 -37
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +1 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +4 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +4 -34
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +2 -24
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +3 -25
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +3 -25
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +2 -19
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +1 -2
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +16 -63
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -13
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -30
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +31 -11
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +29 -4
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -15
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewEpics.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.d.ts +0 -12
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +0 -11
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.d.ts +4 -21
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +2 -51
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.d.ts +0 -3
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +2 -16
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewState.d.ts +0 -13
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +1 -2
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +9 -30
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +4 -29
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +1 -2
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +3 -25
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +7 -24
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +16 -23
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +1 -2
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +6 -48
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +1 -2
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +7 -28
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +1 -10
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +2 -44
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +2 -59
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +1 -2
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +8 -43
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +2 -5
- package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
- package/lib/view/vendorTabView/vendorTabViewReducer.js +2 -5
- package/package.json +2 -2
- package/lib/entity/snackbar/snackbarApiError.d.ts +0 -8
- package/lib/entity/snackbar/snackbarApiError.js +0 -15
- package/lib/esm/entity/snackbar/snackbarApiError.js +0 -11
- package/lib/esm/view/companyView/epic/updateCompanyProductServicesEpic.js +0 -91
- package/lib/esm/view/companyView/epic/updateCompanyQboRealmIdEpic.js +0 -58
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +0 -26
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +0 -16
- package/lib/view/companyView/epic/updateCompanyProductServicesEpic.d.ts +0 -10
- package/lib/view/companyView/epic/updateCompanyProductServicesEpic.js +0 -95
- package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.d.ts +0 -8
- package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.js +0 -62
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.d.ts +0 -7
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +0 -30
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +0 -20
package/lib/esm/index.js
CHANGED
|
@@ -154,10 +154,10 @@ import { fetchCompanyMonthEndReportHistoricData, fetchCompanyMonthEndReportHisto
|
|
|
154
154
|
import { getCompanyMonthEndReportHistoricData, getCompanyMonthEndReportSelectorView, } from './view/companyMonthEndReportView/companyMonthEndReportViewSelector';
|
|
155
155
|
import { fetchCockpitContext, fetchCompanyTaskManagerView, fetchTaskManagerMetrics, updateCompanyTaskManagerViewFilters, } from './view/companyTaskManagerView/companyTaskManagerViewReducer';
|
|
156
156
|
import { getCompanyTaskManagerView, } from './view/companyTaskManagerView/companyTaskManagerViewSelector';
|
|
157
|
-
import { clearCompanyView, clearQboProjectsReconnectRequest, companyManagementSaveUpdates, companyPassportClearDataInLocalStore, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, disableAccountingProjects, dismissCapitalizationOnboarding, enableAccountingProjects, fetchAllCockpitViews, fetchCompanyManagementView, fetchCompanyPassportView, fetchCompanyPortfolioView, fetchManagementView, fetchOnboardingView, fetchParentSubsidiaryManagementView, fetchPortfolioView, fetchSubscriptionView, fetchZeniUsers, resumeEnableAccountingProjects, saveCompanyPassportDetails, saveIndustryAndIncDateInCompanyPassportLocalStore, updateAccountingClassesEnabled, updateCapitalizationAccountThreshold, updateCompanyDownloadState, updateCompanyManagementUIState, updateCompanyPassportLocalStoreData, updateCompanyPortfolioUIState,
|
|
157
|
+
import { clearCompanyView, clearQboProjectsReconnectRequest, companyManagementSaveUpdates, companyPassportClearDataInLocalStore, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, disableAccountingProjects, dismissCapitalizationOnboarding, enableAccountingProjects, fetchAllCockpitViews, fetchCompanyManagementView, fetchCompanyPassportView, fetchCompanyPortfolioView, fetchManagementView, fetchOnboardingView, fetchParentSubsidiaryManagementView, fetchPortfolioView, fetchSubscriptionView, fetchZeniUsers, resumeEnableAccountingProjects, saveCompanyPassportDetails, saveIndustryAndIncDateInCompanyPassportLocalStore, updateAccountingClassesEnabled, updateCapitalizationAccountThreshold, updateCompanyDownloadState, updateCompanyManagementUIState, updateCompanyPassportLocalStoreData, updateCompanyPortfolioUIState, } from './view/companyView/companyViewReducer';
|
|
158
158
|
import { canSendMonthEndEmailReport, shouldEnableCalendarPickerForLastReportSent, } from './view/companyView/helpers/cockpitHelpers';
|
|
159
159
|
import { getParentSubsidiaryManagementView } from './view/companyView/parentSubsidiaryView/parentSubsidiaryViewSelector';
|
|
160
|
-
import { getAddonListZeniSku, getCompanyManagementView,
|
|
160
|
+
import { getAddonListZeniSku, getCompanyManagementView, getPlanListZeniSku, } from './view/companyView/selector/companyManagementViewSelector';
|
|
161
161
|
import { getCompanyPassportLocalStoreData, getCompanyPassportView, isCompanyPassportDataToBeSaved, } from './view/companyView/selector/companyPassportViewSelector';
|
|
162
162
|
import { getCompanyPortfolioView, isInfiniteRunway, } from './view/companyView/selector/companyPortfolioViewSelector';
|
|
163
163
|
import { getAllCockpitTabsFilterView, } from './view/companyView/selector/getAllCockpitTabsFilterView';
|
|
@@ -456,7 +456,6 @@ export { scheduleTenantCreditScoreCron, fetchCreditAgentMacro, saveCreditAgentMa
|
|
|
456
456
|
export { toCardTenantProfileRow, toMacro, } from './entity/creditAgent/creditAgentPayload';
|
|
457
457
|
export { getCreditAgentView, getCreditAgentEntity, getCreditAgentMacro, getCardProfilesData, } from './view/creditAgentView/creditAgentViewSelector';
|
|
458
458
|
export { getCreditReportDownloadPayload } from './view/creditAgentView/buildCreditReportCsv';
|
|
459
|
-
export { ALL_PRODUCT_VERTICALS, toProductVertical, toProductVerticalStrict, } from './view/companyView/types/cockpitTypes';
|
|
460
459
|
export { clearAllCreditAgent, updateCreditAgentMacro, updateCreditAgentRow, updateCreditAgentRows, } from './entity/creditAgent/creditAgentReducer';
|
|
461
460
|
export { getCreditAgentRows, getCreditAgentMacroEntity, } from './entity/creditAgent/creditAgentSelector';
|
|
462
461
|
export { saveJeAccountSettings, saveJeAccountSettingsLocalData };
|
|
@@ -567,7 +566,7 @@ export { newAddressInLocalStore, getAddress, getNewAddress, getAllNewAddresses,
|
|
|
567
566
|
export { toManagementSortKeyType, toOnboardingSortKeyType, toPortfolioSortKeyType, toHealthSortKeyType, toTaskManagerSortKeyType, updateCompanyTaskManagerViewFilters, };
|
|
568
567
|
export { ALL_COCKPIT_TABS_FILE_TYPES, ALL_COCKPIT_TABS_IDS, toCockpitTabsIDStrict, toCockpitTabsFileTypeStrict, };
|
|
569
568
|
export { isAllowedValueWithCode, isAllowedValueWithID, };
|
|
570
|
-
export { fetchCompanyPassportView, getCompanyPassportView, getCompanyPassportLocalStoreData, isCompanyPassportDataToBeSaved, companyPassportSaveDataInLocalStore, saveIndustryAndIncDateInCompanyPassportLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, updateCompanyPassportLocalStoreData, saveCompanyPassportDetails, updateAccountingClassesEnabled, enableAccountingProjects, resumeEnableAccountingProjects, disableAccountingProjects, clearQboProjectsReconnectRequest,
|
|
569
|
+
export { fetchCompanyPassportView, getCompanyPassportView, getCompanyPassportLocalStoreData, isCompanyPassportDataToBeSaved, companyPassportSaveDataInLocalStore, saveIndustryAndIncDateInCompanyPassportLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, updateCompanyPassportLocalStoreData, saveCompanyPassportDetails, updateAccountingClassesEnabled, enableAccountingProjects, resumeEnableAccountingProjects, disableAccountingProjects, clearQboProjectsReconnectRequest, updateCapitalizationAccountThreshold, dismissCapitalizationOnboarding, clearCompanyView, };
|
|
571
570
|
export { toCompanyPassportLocalData, };
|
|
572
571
|
export { COMPANY_ONBOARDING_INDUSTRY_TYPE_CODES, COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY, COMPANY_PURPOSE_OF_ACCOUNT_CODES, COMPANY_SOURCE_OF_FUNDS_CODES, COMPANY_TRANSACTION_VOLUME_CODES, COMPANY_US_NEXUS_TYPE_CODES, getCompanyOnboardingSubIndustryCodesForIndustry, };
|
|
573
572
|
export { getUncategorizedAccounts, getNestedAccountListHierarchy, };
|
|
@@ -675,7 +674,7 @@ export { cancelAiAccountantOnboarding, clearAiAccountantView, fetchAiAccountantC
|
|
|
675
674
|
export { getAiAccountantCockpitView, } from './view/aiAccountantView/aiAccountantViewSelector';
|
|
676
675
|
export { fetchChatSessionsForUser, createSession, submitQuestion, updateAiCfoViewScrollPosition, updateCurrentInput, updateCotCollapsedState, clearInput, setSession, clearAiCfoView, clearCurrentSessionId, clearDeleteChatSessionStatus, clearLastContextMessage, createSessionAndSubmit, stopSubmit, stopSubmitQuestion, fetchChatHistory, acceptMasterTOS, deleteChatSession, submitFeedback, updateResponseState, fetchSuggestedQuestions, fetchSuggestedQuestionsSuccess, fetchSuggestedQuestionsFailure, fetchSkills, fetchSkillsSuccess, fetchSkillsFailure, applyAiCfoSidePanelHostPageTransition, clearAiCfoSidePanelHostPageContext, } from './view/aiCfoView/aiCfoViewReducer';
|
|
677
676
|
export { getAiCfoView, getSuggestedQuestionsForPageContext, getSkills, } from './view/aiCfoView/aiCfoViewSelector';
|
|
678
|
-
export { setNewSession, setSessions, updateAiCfoAnswerCardPolicyWizardPlan, upsertAnswerPayload, upsertOrAddQuestionAnswerPayload, addQuestionPayload, clearSession, clearAiCfo,
|
|
677
|
+
export { setNewSession, setSessions, updateAiCfoAnswerCardPolicyWizardPlan, upsertAnswerPayload, upsertOrAddQuestionAnswerPayload, addQuestionPayload, clearSession, clearAiCfo, toAiCfoVisualization, appendSyntheticAiCfoAnswer, updateSyntheticAiCfoAnswer, removeSyntheticAiCfoAnswer, clearSyntheticAiCfoAnswers, } from './entity/aiCfo/aiCfoReducer';
|
|
679
678
|
export { getAllQuestionAnswersForChatSession, getQuestionAnswerByIdForChatSession, getAllQuestionsForChatSession, getAiCfoSelectorView, getSyntheticAiCfoAnswersForChatSession, getSyntheticAiCfoAnswerByQuestionAnswerId, } from './entity/aiCfo/aiCfoSelector';
|
|
680
679
|
export { ALL_AI_CFO_CHARTS_TYPES, ALL_AI_CFO_VISUALIZATION_TYPES, ALL_AI_CFO_ANSWER_STATE_TYPES, ALL_AI_CFO_ANSWER_RESPONSE_TYPES, ALL_INTERACTIVE_FORM_TYPES, toAiCfoVisualizationType, toAiCfoVisualizationTypeStrict, toAiCfoChartType, toAiCfoChartTypeStrict, toAiCfoAnswerStateType, toAiCfoAnswerStateTypeStrict, toAiCfoAnswerResponseType, toAiCfoAnswerResponseTypeStrict, toInteractiveFormType, toInteractiveFormTypeStrict, ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS, toMessageSender, toMessageType, } from './entity/aiCfo/aiCfoState';
|
|
681
680
|
// ── Card Policy (shared between manual + AI-driven flows) ────────────
|
|
@@ -736,7 +735,7 @@ export { resetRecordPayment, initializeRecordPaymentDraft, submitRecordPayment,
|
|
|
736
735
|
export { initializeIssueCreditNoteDraft, issueCreditNoteFailure, issueCreditNoteSuccess, resetIssueCreditNote, submitIssueCreditNote, updateIssueCreditNoteFormDraft, } from './view/invoicing/issueCreditNote/issueCreditNoteReducer';
|
|
737
736
|
export { computeIssueCreditNoteTotal, initializeIssueCreditNoteDraftFromInvoice, localDataToIssueCreditNotePayload, } from './view/invoicing/issueCreditNote/issueCreditNotePayload';
|
|
738
737
|
export { INVOICING_CREDIT_NOTE_REASON_CODES, initialIssueCreditNoteFormLocalData, } from './view/invoicing/issueCreditNote/issueCreditNoteFormConfig';
|
|
739
|
-
export { getIssueCreditNoteView } from './view/invoicing/issueCreditNote/issueCreditNoteSelector';
|
|
738
|
+
export { getIssueCreditNoteFormView, getIssueCreditNoteView, } from './view/invoicing/issueCreditNote/issueCreditNoteSelector';
|
|
740
739
|
export { createCreditNoteFailure, createCreditNoteSuccess, resetCreateCreditNote, submitCreateCreditNote, updateCreateCreditNoteFormDraft, } from './view/invoicing/createCreditNote/createCreditNoteReducer';
|
|
741
740
|
export { localDataToCreateCreditNotePayload } from './view/invoicing/createCreditNote/createCreditNotePayload';
|
|
742
741
|
export { initialCreateCreditNoteFormLocalData } from './view/invoicing/createCreditNote/createCreditNoteFormConfig';
|
|
@@ -825,8 +824,8 @@ export { clearAllInvoicingDunningCases, removeInvoicingDunningCase, updateInvoic
|
|
|
825
824
|
export { clearInvoicingDunningCaseListView, fetchInvoicingDunningCaseCounts, fetchInvoicingDunningCaseList, fetchInvoicingDunningCaseListPage, setInvoicingDunningCaseActiveTab, updateInvoicingDunningCaseFilters, } from './view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer';
|
|
826
825
|
export { ALL_INVOICING_DUNNING_CASE_SORT_KEYS, ALL_INVOICING_DUNNING_CASE_TAB_IDS, INVOICING_DUNNING_CASE_COLUMNS, INVOICING_DUNNING_CASE_TABS, } from './view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState';
|
|
827
826
|
export { getInvoicingDunningCaseListView } from './view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector';
|
|
828
|
-
export { clearInvoicingDunningCaseDetailView, fetchInvoicingDunningCaseDetail,
|
|
829
|
-
export { getInvoicingDunningCaseById, getInvoicingDunningCaseDetail,
|
|
827
|
+
export { clearInvoicingDunningCaseDetailView, fetchInvoicingDunningCaseDetail, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer';
|
|
828
|
+
export { getInvoicingDunningCaseById, getInvoicingDunningCaseDetail, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector';
|
|
830
829
|
// ── Invoicing: catalog (plans + products) ─────────────────────────────────────
|
|
831
830
|
export { clearAllInvoicingPlans, mergeInvoicingPlanSubFamily, removeInvoicingPlan, updateInvoicingPlans, } from './entity/invoicing/plan/planReducer';
|
|
832
831
|
export { clearAllInvoicingProducts, removeInvoicingProduct, updateInvoicingProducts, } from './entity/invoicing/product/productReducer';
|
|
@@ -839,7 +838,7 @@ export { getInvoicingPlanById } from './entity/invoicing/plan/planSelector';
|
|
|
839
838
|
export { getInvoicingProductById } from './entity/invoicing/product/productSelector';
|
|
840
839
|
// ── Invoicing: settings ───────────────────────────────────────────────────────
|
|
841
840
|
export { clearInvoicingSettings, connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, resetInvoicingBrandingFormDraft, resetSaveInvoicingSettings, saveInvoicingSettings, submitInvoicingBrandingForm, updateInvoicingBrandingFormDraft, updateInvoicingSettings, } from './view/invoicing/settingsView/settingsViewReducer';
|
|
842
|
-
export { getInvoicingBrandingFormView, getInvoicingSettings, getInvoicingSettingsFetchState,
|
|
841
|
+
export { getInvoicingBrandingFormView, getInvoicingSettings, getInvoicingSettingsFetchState, getInvoicingSettingsView, } from './view/invoicing/settingsView/settingsViewSelector';
|
|
843
842
|
export { INVOICING_BUSINESS_ADDRESS_TYPE, entityToInvoicingBrandingFormLocalData, initialInvoicingBrandingFormLocalData, } from './view/invoicing/settingsView/invoicingBrandingFormConfig';
|
|
844
843
|
export { isStripeConnectedFromSettings } from './view/invoicing/settingsView/invoicingSettingsHelpers';
|
|
845
844
|
// ── Invoicing: QBO integration ────────────────────────────────────────────────
|
|
@@ -31,13 +31,10 @@ const companyHealthMetricConfigView = createSlice({
|
|
|
31
31
|
draft.fetchState = 'Error';
|
|
32
32
|
draft.error = action.payload;
|
|
33
33
|
},
|
|
34
|
-
clearCompanyHealthMetricConfigView() {
|
|
35
|
-
return initialState;
|
|
36
|
-
},
|
|
37
34
|
},
|
|
38
35
|
extraReducers: (builder) => {
|
|
39
36
|
builder.addCase(clearAll, () => initialState);
|
|
40
37
|
},
|
|
41
38
|
});
|
|
42
|
-
export const {
|
|
39
|
+
export const { fetchCompanyHealthMetricConfig, updateCompanyHealthMetricConfig, updateCompanyHealthMetricConfigFailure, } = companyHealthMetricConfigView.actions;
|
|
43
40
|
export default companyHealthMetricConfigView.reducer;
|
|
@@ -377,63 +377,6 @@ const companyView = createSlice({
|
|
|
377
377
|
clearQboProjectsReconnectRequest(draft) {
|
|
378
378
|
draft.passportView.needsQboProjectsReconnect = false;
|
|
379
379
|
},
|
|
380
|
-
updateCompanyProductServices: {
|
|
381
|
-
reducer(draft, action) {
|
|
382
|
-
draft.managementView.productServicesUpdateStatusByCompanyId[action.payload.companyId] = {
|
|
383
|
-
fetchState: 'In-Progress',
|
|
384
|
-
error: undefined,
|
|
385
|
-
};
|
|
386
|
-
},
|
|
387
|
-
prepare(companyId, services) {
|
|
388
|
-
return { payload: { companyId, services } };
|
|
389
|
-
},
|
|
390
|
-
},
|
|
391
|
-
updateCompanyProductServicesSuccess(draft, action) {
|
|
392
|
-
draft.managementView.productServicesUpdateStatusByCompanyId[action.payload.companyId] = {
|
|
393
|
-
fetchState: 'Completed',
|
|
394
|
-
error: undefined,
|
|
395
|
-
};
|
|
396
|
-
},
|
|
397
|
-
updateCompanyProductServicesFailure: {
|
|
398
|
-
reducer(draft, action) {
|
|
399
|
-
draft.managementView.productServicesUpdateStatusByCompanyId[action.payload.companyId] = {
|
|
400
|
-
fetchState: 'Error',
|
|
401
|
-
error: action.payload.status,
|
|
402
|
-
};
|
|
403
|
-
},
|
|
404
|
-
prepare(companyId, status) {
|
|
405
|
-
return { payload: { companyId, status } };
|
|
406
|
-
},
|
|
407
|
-
},
|
|
408
|
-
updateCompanyQboRealmId: {
|
|
409
|
-
reducer(draft, action) {
|
|
410
|
-
draft.managementView.qboRealmIdUpdateStatusByCompanyId[action.payload.companyId] = {
|
|
411
|
-
fetchState: 'In-Progress',
|
|
412
|
-
error: undefined,
|
|
413
|
-
};
|
|
414
|
-
},
|
|
415
|
-
// qboRealmId omitted -> reset (the epic sends null); a value -> update.
|
|
416
|
-
prepare(companyId, qboRealmId) {
|
|
417
|
-
return { payload: { companyId, qboRealmId } };
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
updateCompanyQboRealmIdSuccess(draft, action) {
|
|
421
|
-
draft.managementView.qboRealmIdUpdateStatusByCompanyId[action.payload.companyId] = {
|
|
422
|
-
fetchState: 'Completed',
|
|
423
|
-
error: undefined,
|
|
424
|
-
};
|
|
425
|
-
},
|
|
426
|
-
updateCompanyQboRealmIdFailure: {
|
|
427
|
-
reducer(draft, action) {
|
|
428
|
-
draft.managementView.qboRealmIdUpdateStatusByCompanyId[action.payload.companyId] = {
|
|
429
|
-
fetchState: 'Error',
|
|
430
|
-
error: action.payload.status,
|
|
431
|
-
};
|
|
432
|
-
},
|
|
433
|
-
prepare(companyId, status) {
|
|
434
|
-
return { payload: { companyId, status } };
|
|
435
|
-
},
|
|
436
|
-
},
|
|
437
380
|
updateCapitalizationAccountThreshold: {
|
|
438
381
|
prepare(companyId, accountId, threshold, dismissOnboardingForAccount, allOverrides) {
|
|
439
382
|
return {
|
|
@@ -757,5 +700,5 @@ const companyView = createSlice({
|
|
|
757
700
|
});
|
|
758
701
|
},
|
|
759
702
|
});
|
|
760
|
-
export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure, updateAccountingClassesEnabled, updateAccountingClassesEnabledSuccess, updateAccountingClassesEnabledFailure,
|
|
703
|
+
export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure, updateAccountingClassesEnabled, updateAccountingClassesEnabledSuccess, updateAccountingClassesEnabledFailure, enableAccountingProjects, resumeEnableAccountingProjects, disableAccountingProjects, updateAccountingProjectsEnabledSuccess, updateAccountingProjectsEnabledFailure, requestQboProjectsReconnect, clearQboProjectsReconnectRequest, updateCapitalizationAccountThreshold, updateCapitalizationAccountThresholdSuccess, updateCapitalizationAccountThresholdFailure, dismissCapitalizationOnboarding, companyPassportUpdatePrimaryContact, companyPassportUpdatePrimaryContactSuccess, companyPassportUpdatePrimaryContactFailure, companyPassportUpdateCompanyOfficer, companyPassportUpdateCompanyOfficerSuccess, companyPassportUpdateCompanyOfficerFailure, companyPassportCreateCompanyOfficers, companyPassportCreateCompanyOfficersSuccess, companyPassportCreateCompanyOfficersFailure, updateCompanyPassportLocalStoreData, saveIndustryAndIncDateInCompanyPassportLocalStore, saveCompanyPassportDetails, fetchParentSubsidiaryManagementView, updateParentSubsidiaryView, updateParentSubsidiaryViewOnFailure, updateCompanyDownloadState, fetchCompanyMetaData, updateCompanyMetaDataOnSuccess, updateCompanyMetaDataOnFailure, updateMetaDataOnSendMonthEndReport, } = companyView.actions;
|
|
761
704
|
export default companyView.reducer;
|
|
@@ -2,7 +2,6 @@ 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';
|
|
6
5
|
import { customerRatingValues, teamRatingValues, } from '../../../entity/customerSatisfaction/customerSatisfactionState';
|
|
7
6
|
import { getUserByUserId, getUserName, getUserNameById, } from '../../../entity/user/userSelector';
|
|
8
7
|
import { date as zeniDate } from '../../../zeniDayJS';
|
|
@@ -123,29 +122,6 @@ const getCategoryValueForCompany = (key, company) => {
|
|
|
123
122
|
if (key === 'annualRecurringRevenue' || key === 'monthlyRecurringRevenue') {
|
|
124
123
|
return company.primarySubscription?.summary.summary[key].amount.toString();
|
|
125
124
|
}
|
|
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
|
-
}
|
|
149
125
|
return company.company.company.managementInfo[key];
|
|
150
126
|
};
|
|
151
127
|
const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredCompanies = [], index = 0) => {
|
|
@@ -216,8 +192,6 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
216
192
|
updatedCompanies.forEach((company) => {
|
|
217
193
|
switch (sortKey) {
|
|
218
194
|
case 'companyName':
|
|
219
|
-
case 'productVerticals':
|
|
220
|
-
case 'realmId':
|
|
221
195
|
companiesWithSortKeyValue.push(company);
|
|
222
196
|
break;
|
|
223
197
|
case 'status':
|
|
@@ -453,12 +427,6 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
453
427
|
primarySortValue = (company.company.company.companyInfo.bookCloseDate ??
|
|
454
428
|
zeniDate('1970-01-01T00:00:00.000Z')).valueOf();
|
|
455
429
|
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;
|
|
462
430
|
case 'status':
|
|
463
431
|
default: {
|
|
464
432
|
isMultiSortApplicable = true;
|
|
@@ -512,23 +480,3 @@ export const getTotalRecurringRevenue = (companies) => companies.reduce((prev, c
|
|
|
512
480
|
currencySymbol: '',
|
|
513
481
|
},
|
|
514
482
|
});
|
|
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
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
2
|
const ALL_PORTFOLIO_SORT_KEYS = [
|
|
3
3
|
'companyName',
|
|
4
4
|
'cashBalance',
|
|
@@ -13,8 +13,6 @@ const ALL_MANAGEMENT_SORT_KEYS = [
|
|
|
13
13
|
'status',
|
|
14
14
|
'group',
|
|
15
15
|
'plans',
|
|
16
|
-
'productVerticals',
|
|
17
|
-
'realmId',
|
|
18
16
|
'controller',
|
|
19
17
|
'customerSuccessManager',
|
|
20
18
|
'reviewer',
|
|
@@ -85,13 +83,3 @@ export const MANAGEMENT_STATUS_CODES = [
|
|
|
85
83
|
'terminated',
|
|
86
84
|
];
|
|
87
85
|
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,8 +19,6 @@ export function getCompanyManagementPendingUpdates(companyId, state) {
|
|
|
19
19
|
export const initialCompanyManagementView = {
|
|
20
20
|
...initialCommonState,
|
|
21
21
|
updatesByCompanyId: {},
|
|
22
|
-
productServicesUpdateStatusByCompanyId: {},
|
|
23
|
-
qboRealmIdUpdateStatusByCompanyId: {},
|
|
24
22
|
uiState: {
|
|
25
23
|
sortKey: 'status',
|
|
26
24
|
sortOrder: 'ascending',
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { of } 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';
|
|
6
4
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
5
|
import { localDataToCreateCreditNotePayload, } from './createCreditNotePayload';
|
|
8
6
|
import { createCreditNoteFailure, createCreditNoteSuccess, submitCreateCreditNote, } from './createCreditNoteReducer';
|
|
@@ -17,29 +15,9 @@ export const createCreditNoteEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
17
15
|
return [
|
|
18
16
|
updateInvoicingCreditNotes([response.data], 'merge'),
|
|
19
17
|
createCreditNoteSuccess({ creditNoteId: response.data.id }),
|
|
20
|
-
openSnackbar({
|
|
21
|
-
messageSection: 'invoicing_credit_note_saved',
|
|
22
|
-
messageText: 'success',
|
|
23
|
-
type: 'success',
|
|
24
|
-
}),
|
|
25
18
|
];
|
|
26
19
|
}
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
])));
|
|
20
|
+
return of(createCreditNoteFailure(response.status));
|
|
21
|
+
}), catchError((error) => of(createCreditNoteFailure(createZeniAPIStatus('Unexpected Error', 'Create credit note REST API call errored out ' +
|
|
22
|
+
JSON.stringify(error))))));
|
|
45
23
|
}));
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { of } 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';
|
|
8
6
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
9
7
|
import { addInvoiceToList } from '../invoiceList/invoiceListReducer';
|
|
10
8
|
import { createInvoice, createInvoiceFailure, createInvoiceSuccess, } from './createInvoiceReducer';
|
|
@@ -24,29 +22,9 @@ export const createInvoiceEpic = (actions$, _state$, zeniAPI) => actions$.pipe(f
|
|
|
24
22
|
status: response.data.status,
|
|
25
23
|
}),
|
|
26
24
|
createInvoiceSuccess({ invoiceId: response.data.id }),
|
|
27
|
-
openSnackbar({
|
|
28
|
-
messageSection: 'invoicing_invoice_saved',
|
|
29
|
-
messageText: 'success',
|
|
30
|
-
type: 'success',
|
|
31
|
-
}),
|
|
32
25
|
];
|
|
33
26
|
}
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
])));
|
|
27
|
+
return of(createInvoiceFailure(response.status));
|
|
28
|
+
}), catchError((error) => of(createInvoiceFailure(createZeniAPIStatus('Unexpected Error', 'Create invoice REST API call errored out ' +
|
|
29
|
+
JSON.stringify(error))))));
|
|
52
30
|
}));
|
|
@@ -1,52 +1,25 @@
|
|
|
1
|
-
import { getAddressByAddressId } from '../../../entity/address/addressSelector';
|
|
2
1
|
import { getInvoicingCatalogListView, getInvoicingCatalogPrices, } from '../invoicingCatalogListView/invoicingCatalogListViewSelector';
|
|
3
2
|
import { getInvoicingCustomerListView } from '../invoicingCustomerListView/invoicingCustomerListViewSelector';
|
|
4
3
|
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
|
-
};
|
|
24
4
|
/**
|
|
25
5
|
* Single bundled view for the create-invoice screen — web-ui consumes only this.
|
|
26
6
|
* Carries the form draft (`localData`), the option sources the form needs
|
|
27
|
-
* (
|
|
28
|
-
*
|
|
29
|
-
*
|
|
7
|
+
* (customers, catalog plans/products, settings), the create-invoice fetch
|
|
8
|
+
* state/error, and the id of the invoice last created (`savedInvoiceId`, to
|
|
9
|
+
* navigate on success). Returns raw entity lists; the screen maps them to its
|
|
10
|
+
* option shapes.
|
|
30
11
|
*/
|
|
31
12
|
export const getCreateInvoiceFormView = (state) => {
|
|
32
13
|
const createInvoiceState = state.invoicingCreateInvoiceState;
|
|
33
14
|
const catalogListView = getInvoicingCatalogListView(state);
|
|
15
|
+
const plans = getInvoicingCatalogPrices(catalogListView.plans);
|
|
34
16
|
return {
|
|
35
|
-
customers: getInvoicingCustomerListView(state).customers
|
|
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
|
-
})),
|
|
17
|
+
customers: getInvoicingCustomerListView(state).customers,
|
|
43
18
|
localData: createInvoiceState.formDraft,
|
|
44
|
-
planNames:
|
|
45
|
-
.
|
|
46
|
-
.
|
|
47
|
-
|
|
48
|
-
subFamilyName: subFamily.name ?? '',
|
|
49
|
-
}))),
|
|
19
|
+
planNames: plans
|
|
20
|
+
.map((plan) => plan.name ?? '')
|
|
21
|
+
.filter((name) => name !== ''),
|
|
22
|
+
plans,
|
|
50
23
|
products: getInvoicingCatalogPrices(catalogListView.products),
|
|
51
24
|
savedInvoiceId: createInvoiceState.createdInvoiceId,
|
|
52
25
|
settings: getInvoicingSettings(state),
|
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
-
import {
|
|
5
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
5
|
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
|
-
};
|
|
14
6
|
export const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingDiscountAction.match), mergeMap((action) => {
|
|
15
7
|
const { action: kind, id } = action.payload;
|
|
16
8
|
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
|
-
];
|
|
29
9
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/discounts/${encodeURIComponent(id)}/actions`;
|
|
30
10
|
return zeniAPI
|
|
31
11
|
.postAndGetJSON(apiUrl, requestBody)
|
|
@@ -34,22 +14,15 @@ export const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => ac
|
|
|
34
14
|
return [
|
|
35
15
|
updateInvoicingCoupons([response.data], 'merge'),
|
|
36
16
|
runInvoicingDiscountActionSuccess({ id }),
|
|
37
|
-
...snackbar('success'),
|
|
38
17
|
];
|
|
39
18
|
}
|
|
40
|
-
return
|
|
41
|
-
|
|
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)),
|
|
19
|
+
return of(runInvoicingDiscountActionFailure({
|
|
20
|
+
error: response.status,
|
|
51
21
|
id,
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
22
|
+
}));
|
|
23
|
+
}), catchError((error) => of(runInvoicingDiscountActionFailure({
|
|
24
|
+
error: createZeniAPIStatus('Unexpected Error', 'Discount action REST API call errored out ' +
|
|
25
|
+
JSON.stringify(error)),
|
|
26
|
+
id,
|
|
27
|
+
}))));
|
|
55
28
|
}));
|
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingDunningCases } from '../../../entity/invoicing/dunningCase/dunningCaseReducer';
|
|
4
|
-
import {
|
|
5
|
-
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
5
|
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
|
-
};
|
|
16
6
|
export const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingDunningAction.match), mergeMap((action) => {
|
|
17
7
|
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
|
-
];
|
|
30
8
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/dunning/${encodeURIComponent(id)}/${kind}`;
|
|
31
9
|
return zeniAPI
|
|
32
10
|
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
@@ -35,22 +13,15 @@ export const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => act
|
|
|
35
13
|
return [
|
|
36
14
|
updateInvoicingDunningCases([response.data], 'merge'),
|
|
37
15
|
runInvoicingDunningActionSuccess({ id }),
|
|
38
|
-
...snackbar('success'),
|
|
39
16
|
];
|
|
40
17
|
}
|
|
41
|
-
return
|
|
42
|
-
|
|
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)),
|
|
18
|
+
return of(runInvoicingDunningActionFailure({
|
|
19
|
+
error: response.status,
|
|
52
20
|
id,
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
21
|
+
}));
|
|
22
|
+
}), catchError((error) => of(runInvoicingDunningActionFailure({
|
|
23
|
+
error: createZeniAPIStatus('Unexpected Error', 'Dunning action REST API call errored out ' +
|
|
24
|
+
JSON.stringify(error)),
|
|
25
|
+
id,
|
|
26
|
+
}))));
|
|
56
27
|
}));
|
package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js
CHANGED
|
@@ -116,21 +116,17 @@ 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);
|
|
120
119
|
const payload = {
|
|
121
120
|
currency_code: 'USD',
|
|
122
121
|
free_quantity: Number(values.freeQuantity) || 0,
|
|
123
122
|
is_taxable: true,
|
|
124
123
|
item_id: itemId,
|
|
125
124
|
name,
|
|
126
|
-
price:
|
|
125
|
+
price: values.priceDollars?.amount ?? 0,
|
|
127
126
|
price_code: priceCode,
|
|
128
127
|
pricing_model: values.pricingModel || 'flat_fee',
|
|
129
128
|
show_description_in_invoices: true,
|
|
130
129
|
};
|
|
131
|
-
if (tiered) {
|
|
132
|
-
payload.tiers = (values.tiers ?? []).map(tierToPayload);
|
|
133
|
-
}
|
|
134
130
|
const description = trimOrUndefined(values.description);
|
|
135
131
|
if (description != null) {
|
|
136
132
|
payload.description = description;
|
|
@@ -80,8 +80,6 @@ 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';
|
|
85
83
|
/**
|
|
86
84
|
* Build the parent catalog-item request body from the form draft. Creates omit
|
|
87
85
|
* both parent and sub-family IDs; edits retain returned sub-family IDs.
|
|
@@ -103,9 +101,10 @@ export const localDataToSaveInvoicingCatalogItemPayload = (localData, isCreate)
|
|
|
103
101
|
if (description != null) {
|
|
104
102
|
itemPayload.description = description;
|
|
105
103
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
const unit = trimOrUndefined(localData.unit);
|
|
105
|
+
if (unit != null) {
|
|
106
|
+
itemPayload.unit = unit;
|
|
107
|
+
}
|
|
109
108
|
if (localData.itemApplicability === 'restricted' &&
|
|
110
109
|
localData.applicableItems.length > 0) {
|
|
111
110
|
itemPayload.applicable_items = localData.applicableItems;
|