@zeniai/client-epic-state 5.2.74 → 5.2.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/invoicing/coupon/couponSelector.d.ts +1 -0
- package/lib/entity/invoicing/coupon/couponSelector.js +5 -0
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -0
- package/lib/esm/entity/invoicing/coupon/couponSelector.js +4 -0
- package/lib/esm/epic.js +2 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +55 -0
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +35 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +53 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionEstimateEpic.js +49 -0
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +18 -13
- package/lib/index.d.ts +3 -3
- package/lib/index.js +7 -5
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.d.ts +46 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +57 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.d.ts +10 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +36 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +20 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +55 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +58 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionEstimateEpic.d.ts +7 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionEstimateEpic.js +53 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +8 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +21 -14
- package/package.json +1 -1
|
@@ -2,3 +2,4 @@ import { ID } from '../../../commonStateTypes/common';
|
|
|
2
2
|
import { InvoicingCoupon, InvoicingCouponState } from './couponState';
|
|
3
3
|
export declare function getInvoicingCouponsByIds(couponState: InvoicingCouponState, ids: ID[]): InvoicingCoupon[];
|
|
4
4
|
export declare function getInvoicingCouponById(couponState: InvoicingCouponState, id: ID): InvoicingCoupon | undefined;
|
|
5
|
+
export declare function getInvoicingCouponByCode(couponState: InvoicingCouponState, couponCode: string): InvoicingCoupon | undefined;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getInvoicingCouponsByIds = getInvoicingCouponsByIds;
|
|
7
7
|
exports.getInvoicingCouponById = getInvoicingCouponById;
|
|
8
|
+
exports.getInvoicingCouponByCode = getInvoicingCouponByCode;
|
|
8
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
10
|
function getInvoicingCouponsByIds(couponState, ids) {
|
|
10
11
|
return ids
|
|
@@ -14,3 +15,7 @@ function getInvoicingCouponsByIds(couponState, ids) {
|
|
|
14
15
|
function getInvoicingCouponById(couponState, id) {
|
|
15
16
|
return (0, get_1.default)(couponState.couponByID, id);
|
|
16
17
|
}
|
|
18
|
+
// Forms hold a coupon by its code; the store keys coupons by id.
|
|
19
|
+
function getInvoicingCouponByCode(couponState, couponCode) {
|
|
20
|
+
return Object.values(couponState.couponByID).find((coupon) => coupon.couponCode === couponCode);
|
|
21
|
+
}
|
package/lib/epic.d.ts
CHANGED
|
@@ -272,6 +272,7 @@ import { ActionType as EditInvoicingCustomerDetailViewActionType } from './view/
|
|
|
272
272
|
import { ActionType as InvoicingCustomerFormDraftSeedActionType } from './view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic';
|
|
273
273
|
import { ActionType as InvoicingSubscriptionDetailFetchActionType } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionDetailEpic';
|
|
274
274
|
import { ActionType as InvoicingSubscriptionDetailPageActionType } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionDetailPageEpic';
|
|
275
|
+
import { ActionType as InvoicingSubscriptionEstimateActionType } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionEstimateEpic';
|
|
275
276
|
import { ActionType as InvoicingSubscriptionFormPageActionType } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic';
|
|
276
277
|
import { ActionType as InvoicingSubscriptionActionActionType } from './view/invoicing/editInvoicingSubscriptionDetailView/runInvoicingSubscriptionActionEpic';
|
|
277
278
|
import { ActionType as EditInvoicingSubscriptionDetailViewActionType } from './view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic';
|
|
@@ -704,5 +705,5 @@ import { ActionType as FetchDepositAccStatementListActionType } from './view/zen
|
|
|
704
705
|
import { ActionType as FetchZeniAccStatePageActionType } from './view/zeniAccStatementList/fetchZeniAccStatementPageEpic';
|
|
705
706
|
import { ActionType as ApproveOAuthConsentActionType } from './view/zeniOAuthView/epics/approveOAuthConsentEpic';
|
|
706
707
|
/** Root action type is union of all the epic action type */
|
|
707
|
-
export type RootActionType = AcceptBillPayTermsActionType | AcceptBillPayUpdatedTermsActionType | AcceptChargeCardTermsActionType | AcceptEmployeeRemiTermsActionType | AcceptMasterTOSEpicActionType | AcceptRemiTermsActionType | AcceptTreasuryTermsActionType | AcceptZeniAccountTermsActionType | AcknowledgeOnboardingAiActivationViewedActionType | AcknowledgeOnboardingAiFinanceTeamActionType | AddCardPaymentSourceActionType | ApplyBillRecommendationsToLocalStoreActionType | ApplyExtractedPolicyToDraftActionType | ApproveOAuthConsentActionType | ApproveOrRejectBillActionType | ApproveOrRejectBillsBulkActionActionType | ApproveOrRejectRemiActionType | ApproveOrRejectRemisBulkActionActionType | ApproveVendorGlobalReviewActionType | ArchiveCardPolicyActionType | ArchiveTaskActionType | BackgroundRefetchReviewTabActionType | BalanceSheetActionType | BalanceSheetClassesViewActionType | BalanceSheetForTimeframeActionType | BalanceSheetForTimeframeClassesViewActionType | BalanceSheetForTimeframeProjectViewActionType | BalanceSheetProjectViewActionType | BulkUpdateTasksListActionType | BulkUploadMatchResultToastActionType | BulkUploadReceiptsActionType | CancelAiAccountantOnboardingActionType | CancelAndDeleteBillActionType | CancelAndDeleteRemiActionType | CancelOrDeleteBillsBulkActionActionType | CancelOrDeleteRemisBulkActionActionType | CancelScheduleAccruedJournalEntryActionType | CardBalanceActionType | CashBalanceActionType | CashFlowActionType | CashFlowClassesViewActionType | CashFlowForTimeframeActionType | CashFlowForTimeframeClassesViewActionType | CashFlowForTimeframeProjectViewActionType | CashFlowProjectViewActionType | CashInCashOutActionType | CashPositionActionType | ChangeZeniPersonRolesActionType | CheckDepositActionType | CloseChargeCardActionType | CloseChargeCardsActionType | CombinedStatementActionType | CompanyManagementSavePendingUpdatesActionType | CompanyManagementSaveUpdatesActionType | ConfirmBulkUploadMatchActionType | ConfirmCardSetupIntentActionType | ConfirmStatementMappingActionType | CreateAddressActionType | CreateAutoTransferRuleActionType | CreateBankAccountActionType | CreateCardPolicyTemplateActionType | CreateCardSetupIntentActionType | CreateCheckingAccountActionType | CreateCompanyAddressActionType | CreateCompanyOfficersActionType | CreateCompanyUserAddressActionType | CreateGlobalMerchantActionType | CreateInternationalBankAccountActionType | CreateInvoiceActionType | CreateNewSchedulesAccruedActionType | CreateNewSchedulesActionType | CreateNewTaskGroupActionType | CreateOneTimeAccrualActionType | CreatePaymentInstrumentActionType | CreateSessionActionType | CreateSessionAndSubmitActionType | CreateSubTaskActionType | CreateTagActionType | CreateTaskFromTaskGroupTemplateActionType | CreateTransferEntryActionType | CreateUserBankAccountActionType | CurrencyConversionActionType | DeleteAccountStatementActionType | DeleteAutoTransferRuleActionType | DeleteBankAccountActionType | DeleteBillActionType | DeleteBillPayApprovalRuleActionType | DeleteCannedResponseActionType | DeleteChatSessionActionType | DeleteCombinedStatementActionType | DeleteFileActionType | DeleteFileListActionType | DeleteInternationalBankAccountActionType | DeletePaymentInstrumentActionType | DeletePersonActionType | DeleteRemiActionType | DeleteRemiApprovalRuleActionType | DeleteScheduleAccruedDetailActionType | DeleteScheduleDetailActionType | DeleteTagActionType | DeleteTaskActionType | DeleteTaskGroupActionType | DeleteTransactionAttachmentActionType | DeleteUserBankAccountActionType | DepositAccountTransactionListActionType | DisableAccountingProjectsActionType | DismissCapitalizationOnboardingActionType | DoMagicLinkSignInActionType | DownloadAccountingProviderAttachmentActionType | DragNDropTasksActionType | EditInvoicingCatalogItemDetailViewActionType | EditInvoicingCouponDetailViewActionType | EditInvoicingCustomerDetailViewActionType | EditInvoicingSubscriptionDetailViewActionType | EnableAccountingProjectsActionType | EnableChargeCardAutoPayActionType | EnableSetupActionType | EstablishOnboardingPlaidConnectionActionType | EstablishPlaidConnectionActionType | ExcludeAccountFromReconciliationActionType | ExpressInterestChargeCardActionType | ExpressPayActionType | ExtractPolicyDocumentActionType | FetchAccountHistoryActionType | FetchAccountListActionType | FetchAccountListForAccountTypesActionType | FetchAccountSettingsListForAccountTypesActionType | FetchAccruedScheduleListActionType | FetchActiveTenantActionType | FetchAddressActionType | FetchAggregatedReportActionType | FetchAiAccountantCustomersActionType | FetchAiAccountantJobsActionType | FetchAiAgentsActivationStatusActionType | FetchAllCockpitViewsActionType | FetchAllExpenseAutomationTabsActionType | FetchAllPeopleRequiredActionType | FetchAllTagsActionType | FetchAllTaskGroupsActionType | FetchAllTenantsActionType | FetchApAgingActionType | FetchApAgingDetailActionType | FetchArAgingActionType | FetchArAgingDetailActionType | FetchAuditReportGroupViewActionType | FetchAuditRuleGroupViewActionType | FetchAutoTransferReviewDetailActionType | FetchAutoTransferRuleHistoryActionType | FetchAutoTransferRulesActionType | FetchBankAccountsListActionType | FetchBankConnectionsViewActionType | FetchBankCountryNameByIbanActionType | FetchBankNameByRoutingActionType | FetchBankNameBySwiftActionType | FetchBillAndInitializeLocalStoreActionType | FetchBillDetailActionType | FetchBillingAccountsListActionType | FetchBillListActionType | FetchBillListPerTabActionType | FetchBillPayApproversDetailsActionType | FetchBillPayApproversListActionType | FetchBillPayCardActionType | FetchBillPayConfigActionType | FetchBillPaySetupApproverViewActionType | FetchBillPaySetupViewActionType | FetchBillRecommendationsActionType | FetchBulkUploadBatchDetailsActionType | FetchBulkUploadBatchesActionType | FetchCannedResponsesActionType | FetchCardPolicyDetailActionType | FetchCardPolicyListActionType | FetchCardPolicyMccCategoriesActionType | FetchCardPolicyVendorOptionsActionType | FetchCardProfilesActionType | FetchCashbackDetailActionType | FetchChargeCardConfigActionType | FetchChargeCardDetailActionType | FetchChargeCardDetailPageActionType | FetchChargeCardListActionType | FetchChargeCardListPageActionType | FetchChargeCardPaymentHistoryActionType | FetchChargeCardPaymentPageActionType | FetchChargeCardRepaymentDetailActionType | FetchChargeCardSetupViewActionType | FetchChargeCardsRecurringExpensesActionType | FetchChargeCardStatementListActionType | FetchChargeCardTransactionAttachmentsActionType | FetchChargeCardTransactionListActionType | FetchChargeCardTransactionStatisticsActionType | FetchChatHistoryActionType | FetchChatSessionsForUserActionType | FetchClassListActionType | FetchCockpitContextActionType | FetchCollaborationAuthTokenActionType | FetchCompanyBillingAddressActionType | FetchCompanyConfigActionType | FetchCompanyHealthMetricConfigViewEpicActionType | FetchCompanyHealthMetricViewEpicActionType | FetchCompanyManagementActionType | FetchCompanyMetaDataActionType | FetchCompanyMonthEndReportHistoricDataActionType | FetchCompanyMonthEndReportHistoricDatesActionType | FetchCompanyMonthEndReportTemplatesActionType | FetchCompanyMonthEndReportViewActionType | FetchCompanyOnboardingViewActionType | FetchCompanyPassportViewActionType | FetchCompanyPortfolioActionType | FetchCompanyTaskManagerViewActionType | FetchCompletedTransactionsActionType | FetchCreateInvoiceFormPageActionType | FetchCreditAccountActionType | FetchCreditAccountRepaymentActionType | FetchCreditAgentMacroActionType | FetchCurrencyConversionValueActionType | FetchDashboardActionType | FetchDashboardLayoutActionType | FetchDebitCardSummaryActionType | FetchDepositAccountActionType | FetchDepositAccountDetailActionType | FetchDepositAccountLimitActionType | FetchDepositAccountListActionType | FetchDepositAccountListForCardsActionType | FetchDepositAccStatementListActionType | FetchDownloadSchedulesActionType | FetchDuplicateBillActionType | FetchDuplicateReimbursementEpicActionType | FetchEditBillDetailPageActionType | FetchEditRemiDetailPageActionType | FetchEligibleActionsForBillActionType | FetchEntityAutoCompleteActionType | FetchEntityHistoryActionType | FetchEntityRecommendationsByTransactionIdActionType | FetchEntityRecommendationsForLineUpdateActionType | FetchExcludedResourcesActionType | FetchExpenseAutomationActualMatchingActionType | FetchExpenseAutomationActualMatchingMatchActionType | FetchExpenseAutomationActualMatchingPageActionType | FetchExpenseAutomationFailedJePostingsActionType | FetchExpenseAutomationFluxAnalysisActionType | FetchExpenseAutomationInitializeTransactionCategorizationViewLocalDataActionType | FetchExpenseAutomationJEScheduleActionType | FetchExpenseAutomationJESchedulePageActionType | FetchExpenseAutomationMarkTransactionAsNotMiscategorizedActionType | FetchExpenseAutomationMissingReceiptsActionType | FetchExpenseAutomationReconciliationsViewActionType | FetchExpenseAutomationSaveTransactionCategorizationActionType | FetchExpenseAutomationTransactionCategorizationActionType | FetchExpenseAutomationTransactionCategorizationViewActionType | FetchExpenseAutomationUpdateTransactionCategorizationEpicActionType | FetchExpenseTrendActionType | FetchExternalConnectionsActionType | FetchFileActionType | FetchFileListActionType | FetchForecastListActionType | FetchGlobalMerchantAutoCompleteActionType | FetchGlobalMerchantRecommendationActionType | FetchIncomeTrendActionType | FetchInternationalWireDynamicFormActionType | FetchIntlVerificationFormActionType | FetchInvoiceCountsActionType | FetchInvoiceDetailActionType | FetchInvoiceKPIsActionType | FetchInvoiceListActionType | FetchInvoiceListPageActionType | FetchIssueCardPageActionType | FetchMagicLinkBankNameByRoutingActionType | FetchMagicLinkBankNameBySwiftActionType | FetchMagicLinkBillActionType | FetchMagicLinkTenantActionType | FetchManagementActionType | FetchMerchantListActionType | FetchMonthClosePerformanceTrendActionType | FetchMonthEndCloseChecksActionType | FetchMoreBatchDetailsActionType | FetchMultipleBatchDetailsActionType | FetchMyProfileActionType | FetchMyProfileViewActionType | FetchNetBurnOrIncomeStoryCardActionType | FetchNetBurnOrIncomeWithForecastActionType | FetchNotificationSettingsActionType | FetchNotificationSettingsViewActionType | FetchNotificationUnreadCountActionType | FetchNotificationViewActionType | FetchOnboardingActionType | FetchOnboardingCompletedCompaniesActionType | FetchOnboardingCustomerSetupViewActionType | FetchOnboardingCustomerViewActionType | FetchOneTimeAccrualActionType | FetchOpExWithForecastActionType | FetchOwnerListActionType | FetchParentSubsidiaryManagementActionType | FetchPaymentAccountBalanceActionType | FetchPaymentAccountListActionType | FetchPaymentSourcesActionType | FetchPortfolioActionType | FetchPortfolioAllocationActionType | FetchPreviousBillsActionType | FetchProjectListActionType | FetchQBOConnectionPoolActionType | FetchRecommendationByEntityIdActionType | FetchRecommendationByEntityNameActionType | FetchRecommendationsAndUpdateMerchantRecommendationsActionType | FetchRecommendationsAndUpdateVendorRecommendationsActionType | FetchRecommendedBillExpenseActionType | FetchReferralsActionType | FetchRegisteredInterestsActionType | FetchReimbursementCardActionType | FetchReimbursementConfigActionType | FetchRemiAndInitializeLocalStoreActionType | FetchRemiApproversDetailsActionType | FetchRemiApproversListActionType | FetchRemiDetailActionType | FetchRemiListActionType | FetchRemiListPerTabActionType | FetchRemiSetupApproverViewActionType | FetchRemiSetupViewActionType | FetchRevenueWithForecastActionType | FetchReviewCompanyActionType | FetchReviewTransferDetailActionType | FetchRewardsPlanActionType | FetchScheduleAccruedDetailsActionType | FetchScheduleAccruedDetailsPageActionType | FetchScheduleDetailsActionType | FetchScheduleDetailsPageActionType | FetchScheduleListActionType | FetchSchedulesListActionType | FetchSkillsActionType | FetchSubscriptionActionType | FetchSubscriptionAddOnsActionType | FetchSubscriptionCouponsActionType | FetchSubscriptionCreateEstimateActionType | FetchSubscriptionDetailsActionType | FetchSubscriptionListActionType | FetchSubscriptionPlansActionType | FetchSubscriptionSummaryForTenantActionType | FetchSubscriptionUpdateEstimateActionType | FetchSubTasksActionType | FetchSuggestedQuestionsActionType | FetchTaskDetailActionType | FetchTaskDetailPageActionType | FetchTaskGroupTemplatesActionType | FetchTaskHistoryActionType | FetchTaskListActionType | FetchTaskListPageActionType | FetchTaskManagerMetricsActionType | FetchTasksCardActionType | FetchTransactionActivityLogActionType | FetchTransactionDetailActionType | FetchTransactionListByAccountActionType | FetchTransactionListByClassActionType | FetchTransactionListByEntityActionType | FetchTransactionListByProjectActionType | FetchTransactionsForEntityActionType | FetchTransactionsListByCategoryTypeActionType | FetchTransferAccountsActionType | FetchTreasuryDetailActionType | FetchTreasuryFundsActionType | FetchTreasuryHistoryActionType | FetchTreasurySetupViewActionType | FetchTreasuryStatementListActionType | FetchTreasuryTaxLetterListActionType | FetchTreasuryTransactionListActionType | FetchTrendForEntityActionType | FetchUserDetailActionType | FetchUserFinancialAccountActionType | FetchUserListByTypeActionType | FetchUserRoleConfigActionType | FetchVendor1099TypeListActionType | FetchVendorActionType | FetchVendorAndUpdateBillLocalDataActionType | FetchVendorByNameAndParseInvoiceActionType | FetchVendorDetailsActionType | FetchVendorFirstReviewAttachmentsActionType | FetchVendorFirstReviewViewActionType | FetchVendorGlobalReviewViewActionType | FetchVendorsActionType | FetchVendorsFiling1099ActionType | FetchVendorsFiling1099AllActionType | FetchVendorsFiling1099DownloadActionType | FetchVendorTabViewActionType | FetchVendorTypeListActionType | FetchZeniAccountListPageActionType | FetchZeniAccountsConfigActionType | FetchZeniAccountSetupViewActionType | FetchZeniAccStatePageActionType | FetchZeniUsersActionType | GetOnboardingEmailGroupActionType | GetOnboardingPlaidLinkTokenActionType | GetPaymentAccountsActionType | GetPlaidLinkTokenActionType | IgnoreActualMatchingSuggestionActionType | IgnoreExpenseAutomationJEScheduleActionType | ImproveUsingZeniGPTActionType | IncludeAccountInReconciliationActionType | InitialiseExpenseAutomationLocalDataForSelectedAccountIdActionType | InitializeAccountMappingViewActionType | InitializeAccountSettingsViewEpicActionType | InitializeBillPaySetupApproverViewUpdateDataActionType | InitializeBillToLocalStoreActionType | InitializeCardUserOnboardingLocalDataActionType | InitializeCompanyHealthMetricViewLocalDataEpicActionType | InitializeEditPersonActionType | InitializeExpenseAutomationJeScheduleLocalDataActionType | InitializeInternationalWireLocalDataActionType | InitializeIntlVerificationFormEpicActionType | InitializeMyProfileLocalDataActionType | InitializeNewScheduleActionType | InitializeOnboardingCustomerViewUpdateDataActionType | InitializeRemiSetupApproverViewUpdateDataActionType | InitializeRemiToLocalStoreActionType | InitializeScheduleAccruedDetailLocalDataActionType | InitializeScheduleDetailLocalDataActionType | InitializeSubscriptionLocalDataActionType | InitializeTaskToLocalStoreActionType | InitializeTransactionDetailLocalDataActionType | InitializeVendorAddressActionType | InitiateChargeCardRepaymentActionType | InitiateReportsClassViewRefetchingActionType | InitiateReportsProjectViewRefetchingActionType | InsightsCardActionType | InvitePeopleActionType | InviteZeniPeopleActionType | InvoiceDetailPageActionType | InvoicingAuditViewActionType | InvoicingCatalogItemDetailFetchActionType | InvoicingCatalogItemDetailPageActionType | InvoicingCatalogItemFormDraftSeedActionType | InvoicingCatalogListViewActionType | InvoicingCatalogPlanActionActionType | InvoicingCatalogProductActionActionType | InvoicingConfigViewActionType | InvoicingCouponDetailFetchActionType | InvoicingCouponDetailPageActionType | InvoicingCouponFormDraftSeedActionType | InvoicingCouponViewActionType | InvoicingCreditNoteDetailViewActionType | InvoicingCreditNoteListViewActionType | InvoicingCustomerDetailPageActionType | InvoicingCustomerFormDraftSeedActionType | InvoicingCustomerListViewActionType | InvoicingCustomerPaymentMethodActionType | InvoicingCustomerRecordViewActionType | InvoicingDataImportViewActionType | InvoicingDiscountActionActionType | InvoicingDunningActionActionType | InvoicingDunningCaseDetailPageActionType | InvoicingDunningCaseDetailViewActionType | InvoicingDunningCaseListViewActionType | InvoicingInvoiceActionActionType | InvoicingOverviewActionType | InvoicingPaymentActionActionType | InvoicingPaymentLinkEmailPreviewActionType | InvoicingPaymentLinkEmailPreviewPageActionType | InvoicingPromotionalCreditActionActionType | InvoicingQboViewActionType | InvoicingSettingsViewActionType | InvoicingSubscriptionActionActionType | InvoicingSubscriptionDetailFetchActionType | InvoicingSubscriptionDetailPageActionType | InvoicingSubscriptionFormDraftSeedActionType | InvoicingSubscriptionFormPageActionType | InvoicingSubscriptionListViewActionType | InvoicingTransactionDetailViewActionType | InvoicingTransactionListViewActionType | IssueChargeCardActionType | LockChargeCardActionType | LockChargeCardsActionType | MarkAsCompleteScheduleDetailActionType | MarkTransactionAsNotMiscategorizedActionType | MatchAndReverseAccrualsActionType | NetBurnOrIncomeActionType | NetBurnOrIncomeClassesViewActionType | NetBurnOrIncomeForTimeframeActionType | NetBurnOrIncomeForTimeframeClassesViewActionType | NetBurnOrIncomeForTimeframeProjectViewActionType | NetBurnOrIncomeProjectViewActionType | NotifyMeForFeatureActionType | OneTimeAccrualActionsActionType | OpExActionType | OpExByVendorReportActionType | OpExByVendorReportForTimeframeActionType | OpExByVendorReportSummaryActionType | OpExClassesViewActionType | OpExForTimeframeClassesViewActionType | OpExForTimeframeProjectViewActionType | OpExForTimeframeViewActionType | OpExProjectViewActionType | ParallelFetchAccountTransactionListActionType | ParallelFetchClassTransactionListActionType | ParallelFetchEntityTransactionListActionType | ParallelFetchProjectTransactionListActionType | ParallelFetchTransactionListByCategoryTypeActionType | ParseCombinedStatementActionType | ParseInvoiceToBillActionType | ParseReceiptsToRemiActionType | ParseStatementActionType | ParseUploadedKybDocumentActionType | ParseUploadedKycDocumentActionType | PeopleActionType | PeoplePageActionType | PeopleSaveUpdatesActionType | PolicyDocumentExtractionToRecommendationBridgeActionType | PolicyRecommendationFromUploadActionType | PrefetchOtherJeSchedulesTabActionType | ProfitAndLossActionType | ProfitAndLossClassesViewActionType | ProfitAndLossForTimeframeActionType | ProfitAndLossForTimeframeClassesViewActionType | ProfitAndLossForTimeframeProjectViewActionType | ProfitAndLossProjectViewActionType | PushToastNotificationActionType | RecommendationForAccountSettingsActionType | RecommendationForAccountTypeActionType | RecordPaymentActionType | RefetchCompletedTransactionsOnBulkUploadSortActionType | RefreshBatchDetailsForBatchIdActionType | RefreshExpenseAutomationCurrentTabActionType | RefreshIntegrationsDataActionType | RefreshOpExByVendorReportActionType | RejectVendorGlobalReviewActionType | ReorderBillPayApprovalRulesActionType | ReorderRemiApprovalRulesActionType | ReparseStatementActionType | ReportsResyncActionType | ResendCardInviteActionType | ResendInviteActionType | ResendOtpActionType | ResendReferralInviteActionType | ResendVerifyDeviceOTPActionType | ResetKycKybActionType | ResetTransactionVendorLocalDataActionType | ResetVendorDetailLocalDataActionType | RestoreAutomatchingActionType | ResumeEnableAccountingProjectsActionType | RetryBankAccountConnectionActionType | RetryBankAccountConnectionForOnboardingActionType | RetryExpenseAutomationJEScheduleActionType | RetryOrRefundBillActionType | RevenueActionType | RevenueClassesViewActionType | RevenueForTimeframeClassesViewActionType | RevenueForTimeframeProjectViewActionType | RevenueForTimeframeViewActionType | RevenueProjectViewActionType | RevertJeScheduleActionType | ReviewDraftRemisBulkActionActionTye | ReviewExpenseAutomationFluxAnalysisActionType | RevokeCardInviteActionType | RevokeChargeCardsInviteActionType | SaveAccountMappingViewActionType | SaveAccountSettingsViewEpicActionType | SaveAddressActionType | SaveBillDetailActionType | SaveBillPaySetupApproverViewUpdatesActionType | SaveCannedResponseActionType | saveCardOnboardingUserDetailsActionType | SaveCompanyBillingAddressActionType | SaveCompanyHealthMetricByIdEpicActionType | SaveCompanyMonthEndReportActionType | SaveCompanyPassportDetailsActionType | SaveCreditAgentMacroActionType | SaveExpenseAutomationReconciliationDetailActionType | SaveExternalConnectionActionType | SaveMagicLinkBankAccountActionType | SaveNewScheduleActionType | SaveNotificationPreferencesActionType | SaveNotificationSettingsEpicActionType | SaveOnboardingCustomerCompletedStatusActionType | SaveOnboardingCustomerNotesActionType | SaveOnboardingCustomerViewUpdatesActionType | SaveRealTimeApprovalActionType | SaveReasonForAuditRuleActionType | SaveReconciliationReviewActionType | SaveRemiDetailActionType | SaveRemiSetupApproverViewUpdatesActionType | SaveScheduleAccruedDetailsActionType | SaveScheduleDetailsActionType | SaveSubscriptionNotesUpdatesActionType | SaveSubscriptionUpdatesActionType | SaveTaskDetailActionType | SaveTranactionVendorActionType | SaveTransactionDetailActionType | SaveVendorActionType | SaveVendorDetailsViewActionType | SaveVendorFirstReviewViewActionType | ScheduleTenantCreditScoreCronActionType | SearchMatchAccrualsActionType | SearchMatchTransactionsActionType | SearchTransactionsForManualMatchActionType | SearchTransactionsForNewScheduleActionType | SeedAiCardCreationFormDraftActionType | SeedAiCardPolicyFormDraftActionType | SendCompanyMonthEndReportActionType | SendEmailMagicLinkToUserActionType | SendOnboardingCustomerViewInviteActionType | SendOtpActionType | SendReferralInviteActionType | SessionHeartbeatActionType | SignInActionType | SignOutActionType | SnoozeTaskActionType | StatementCloseDayActionType | StopSubmitActionType | StopSubmitQuestionActionType | SubmitDraftBillsBulkActionActionType | SubmitDraftRemisBulkActionActionType | SubmitExpressPayActionType | SubmitFeedbackActionType | SubmitIntlVerificationActionType | SubmitQuestionActionType | SubmitRecommendationFeedbackActionType | SwitchExpenseAutomationJESchedulesTabActionType | SyncInvoicingSubscriptionCouponsActionType | SyncTabsAfterAutomatchActionType | ToggleReportUIOptionForecastModeActionType | TopExActionType | TransferMoneyActionType | TreasuryTransferMoneyActionType | TriggerAiAccountantJobActionType | TriggerReviewTabRefetchActionType | UndoReversalAccrualsActionType | UnlinkPaymentAccountActionType | UnlockChargeCardActionType | UnlockChargeCardsActionType | UnsnoozeTaskActionType | UpdateAccountingClassesEnabledActionType | UpdateAccruedJESchedulesActionType | UpdateAddressActionType | UpdateAmountsInScheduleAccruedDetailActionType | UpdateAmountsInScheduleDetailActionType | UpdateAutoTransferRuleActionType | UpdateBusinessVerificationDetailsActionType | UpdateCapitalizationAccountThresholdActionType | UpdateCardPolicyActionType | UpdateCardProfileActionType | UpdateChargeCardDetailActionType | UpdateChargeCardLimitActionType | UpdateChargeCardNameActionType | UpdateChargeCardsLimitActionType | UpdateCombinedStatementInfoActionType | UpdateCompanyDetailsActionType | UpdateCompanyOfficerActionType | UpdateCompanyPassportLocalStoreDataActionType | UpdateCompanyProductServicesActionType | UpdateCompanyQboRealmIdActionType | UpdateCompanyTaskManagerViewFiltersActionType | UpdateDashboardLayoutActionType | UpdateDebitCardPinAttemptActionType | UpdateDepositAccountActionType | UpdateDynamicFormActionType | UpdateExpenseAutomationReconciliationBalanceLocalDataActionType | UpdateFileNameActionType | UpdateFilesMetadataActionType | UpdateJESchedulesActionType | UpdateMappedCashAccountActionType | UpdateMileageDetailsActionType | UpdateMyProfileActionType | UpdateNetBurnOrIncomeStoryCardSettingsActionType | UpdateNotificationViewAllNotificationsStatusActionType | UpdateNotificationViewNotificationStatusActionType | UpdateOnboardingCustomerViewActionType | UpdateOnboardingCustomerViewCompleteStatusActionType | UpdateOnboardingCustomerViewDashboardLoadedActionType | UpdateOnboardingCustomerViewLocalStoreDataActionType | UpdateOnboardingPaymentAccountLoginStatusActionType | UpdateOnboardingPaymentAccountStatusActionType | UpdatePaymentAccountActionType | UpdatePaymentAccountLoginStatusActionType | UpdatePaymentAccountStatusActionType | UpdatePhysicalChargeCardAttemptActionType | UpdatePortfolioAllocationActionType | UpdatePrimaryContactActionType | UpdatePrimaryFundingAccountActionType | UpdateQBOConnectionPoolExternalConnectionActionType | UpdateReferViewedActionType | UpdateRemiSetupViewLocalStoreDataActionType | UpdateReportUIOptionCOABalancesRangeActionType | UpdateReportUIOptionIsCompareModeActionType | UpdateReportUIOptionIsCompareModeOnActionType | UpdateReportUIOptionThisPeriodActionType | UpdateReportUIOptionTimeFrameActionType | UpdateSectionAccountsViewActionType | UpdateSectionClassesViewV2ActionType | UpdateSectionProjectViewActionType | UpdateSelectedVendorForCreateFlowActionType | UpdateSetupViewLocalStoreDataActionType | UpdateStatementInfoActionType | UpdateTaskFromListViewActionType | UpdateTaskGroupNameActionType | UpdateTransactionDetailActionType | UpdateTransactionOnUploadSuccessActionType | UpdateVendorContactActionType | UploadAccountStatementActionType | UploadMissingReceiptSuccessEpicActionType | UploadTransactionReceiptSuccessEpicActionType | ValidateBillsBulkActionActionType | VendorFiling1099UploadDetailsSaveActionType | VendorsTabFetchVendorActionType | VendorsTabFetchVendorDetailPageViewActionType | VendorsTabFetchVendorDetailsActionType | VendorsTabResetVendorDetailLocalDataActionType | VendorsTabSaveVendorActionType | VerifyDeviceWithTwoFAActionType | VerifyOtpActionType | VerifyUserActionType | WatchBulkUploadBatchStatusActionType | WiseRedirectActionType;
|
|
708
|
+
export type RootActionType = AcceptBillPayTermsActionType | AcceptBillPayUpdatedTermsActionType | AcceptChargeCardTermsActionType | AcceptEmployeeRemiTermsActionType | AcceptMasterTOSEpicActionType | AcceptRemiTermsActionType | AcceptTreasuryTermsActionType | AcceptZeniAccountTermsActionType | AcknowledgeOnboardingAiActivationViewedActionType | AcknowledgeOnboardingAiFinanceTeamActionType | AddCardPaymentSourceActionType | ApplyBillRecommendationsToLocalStoreActionType | ApplyExtractedPolicyToDraftActionType | ApproveOAuthConsentActionType | ApproveOrRejectBillActionType | ApproveOrRejectBillsBulkActionActionType | ApproveOrRejectRemiActionType | ApproveOrRejectRemisBulkActionActionType | ApproveVendorGlobalReviewActionType | ArchiveCardPolicyActionType | ArchiveTaskActionType | BackgroundRefetchReviewTabActionType | BalanceSheetActionType | BalanceSheetClassesViewActionType | BalanceSheetForTimeframeActionType | BalanceSheetForTimeframeClassesViewActionType | BalanceSheetForTimeframeProjectViewActionType | BalanceSheetProjectViewActionType | BulkUpdateTasksListActionType | BulkUploadMatchResultToastActionType | BulkUploadReceiptsActionType | CancelAiAccountantOnboardingActionType | CancelAndDeleteBillActionType | CancelAndDeleteRemiActionType | CancelOrDeleteBillsBulkActionActionType | CancelOrDeleteRemisBulkActionActionType | CancelScheduleAccruedJournalEntryActionType | CardBalanceActionType | CashBalanceActionType | CashFlowActionType | CashFlowClassesViewActionType | CashFlowForTimeframeActionType | CashFlowForTimeframeClassesViewActionType | CashFlowForTimeframeProjectViewActionType | CashFlowProjectViewActionType | CashInCashOutActionType | CashPositionActionType | ChangeZeniPersonRolesActionType | CheckDepositActionType | CloseChargeCardActionType | CloseChargeCardsActionType | CombinedStatementActionType | CompanyManagementSavePendingUpdatesActionType | CompanyManagementSaveUpdatesActionType | ConfirmBulkUploadMatchActionType | ConfirmCardSetupIntentActionType | ConfirmStatementMappingActionType | CreateAddressActionType | CreateAutoTransferRuleActionType | CreateBankAccountActionType | CreateCardPolicyTemplateActionType | CreateCardSetupIntentActionType | CreateCheckingAccountActionType | CreateCompanyAddressActionType | CreateCompanyOfficersActionType | CreateCompanyUserAddressActionType | CreateGlobalMerchantActionType | CreateInternationalBankAccountActionType | CreateInvoiceActionType | CreateNewSchedulesAccruedActionType | CreateNewSchedulesActionType | CreateNewTaskGroupActionType | CreateOneTimeAccrualActionType | CreatePaymentInstrumentActionType | CreateSessionActionType | CreateSessionAndSubmitActionType | CreateSubTaskActionType | CreateTagActionType | CreateTaskFromTaskGroupTemplateActionType | CreateTransferEntryActionType | CreateUserBankAccountActionType | CurrencyConversionActionType | DeleteAccountStatementActionType | DeleteAutoTransferRuleActionType | DeleteBankAccountActionType | DeleteBillActionType | DeleteBillPayApprovalRuleActionType | DeleteCannedResponseActionType | DeleteChatSessionActionType | DeleteCombinedStatementActionType | DeleteFileActionType | DeleteFileListActionType | DeleteInternationalBankAccountActionType | DeletePaymentInstrumentActionType | DeletePersonActionType | DeleteRemiActionType | DeleteRemiApprovalRuleActionType | DeleteScheduleAccruedDetailActionType | DeleteScheduleDetailActionType | DeleteTagActionType | DeleteTaskActionType | DeleteTaskGroupActionType | DeleteTransactionAttachmentActionType | DeleteUserBankAccountActionType | DepositAccountTransactionListActionType | DisableAccountingProjectsActionType | DismissCapitalizationOnboardingActionType | DoMagicLinkSignInActionType | DownloadAccountingProviderAttachmentActionType | DragNDropTasksActionType | EditInvoicingCatalogItemDetailViewActionType | EditInvoicingCouponDetailViewActionType | EditInvoicingCustomerDetailViewActionType | EditInvoicingSubscriptionDetailViewActionType | EnableAccountingProjectsActionType | EnableChargeCardAutoPayActionType | EnableSetupActionType | EstablishOnboardingPlaidConnectionActionType | EstablishPlaidConnectionActionType | ExcludeAccountFromReconciliationActionType | ExpressInterestChargeCardActionType | ExpressPayActionType | ExtractPolicyDocumentActionType | FetchAccountHistoryActionType | FetchAccountListActionType | FetchAccountListForAccountTypesActionType | FetchAccountSettingsListForAccountTypesActionType | FetchAccruedScheduleListActionType | FetchActiveTenantActionType | FetchAddressActionType | FetchAggregatedReportActionType | FetchAiAccountantCustomersActionType | FetchAiAccountantJobsActionType | FetchAiAgentsActivationStatusActionType | FetchAllCockpitViewsActionType | FetchAllExpenseAutomationTabsActionType | FetchAllPeopleRequiredActionType | FetchAllTagsActionType | FetchAllTaskGroupsActionType | FetchAllTenantsActionType | FetchApAgingActionType | FetchApAgingDetailActionType | FetchArAgingActionType | FetchArAgingDetailActionType | FetchAuditReportGroupViewActionType | FetchAuditRuleGroupViewActionType | FetchAutoTransferReviewDetailActionType | FetchAutoTransferRuleHistoryActionType | FetchAutoTransferRulesActionType | FetchBankAccountsListActionType | FetchBankConnectionsViewActionType | FetchBankCountryNameByIbanActionType | FetchBankNameByRoutingActionType | FetchBankNameBySwiftActionType | FetchBillAndInitializeLocalStoreActionType | FetchBillDetailActionType | FetchBillingAccountsListActionType | FetchBillListActionType | FetchBillListPerTabActionType | FetchBillPayApproversDetailsActionType | FetchBillPayApproversListActionType | FetchBillPayCardActionType | FetchBillPayConfigActionType | FetchBillPaySetupApproverViewActionType | FetchBillPaySetupViewActionType | FetchBillRecommendationsActionType | FetchBulkUploadBatchDetailsActionType | FetchBulkUploadBatchesActionType | FetchCannedResponsesActionType | FetchCardPolicyDetailActionType | FetchCardPolicyListActionType | FetchCardPolicyMccCategoriesActionType | FetchCardPolicyVendorOptionsActionType | FetchCardProfilesActionType | FetchCashbackDetailActionType | FetchChargeCardConfigActionType | FetchChargeCardDetailActionType | FetchChargeCardDetailPageActionType | FetchChargeCardListActionType | FetchChargeCardListPageActionType | FetchChargeCardPaymentHistoryActionType | FetchChargeCardPaymentPageActionType | FetchChargeCardRepaymentDetailActionType | FetchChargeCardSetupViewActionType | FetchChargeCardsRecurringExpensesActionType | FetchChargeCardStatementListActionType | FetchChargeCardTransactionAttachmentsActionType | FetchChargeCardTransactionListActionType | FetchChargeCardTransactionStatisticsActionType | FetchChatHistoryActionType | FetchChatSessionsForUserActionType | FetchClassListActionType | FetchCockpitContextActionType | FetchCollaborationAuthTokenActionType | FetchCompanyBillingAddressActionType | FetchCompanyConfigActionType | FetchCompanyHealthMetricConfigViewEpicActionType | FetchCompanyHealthMetricViewEpicActionType | FetchCompanyManagementActionType | FetchCompanyMetaDataActionType | FetchCompanyMonthEndReportHistoricDataActionType | FetchCompanyMonthEndReportHistoricDatesActionType | FetchCompanyMonthEndReportTemplatesActionType | FetchCompanyMonthEndReportViewActionType | FetchCompanyOnboardingViewActionType | FetchCompanyPassportViewActionType | FetchCompanyPortfolioActionType | FetchCompanyTaskManagerViewActionType | FetchCompletedTransactionsActionType | FetchCreateInvoiceFormPageActionType | FetchCreditAccountActionType | FetchCreditAccountRepaymentActionType | FetchCreditAgentMacroActionType | FetchCurrencyConversionValueActionType | FetchDashboardActionType | FetchDashboardLayoutActionType | FetchDebitCardSummaryActionType | FetchDepositAccountActionType | FetchDepositAccountDetailActionType | FetchDepositAccountLimitActionType | FetchDepositAccountListActionType | FetchDepositAccountListForCardsActionType | FetchDepositAccStatementListActionType | FetchDownloadSchedulesActionType | FetchDuplicateBillActionType | FetchDuplicateReimbursementEpicActionType | FetchEditBillDetailPageActionType | FetchEditRemiDetailPageActionType | FetchEligibleActionsForBillActionType | FetchEntityAutoCompleteActionType | FetchEntityHistoryActionType | FetchEntityRecommendationsByTransactionIdActionType | FetchEntityRecommendationsForLineUpdateActionType | FetchExcludedResourcesActionType | FetchExpenseAutomationActualMatchingActionType | FetchExpenseAutomationActualMatchingMatchActionType | FetchExpenseAutomationActualMatchingPageActionType | FetchExpenseAutomationFailedJePostingsActionType | FetchExpenseAutomationFluxAnalysisActionType | FetchExpenseAutomationInitializeTransactionCategorizationViewLocalDataActionType | FetchExpenseAutomationJEScheduleActionType | FetchExpenseAutomationJESchedulePageActionType | FetchExpenseAutomationMarkTransactionAsNotMiscategorizedActionType | FetchExpenseAutomationMissingReceiptsActionType | FetchExpenseAutomationReconciliationsViewActionType | FetchExpenseAutomationSaveTransactionCategorizationActionType | FetchExpenseAutomationTransactionCategorizationActionType | FetchExpenseAutomationTransactionCategorizationViewActionType | FetchExpenseAutomationUpdateTransactionCategorizationEpicActionType | FetchExpenseTrendActionType | FetchExternalConnectionsActionType | FetchFileActionType | FetchFileListActionType | FetchForecastListActionType | FetchGlobalMerchantAutoCompleteActionType | FetchGlobalMerchantRecommendationActionType | FetchIncomeTrendActionType | FetchInternationalWireDynamicFormActionType | FetchIntlVerificationFormActionType | FetchInvoiceCountsActionType | FetchInvoiceDetailActionType | FetchInvoiceKPIsActionType | FetchInvoiceListActionType | FetchInvoiceListPageActionType | FetchIssueCardPageActionType | FetchMagicLinkBankNameByRoutingActionType | FetchMagicLinkBankNameBySwiftActionType | FetchMagicLinkBillActionType | FetchMagicLinkTenantActionType | FetchManagementActionType | FetchMerchantListActionType | FetchMonthClosePerformanceTrendActionType | FetchMonthEndCloseChecksActionType | FetchMoreBatchDetailsActionType | FetchMultipleBatchDetailsActionType | FetchMyProfileActionType | FetchMyProfileViewActionType | FetchNetBurnOrIncomeStoryCardActionType | FetchNetBurnOrIncomeWithForecastActionType | FetchNotificationSettingsActionType | FetchNotificationSettingsViewActionType | FetchNotificationUnreadCountActionType | FetchNotificationViewActionType | FetchOnboardingActionType | FetchOnboardingCompletedCompaniesActionType | FetchOnboardingCustomerSetupViewActionType | FetchOnboardingCustomerViewActionType | FetchOneTimeAccrualActionType | FetchOpExWithForecastActionType | FetchOwnerListActionType | FetchParentSubsidiaryManagementActionType | FetchPaymentAccountBalanceActionType | FetchPaymentAccountListActionType | FetchPaymentSourcesActionType | FetchPortfolioActionType | FetchPortfolioAllocationActionType | FetchPreviousBillsActionType | FetchProjectListActionType | FetchQBOConnectionPoolActionType | FetchRecommendationByEntityIdActionType | FetchRecommendationByEntityNameActionType | FetchRecommendationsAndUpdateMerchantRecommendationsActionType | FetchRecommendationsAndUpdateVendorRecommendationsActionType | FetchRecommendedBillExpenseActionType | FetchReferralsActionType | FetchRegisteredInterestsActionType | FetchReimbursementCardActionType | FetchReimbursementConfigActionType | FetchRemiAndInitializeLocalStoreActionType | FetchRemiApproversDetailsActionType | FetchRemiApproversListActionType | FetchRemiDetailActionType | FetchRemiListActionType | FetchRemiListPerTabActionType | FetchRemiSetupApproverViewActionType | FetchRemiSetupViewActionType | FetchRevenueWithForecastActionType | FetchReviewCompanyActionType | FetchReviewTransferDetailActionType | FetchRewardsPlanActionType | FetchScheduleAccruedDetailsActionType | FetchScheduleAccruedDetailsPageActionType | FetchScheduleDetailsActionType | FetchScheduleDetailsPageActionType | FetchScheduleListActionType | FetchSchedulesListActionType | FetchSkillsActionType | FetchSubscriptionActionType | FetchSubscriptionAddOnsActionType | FetchSubscriptionCouponsActionType | FetchSubscriptionCreateEstimateActionType | FetchSubscriptionDetailsActionType | FetchSubscriptionListActionType | FetchSubscriptionPlansActionType | FetchSubscriptionSummaryForTenantActionType | FetchSubscriptionUpdateEstimateActionType | FetchSubTasksActionType | FetchSuggestedQuestionsActionType | FetchTaskDetailActionType | FetchTaskDetailPageActionType | FetchTaskGroupTemplatesActionType | FetchTaskHistoryActionType | FetchTaskListActionType | FetchTaskListPageActionType | FetchTaskManagerMetricsActionType | FetchTasksCardActionType | FetchTransactionActivityLogActionType | FetchTransactionDetailActionType | FetchTransactionListByAccountActionType | FetchTransactionListByClassActionType | FetchTransactionListByEntityActionType | FetchTransactionListByProjectActionType | FetchTransactionsForEntityActionType | FetchTransactionsListByCategoryTypeActionType | FetchTransferAccountsActionType | FetchTreasuryDetailActionType | FetchTreasuryFundsActionType | FetchTreasuryHistoryActionType | FetchTreasurySetupViewActionType | FetchTreasuryStatementListActionType | FetchTreasuryTaxLetterListActionType | FetchTreasuryTransactionListActionType | FetchTrendForEntityActionType | FetchUserDetailActionType | FetchUserFinancialAccountActionType | FetchUserListByTypeActionType | FetchUserRoleConfigActionType | FetchVendor1099TypeListActionType | FetchVendorActionType | FetchVendorAndUpdateBillLocalDataActionType | FetchVendorByNameAndParseInvoiceActionType | FetchVendorDetailsActionType | FetchVendorFirstReviewAttachmentsActionType | FetchVendorFirstReviewViewActionType | FetchVendorGlobalReviewViewActionType | FetchVendorsActionType | FetchVendorsFiling1099ActionType | FetchVendorsFiling1099AllActionType | FetchVendorsFiling1099DownloadActionType | FetchVendorTabViewActionType | FetchVendorTypeListActionType | FetchZeniAccountListPageActionType | FetchZeniAccountsConfigActionType | FetchZeniAccountSetupViewActionType | FetchZeniAccStatePageActionType | FetchZeniUsersActionType | GetOnboardingEmailGroupActionType | GetOnboardingPlaidLinkTokenActionType | GetPaymentAccountsActionType | GetPlaidLinkTokenActionType | IgnoreActualMatchingSuggestionActionType | IgnoreExpenseAutomationJEScheduleActionType | ImproveUsingZeniGPTActionType | IncludeAccountInReconciliationActionType | InitialiseExpenseAutomationLocalDataForSelectedAccountIdActionType | InitializeAccountMappingViewActionType | InitializeAccountSettingsViewEpicActionType | InitializeBillPaySetupApproverViewUpdateDataActionType | InitializeBillToLocalStoreActionType | InitializeCardUserOnboardingLocalDataActionType | InitializeCompanyHealthMetricViewLocalDataEpicActionType | InitializeEditPersonActionType | InitializeExpenseAutomationJeScheduleLocalDataActionType | InitializeInternationalWireLocalDataActionType | InitializeIntlVerificationFormEpicActionType | InitializeMyProfileLocalDataActionType | InitializeNewScheduleActionType | InitializeOnboardingCustomerViewUpdateDataActionType | InitializeRemiSetupApproverViewUpdateDataActionType | InitializeRemiToLocalStoreActionType | InitializeScheduleAccruedDetailLocalDataActionType | InitializeScheduleDetailLocalDataActionType | InitializeSubscriptionLocalDataActionType | InitializeTaskToLocalStoreActionType | InitializeTransactionDetailLocalDataActionType | InitializeVendorAddressActionType | InitiateChargeCardRepaymentActionType | InitiateReportsClassViewRefetchingActionType | InitiateReportsProjectViewRefetchingActionType | InsightsCardActionType | InvitePeopleActionType | InviteZeniPeopleActionType | InvoiceDetailPageActionType | InvoicingAuditViewActionType | InvoicingCatalogItemDetailFetchActionType | InvoicingCatalogItemDetailPageActionType | InvoicingCatalogItemFormDraftSeedActionType | InvoicingCatalogListViewActionType | InvoicingCatalogPlanActionActionType | InvoicingCatalogProductActionActionType | InvoicingConfigViewActionType | InvoicingCouponDetailFetchActionType | InvoicingCouponDetailPageActionType | InvoicingCouponFormDraftSeedActionType | InvoicingCouponViewActionType | InvoicingCreditNoteDetailViewActionType | InvoicingCreditNoteListViewActionType | InvoicingCustomerDetailPageActionType | InvoicingCustomerFormDraftSeedActionType | InvoicingCustomerListViewActionType | InvoicingCustomerPaymentMethodActionType | InvoicingCustomerRecordViewActionType | InvoicingDataImportViewActionType | InvoicingDiscountActionActionType | InvoicingDunningActionActionType | InvoicingDunningCaseDetailPageActionType | InvoicingDunningCaseDetailViewActionType | InvoicingDunningCaseListViewActionType | InvoicingInvoiceActionActionType | InvoicingOverviewActionType | InvoicingPaymentActionActionType | InvoicingPaymentLinkEmailPreviewActionType | InvoicingPaymentLinkEmailPreviewPageActionType | InvoicingPromotionalCreditActionActionType | InvoicingQboViewActionType | InvoicingSettingsViewActionType | InvoicingSubscriptionActionActionType | InvoicingSubscriptionDetailFetchActionType | InvoicingSubscriptionDetailPageActionType | InvoicingSubscriptionEstimateActionType | InvoicingSubscriptionFormDraftSeedActionType | InvoicingSubscriptionFormPageActionType | InvoicingSubscriptionListViewActionType | InvoicingTransactionDetailViewActionType | InvoicingTransactionListViewActionType | IssueChargeCardActionType | LockChargeCardActionType | LockChargeCardsActionType | MarkAsCompleteScheduleDetailActionType | MarkTransactionAsNotMiscategorizedActionType | MatchAndReverseAccrualsActionType | NetBurnOrIncomeActionType | NetBurnOrIncomeClassesViewActionType | NetBurnOrIncomeForTimeframeActionType | NetBurnOrIncomeForTimeframeClassesViewActionType | NetBurnOrIncomeForTimeframeProjectViewActionType | NetBurnOrIncomeProjectViewActionType | NotifyMeForFeatureActionType | OneTimeAccrualActionsActionType | OpExActionType | OpExByVendorReportActionType | OpExByVendorReportForTimeframeActionType | OpExByVendorReportSummaryActionType | OpExClassesViewActionType | OpExForTimeframeClassesViewActionType | OpExForTimeframeProjectViewActionType | OpExForTimeframeViewActionType | OpExProjectViewActionType | ParallelFetchAccountTransactionListActionType | ParallelFetchClassTransactionListActionType | ParallelFetchEntityTransactionListActionType | ParallelFetchProjectTransactionListActionType | ParallelFetchTransactionListByCategoryTypeActionType | ParseCombinedStatementActionType | ParseInvoiceToBillActionType | ParseReceiptsToRemiActionType | ParseStatementActionType | ParseUploadedKybDocumentActionType | ParseUploadedKycDocumentActionType | PeopleActionType | PeoplePageActionType | PeopleSaveUpdatesActionType | PolicyDocumentExtractionToRecommendationBridgeActionType | PolicyRecommendationFromUploadActionType | PrefetchOtherJeSchedulesTabActionType | ProfitAndLossActionType | ProfitAndLossClassesViewActionType | ProfitAndLossForTimeframeActionType | ProfitAndLossForTimeframeClassesViewActionType | ProfitAndLossForTimeframeProjectViewActionType | ProfitAndLossProjectViewActionType | PushToastNotificationActionType | RecommendationForAccountSettingsActionType | RecommendationForAccountTypeActionType | RecordPaymentActionType | RefetchCompletedTransactionsOnBulkUploadSortActionType | RefreshBatchDetailsForBatchIdActionType | RefreshExpenseAutomationCurrentTabActionType | RefreshIntegrationsDataActionType | RefreshOpExByVendorReportActionType | RejectVendorGlobalReviewActionType | ReorderBillPayApprovalRulesActionType | ReorderRemiApprovalRulesActionType | ReparseStatementActionType | ReportsResyncActionType | ResendCardInviteActionType | ResendInviteActionType | ResendOtpActionType | ResendReferralInviteActionType | ResendVerifyDeviceOTPActionType | ResetKycKybActionType | ResetTransactionVendorLocalDataActionType | ResetVendorDetailLocalDataActionType | RestoreAutomatchingActionType | ResumeEnableAccountingProjectsActionType | RetryBankAccountConnectionActionType | RetryBankAccountConnectionForOnboardingActionType | RetryExpenseAutomationJEScheduleActionType | RetryOrRefundBillActionType | RevenueActionType | RevenueClassesViewActionType | RevenueForTimeframeClassesViewActionType | RevenueForTimeframeProjectViewActionType | RevenueForTimeframeViewActionType | RevenueProjectViewActionType | RevertJeScheduleActionType | ReviewDraftRemisBulkActionActionTye | ReviewExpenseAutomationFluxAnalysisActionType | RevokeCardInviteActionType | RevokeChargeCardsInviteActionType | SaveAccountMappingViewActionType | SaveAccountSettingsViewEpicActionType | SaveAddressActionType | SaveBillDetailActionType | SaveBillPaySetupApproverViewUpdatesActionType | SaveCannedResponseActionType | saveCardOnboardingUserDetailsActionType | SaveCompanyBillingAddressActionType | SaveCompanyHealthMetricByIdEpicActionType | SaveCompanyMonthEndReportActionType | SaveCompanyPassportDetailsActionType | SaveCreditAgentMacroActionType | SaveExpenseAutomationReconciliationDetailActionType | SaveExternalConnectionActionType | SaveMagicLinkBankAccountActionType | SaveNewScheduleActionType | SaveNotificationPreferencesActionType | SaveNotificationSettingsEpicActionType | SaveOnboardingCustomerCompletedStatusActionType | SaveOnboardingCustomerNotesActionType | SaveOnboardingCustomerViewUpdatesActionType | SaveRealTimeApprovalActionType | SaveReasonForAuditRuleActionType | SaveReconciliationReviewActionType | SaveRemiDetailActionType | SaveRemiSetupApproverViewUpdatesActionType | SaveScheduleAccruedDetailsActionType | SaveScheduleDetailsActionType | SaveSubscriptionNotesUpdatesActionType | SaveSubscriptionUpdatesActionType | SaveTaskDetailActionType | SaveTranactionVendorActionType | SaveTransactionDetailActionType | SaveVendorActionType | SaveVendorDetailsViewActionType | SaveVendorFirstReviewViewActionType | ScheduleTenantCreditScoreCronActionType | SearchMatchAccrualsActionType | SearchMatchTransactionsActionType | SearchTransactionsForManualMatchActionType | SearchTransactionsForNewScheduleActionType | SeedAiCardCreationFormDraftActionType | SeedAiCardPolicyFormDraftActionType | SendCompanyMonthEndReportActionType | SendEmailMagicLinkToUserActionType | SendOnboardingCustomerViewInviteActionType | SendOtpActionType | SendReferralInviteActionType | SessionHeartbeatActionType | SignInActionType | SignOutActionType | SnoozeTaskActionType | StatementCloseDayActionType | StopSubmitActionType | StopSubmitQuestionActionType | SubmitDraftBillsBulkActionActionType | SubmitDraftRemisBulkActionActionType | SubmitExpressPayActionType | SubmitFeedbackActionType | SubmitIntlVerificationActionType | SubmitQuestionActionType | SubmitRecommendationFeedbackActionType | SwitchExpenseAutomationJESchedulesTabActionType | SyncInvoicingSubscriptionCouponsActionType | SyncTabsAfterAutomatchActionType | ToggleReportUIOptionForecastModeActionType | TopExActionType | TransferMoneyActionType | TreasuryTransferMoneyActionType | TriggerAiAccountantJobActionType | TriggerReviewTabRefetchActionType | UndoReversalAccrualsActionType | UnlinkPaymentAccountActionType | UnlockChargeCardActionType | UnlockChargeCardsActionType | UnsnoozeTaskActionType | UpdateAccountingClassesEnabledActionType | UpdateAccruedJESchedulesActionType | UpdateAddressActionType | UpdateAmountsInScheduleAccruedDetailActionType | UpdateAmountsInScheduleDetailActionType | UpdateAutoTransferRuleActionType | UpdateBusinessVerificationDetailsActionType | UpdateCapitalizationAccountThresholdActionType | UpdateCardPolicyActionType | UpdateCardProfileActionType | UpdateChargeCardDetailActionType | UpdateChargeCardLimitActionType | UpdateChargeCardNameActionType | UpdateChargeCardsLimitActionType | UpdateCombinedStatementInfoActionType | UpdateCompanyDetailsActionType | UpdateCompanyOfficerActionType | UpdateCompanyPassportLocalStoreDataActionType | UpdateCompanyProductServicesActionType | UpdateCompanyQboRealmIdActionType | UpdateCompanyTaskManagerViewFiltersActionType | UpdateDashboardLayoutActionType | UpdateDebitCardPinAttemptActionType | UpdateDepositAccountActionType | UpdateDynamicFormActionType | UpdateExpenseAutomationReconciliationBalanceLocalDataActionType | UpdateFileNameActionType | UpdateFilesMetadataActionType | UpdateJESchedulesActionType | UpdateMappedCashAccountActionType | UpdateMileageDetailsActionType | UpdateMyProfileActionType | UpdateNetBurnOrIncomeStoryCardSettingsActionType | UpdateNotificationViewAllNotificationsStatusActionType | UpdateNotificationViewNotificationStatusActionType | UpdateOnboardingCustomerViewActionType | UpdateOnboardingCustomerViewCompleteStatusActionType | UpdateOnboardingCustomerViewDashboardLoadedActionType | UpdateOnboardingCustomerViewLocalStoreDataActionType | UpdateOnboardingPaymentAccountLoginStatusActionType | UpdateOnboardingPaymentAccountStatusActionType | UpdatePaymentAccountActionType | UpdatePaymentAccountLoginStatusActionType | UpdatePaymentAccountStatusActionType | UpdatePhysicalChargeCardAttemptActionType | UpdatePortfolioAllocationActionType | UpdatePrimaryContactActionType | UpdatePrimaryFundingAccountActionType | UpdateQBOConnectionPoolExternalConnectionActionType | UpdateReferViewedActionType | UpdateRemiSetupViewLocalStoreDataActionType | UpdateReportUIOptionCOABalancesRangeActionType | UpdateReportUIOptionIsCompareModeActionType | UpdateReportUIOptionIsCompareModeOnActionType | UpdateReportUIOptionThisPeriodActionType | UpdateReportUIOptionTimeFrameActionType | UpdateSectionAccountsViewActionType | UpdateSectionClassesViewV2ActionType | UpdateSectionProjectViewActionType | UpdateSelectedVendorForCreateFlowActionType | UpdateSetupViewLocalStoreDataActionType | UpdateStatementInfoActionType | UpdateTaskFromListViewActionType | UpdateTaskGroupNameActionType | UpdateTransactionDetailActionType | UpdateTransactionOnUploadSuccessActionType | UpdateVendorContactActionType | UploadAccountStatementActionType | UploadMissingReceiptSuccessEpicActionType | UploadTransactionReceiptSuccessEpicActionType | ValidateBillsBulkActionActionType | VendorFiling1099UploadDetailsSaveActionType | VendorsTabFetchVendorActionType | VendorsTabFetchVendorDetailPageViewActionType | VendorsTabFetchVendorDetailsActionType | VendorsTabResetVendorDetailLocalDataActionType | VendorsTabSaveVendorActionType | VerifyDeviceWithTwoFAActionType | VerifyOtpActionType | VerifyUserActionType | WatchBulkUploadBatchStatusActionType | WiseRedirectActionType;
|
|
708
709
|
export declare const featureRootEpic: Epic<RootActionType>;
|
package/lib/epic.js
CHANGED
|
@@ -306,6 +306,7 @@ const saveInvoicingCustomerEpic_1 = require("./view/invoicing/editInvoicingCusto
|
|
|
306
306
|
const seedInvoicingCustomerFormDraftEpic_1 = require("./view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic");
|
|
307
307
|
const fetchInvoicingSubscriptionDetailEpic_1 = require("./view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionDetailEpic");
|
|
308
308
|
const fetchInvoicingSubscriptionDetailPageEpic_1 = require("./view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionDetailPageEpic");
|
|
309
|
+
const fetchInvoicingSubscriptionEstimateEpic_1 = require("./view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionEstimateEpic");
|
|
309
310
|
const fetchInvoicingSubscriptionFormPageEpic_1 = require("./view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic");
|
|
310
311
|
const initializeInvoicingSubscriptionAddressEpic_1 = require("./view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic");
|
|
311
312
|
const runInvoicingSubscriptionActionEpic_1 = require("./view/invoicing/editInvoicingSubscriptionDetailView/runInvoicingSubscriptionActionEpic");
|
|
@@ -1102,6 +1103,7 @@ const ALL_EPICS = [
|
|
|
1102
1103
|
fetchInvoicingSubscriptionCountsEpic_1.fetchInvoicingSubscriptionCountsEpic,
|
|
1103
1104
|
fetchInvoicingSubscriptionDetailEpic_1.fetchInvoicingSubscriptionDetailEpic,
|
|
1104
1105
|
fetchInvoicingSubscriptionDetailPageEpic_1.fetchInvoicingSubscriptionDetailPageEpic,
|
|
1106
|
+
fetchInvoicingSubscriptionEstimateEpic_1.fetchInvoicingSubscriptionEstimateEpic,
|
|
1105
1107
|
fetchInvoicingSubscriptionFormPageEpic_1.fetchInvoicingSubscriptionFormPageEpic,
|
|
1106
1108
|
fetchInvoicingSubscriptionListEpic_1.fetchInvoicingSubscriptionListEpic,
|
|
1107
1109
|
fetchInvoicingSubscriptionListPageEpic_1.fetchInvoicingSubscriptionListPageEpic,
|
|
@@ -7,3 +7,7 @@ export function getInvoicingCouponsByIds(couponState, ids) {
|
|
|
7
7
|
export function getInvoicingCouponById(couponState, id) {
|
|
8
8
|
return recordGet(couponState.couponByID, id);
|
|
9
9
|
}
|
|
10
|
+
// Forms hold a coupon by its code; the store keys coupons by id.
|
|
11
|
+
export function getInvoicingCouponByCode(couponState, couponCode) {
|
|
12
|
+
return Object.values(couponState.couponByID).find((coupon) => coupon.couponCode === couponCode);
|
|
13
|
+
}
|
package/lib/esm/epic.js
CHANGED
|
@@ -303,6 +303,7 @@ import { saveInvoicingCustomerEpic, } from './view/invoicing/editInvoicingCustom
|
|
|
303
303
|
import { seedInvoicingCustomerFormDraftEpic, } from './view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic';
|
|
304
304
|
import { fetchInvoicingSubscriptionDetailEpic, } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionDetailEpic';
|
|
305
305
|
import { fetchInvoicingSubscriptionDetailPageEpic, } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionDetailPageEpic';
|
|
306
|
+
import { fetchInvoicingSubscriptionEstimateEpic, } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionEstimateEpic';
|
|
306
307
|
import { fetchInvoicingSubscriptionFormPageEpic, } from './view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic';
|
|
307
308
|
import { initializeInvoicingSubscriptionAddressEpic } from './view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic';
|
|
308
309
|
import { runInvoicingSubscriptionActionEpic, } from './view/invoicing/editInvoicingSubscriptionDetailView/runInvoicingSubscriptionActionEpic';
|
|
@@ -1099,6 +1100,7 @@ const ALL_EPICS = [
|
|
|
1099
1100
|
fetchInvoicingSubscriptionCountsEpic,
|
|
1100
1101
|
fetchInvoicingSubscriptionDetailEpic,
|
|
1101
1102
|
fetchInvoicingSubscriptionDetailPageEpic,
|
|
1103
|
+
fetchInvoicingSubscriptionEstimateEpic,
|
|
1102
1104
|
fetchInvoicingSubscriptionFormPageEpic,
|
|
1103
1105
|
fetchInvoicingSubscriptionListEpic,
|
|
1104
1106
|
fetchInvoicingSubscriptionListPageEpic,
|
package/lib/esm/index.js
CHANGED
|
@@ -774,7 +774,7 @@ export { getRecordPaymentFormView, getRecordPaymentInvoiceOptions, getRecordPaym
|
|
|
774
774
|
export { initializeInvoicingCustomerAddress, resetEditInvoicingCustomerDetailView, submitInvoicingCustomerForm, submitInvoicingCustomerFormFailure, submitInvoicingCustomerFormSuccess, updateInvoicingCustomerFormDraft, } from './view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer';
|
|
775
775
|
export { INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE, entityToInvoicingCustomerFormLocalData, initialInvoicingCustomerFormLocalData, } from './view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig';
|
|
776
776
|
export { getInvoicingCustomerFormView } from './view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector';
|
|
777
|
-
export { fetchInvoicingSubscriptionFormPage, initializeInvoicingSubscriptionAddress, resetEditInvoicingSubscriptionDetailView, submitInvoicingSubscriptionForm, updateInvoicingSubscriptionFormDraft, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
777
|
+
export { clearInvoicingSubscriptionEstimate, fetchInvoicingSubscriptionEstimate, fetchInvoicingSubscriptionFormPage, initializeInvoicingSubscriptionAddress, resetEditInvoicingSubscriptionDetailView, submitInvoicingSubscriptionForm, updateInvoicingSubscriptionFormDraft, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
778
778
|
export { INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE, entityToInvoicingSubscriptionFormLocalData, initialInvoicingSubscriptionFormLocalData, invoicingSubscriptionTodayIso, toInvoicingSubscriptionQuantity, } from './view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig';
|
|
779
779
|
export { getEditInvoicingSubscriptionDetailViewState, getInvoicingSubscriptionFormView, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector';
|
|
780
780
|
export { resetEditInvoicingCatalogItemDetailView, submitInvoicingCatalogItemForm, updateInvoicingCatalogItemFormDraft, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { date } from '../../../zeniDayJS';
|
|
1
3
|
import { toAddressUpdatableInfoPayload } from '../../addressView/addressViewPayload';
|
|
2
4
|
import { invoicingSubscriptionTodayIso, toInvoicingSubscriptionBillingCycles, toInvoicingSubscriptionQuantity, } from './invoicingSubscriptionFormConfig';
|
|
3
5
|
/**
|
|
@@ -56,3 +58,56 @@ export const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingA
|
|
|
56
58
|
: {}),
|
|
57
59
|
};
|
|
58
60
|
};
|
|
61
|
+
const toEstimateDate = (value) => value != null && value !== '' ? date(value) : undefined;
|
|
62
|
+
const mapInvoiceEstimate = (payload, money) => payload == null
|
|
63
|
+
? undefined
|
|
64
|
+
: {
|
|
65
|
+
amountDue: money(payload.amount_due),
|
|
66
|
+
couponDiscountTotal: money(payload.coupon_discount_total),
|
|
67
|
+
creditsApplied: money(payload.credits_applied),
|
|
68
|
+
dueDate: toEstimateDate(payload.due_date),
|
|
69
|
+
grossSubTotal: money(payload.gross_sub_total),
|
|
70
|
+
invoiceDate: toEstimateDate(payload.invoice_date),
|
|
71
|
+
lineItems: payload.line_items.map((lineItem) => ({
|
|
72
|
+
amount: money(lineItem.amount),
|
|
73
|
+
dateFrom: toEstimateDate(lineItem.date_from),
|
|
74
|
+
dateTo: toEstimateDate(lineItem.date_to),
|
|
75
|
+
description: lineItem.description,
|
|
76
|
+
discountAmount: money(lineItem.discount_amount),
|
|
77
|
+
quantity: lineItem.quantity,
|
|
78
|
+
taxAmount: lineItem.tax_amount != null
|
|
79
|
+
? money(lineItem.tax_amount)
|
|
80
|
+
: undefined,
|
|
81
|
+
unitAmount: money(lineItem.unit_amount),
|
|
82
|
+
})),
|
|
83
|
+
promotionalCreditsApplied: money(payload.promotional_credits_applied),
|
|
84
|
+
subTotal: money(payload.sub_total),
|
|
85
|
+
tax: payload.tax != null ? money(payload.tax) : undefined,
|
|
86
|
+
total: money(payload.total),
|
|
87
|
+
};
|
|
88
|
+
export const mapInvoicingSubscriptionEstimatePayloadToState = (payload) => {
|
|
89
|
+
const money = (amount) => toAmount(amount, payload.currency_code, payload.currency_symbol);
|
|
90
|
+
const term = payload.subscription_estimate;
|
|
91
|
+
const proration = payload.proration_estimate;
|
|
92
|
+
return {
|
|
93
|
+
invoice: mapInvoiceEstimate(payload.invoice_estimate, money),
|
|
94
|
+
nextInvoice: mapInvoiceEstimate(payload.next_invoice_estimate, money),
|
|
95
|
+
proration: proration != null
|
|
96
|
+
? {
|
|
97
|
+
documentType: proration.document_type,
|
|
98
|
+
invoice: mapInvoiceEstimate(proration.invoice_estimate, money),
|
|
99
|
+
net: money(proration.net),
|
|
100
|
+
}
|
|
101
|
+
: undefined,
|
|
102
|
+
reason: payload.reason,
|
|
103
|
+
term: term != null
|
|
104
|
+
? {
|
|
105
|
+
becomesNonRenewing: term.becomes_non_renewing_after_this_term === true,
|
|
106
|
+
currentTermEnd: toEstimateDate(term.current_term_end),
|
|
107
|
+
currentTermStart: toEstimateDate(term.current_term_start),
|
|
108
|
+
nextBillingAt: toEstimateDate(term.next_billing_at),
|
|
109
|
+
}
|
|
110
|
+
: undefined,
|
|
111
|
+
willBeInvoiced: payload.will_be_invoiced,
|
|
112
|
+
};
|
|
113
|
+
};
|
|
@@ -2,10 +2,14 @@ import { createSlice } from '@reduxjs/toolkit';
|
|
|
2
2
|
import { clearAll } from '../../../rootActions';
|
|
3
3
|
import { applyInvoicingFormDraftEdit, applyInvoicingFormDraftFailure, applyInvoicingFormDraftSaved, applyInvoicingFormDraftSeed, } from '../invoicingFormDraft';
|
|
4
4
|
import { initialInvoicingSubscriptionFormLocalData } from './invoicingSubscriptionFormConfig';
|
|
5
|
+
const initialEstimateState = {
|
|
6
|
+
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
7
|
+
};
|
|
5
8
|
export const initialState = {
|
|
6
9
|
fetchState: 'Not-Started',
|
|
7
10
|
error: undefined,
|
|
8
11
|
editDraftById: {},
|
|
12
|
+
estimateState: initialEstimateState,
|
|
9
13
|
actionStateById: {},
|
|
10
14
|
recordStateById: {},
|
|
11
15
|
shippingAddressOwnerId: undefined,
|
|
@@ -19,6 +23,36 @@ const editInvoicingSubscriptionDetailView = createSlice({
|
|
|
19
23
|
name: 'editInvoicingSubscriptionDetailView',
|
|
20
24
|
initialState,
|
|
21
25
|
reducers: {
|
|
26
|
+
// What saving the draft would bill (no id: create); see the estimate epic.
|
|
27
|
+
fetchInvoicingSubscriptionEstimate(draft, action) {
|
|
28
|
+
draft.estimateState = {
|
|
29
|
+
fetchState: { fetchState: 'In-Progress', error: undefined },
|
|
30
|
+
subscriptionId: action.payload.id,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
// Dropped when the dialog has since moved to another subscription.
|
|
34
|
+
updateInvoicingSubscriptionEstimate(draft, action) {
|
|
35
|
+
if (draft.estimateState.subscriptionId !== action.payload.id) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
draft.estimateState.estimate = action.payload.estimate;
|
|
39
|
+
draft.estimateState.fetchState = {
|
|
40
|
+
fetchState: 'Completed',
|
|
41
|
+
error: undefined,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
updateInvoicingSubscriptionEstimateFailure(draft, action) {
|
|
45
|
+
if (draft.estimateState.subscriptionId !== action.payload.id) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
draft.estimateState.fetchState = {
|
|
49
|
+
fetchState: 'Error',
|
|
50
|
+
error: action.payload.status,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
clearInvoicingSubscriptionEstimate(draft) {
|
|
54
|
+
draft.estimateState = initialEstimateState;
|
|
55
|
+
},
|
|
22
56
|
runInvoicingSubscriptionAction(draft, action) {
|
|
23
57
|
draft.actionStateById[action.payload.id] = {
|
|
24
58
|
fetchState: 'In-Progress',
|
|
@@ -158,5 +192,5 @@ const editInvoicingSubscriptionDetailView = createSlice({
|
|
|
158
192
|
});
|
|
159
193
|
},
|
|
160
194
|
});
|
|
161
|
-
export const { runInvoicingSubscriptionAction, runInvoicingSubscriptionActionFailure, runInvoicingSubscriptionActionSuccess, fetchInvoicingSubscriptionDetail, fetchInvoicingSubscriptionDetailPage, fetchInvoicingSubscriptionFormPage, seedInvoicingSubscriptionFormDraft, updateInvoicingSubscriptionDetail, updateInvoicingSubscriptionDetailFailure, updateInvoicingSubscriptionFormDraft, submitInvoicingSubscriptionForm, submitInvoicingSubscriptionFormSuccess, submitInvoicingSubscriptionFormFailure, resetEditInvoicingSubscriptionDetailView, initializeInvoicingSubscriptionAddress, claimInvoicingSubscriptionShippingAddress, syncInvoicingSubscriptionCoupons, } = editInvoicingSubscriptionDetailView.actions;
|
|
195
|
+
export const { runInvoicingSubscriptionAction, runInvoicingSubscriptionActionFailure, runInvoicingSubscriptionActionSuccess, fetchInvoicingSubscriptionDetail, fetchInvoicingSubscriptionDetailPage, fetchInvoicingSubscriptionFormPage, seedInvoicingSubscriptionFormDraft, updateInvoicingSubscriptionDetail, updateInvoicingSubscriptionDetailFailure, updateInvoicingSubscriptionFormDraft, submitInvoicingSubscriptionForm, submitInvoicingSubscriptionFormSuccess, submitInvoicingSubscriptionFormFailure, resetEditInvoicingSubscriptionDetailView, initializeInvoicingSubscriptionAddress, claimInvoicingSubscriptionShippingAddress, syncInvoicingSubscriptionCoupons, fetchInvoicingSubscriptionEstimate, updateInvoicingSubscriptionEstimate, updateInvoicingSubscriptionEstimateFailure, clearInvoicingSubscriptionEstimate, } = editInvoicingSubscriptionDetailView.actions;
|
|
162
196
|
export default editInvoicingSubscriptionDetailView.reducer;
|
|
@@ -9,6 +9,57 @@ import { getInvoicingCustomerListView } from '../invoicingCustomerListView/invoi
|
|
|
9
9
|
import { getInvoicingFormDraftLocalData, isInvoicingFormDraftPending, } from '../invoicingFormDraft';
|
|
10
10
|
import { initialInvoicingSubscriptionFormLocalData } from './invoicingSubscriptionFormConfig';
|
|
11
11
|
import { INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE } from './invoicingSubscriptionFormConfig';
|
|
12
|
+
const notStartedEstimateView = {
|
|
13
|
+
creditsMayChange: false,
|
|
14
|
+
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
15
|
+
nonRenewing: false,
|
|
16
|
+
};
|
|
17
|
+
export const toInvoicingSubscriptionEstimateView = ({ estimate, fetchState, subscriptionId }, invoicingSubscriptionID) => {
|
|
18
|
+
// A slot asked for another subscription is not this form's estimate.
|
|
19
|
+
if (subscriptionId !== invoicingSubscriptionID) {
|
|
20
|
+
return notStartedEstimateView;
|
|
21
|
+
}
|
|
22
|
+
if (estimate == null) {
|
|
23
|
+
return { ...notStartedEstimateView, fetchState };
|
|
24
|
+
}
|
|
25
|
+
const { invoice, nextInvoice, proration, reason, term } = estimate;
|
|
26
|
+
const base = {
|
|
27
|
+
fetchState,
|
|
28
|
+
nonRenewing: term?.becomesNonRenewing === true,
|
|
29
|
+
nextBillingAt: term?.nextBillingAt,
|
|
30
|
+
reason: reason !== '' ? reason : undefined,
|
|
31
|
+
termEnd: term?.currentTermEnd,
|
|
32
|
+
termStart: term?.currentTermStart,
|
|
33
|
+
};
|
|
34
|
+
if (proration?.documentType === 'invoice' && proration.invoice != null) {
|
|
35
|
+
return {
|
|
36
|
+
...base,
|
|
37
|
+
creditsMayChange: false,
|
|
38
|
+
invoice: proration.invoice,
|
|
39
|
+
kind: 'proration_invoice',
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (proration?.documentType === 'credit_note') {
|
|
43
|
+
return {
|
|
44
|
+
...base,
|
|
45
|
+
creditsMayChange: false,
|
|
46
|
+
kind: 'proration_credit',
|
|
47
|
+
storeCredit: { ...proration.net, amount: Math.abs(proration.net.amount) },
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if (estimate.willBeInvoiced && invoice != null) {
|
|
51
|
+
return { ...base, creditsMayChange: false, invoice, kind: 'invoice_now' };
|
|
52
|
+
}
|
|
53
|
+
if (nextInvoice != null) {
|
|
54
|
+
return {
|
|
55
|
+
...base,
|
|
56
|
+
creditsMayChange: true,
|
|
57
|
+
invoice: nextInvoice,
|
|
58
|
+
kind: 'later_invoice',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return { ...base, creditsMayChange: false, kind: 'reason_only' };
|
|
62
|
+
};
|
|
12
63
|
export const getEditInvoicingSubscriptionDetailViewState = (state, invoicingSubscriptionID) => {
|
|
13
64
|
const { error, fetchState, savedSubscriptionId } = state.editInvoicingSubscriptionDetailViewState;
|
|
14
65
|
const { subscriptionCommercialEditAllowedFromStatuses, subscriptionLifecycleActionOptions, subscriptionMetadataEditAllowedFromStatuses, } = getInvoicingConfigView(state);
|
|
@@ -170,7 +221,7 @@ const toInvoicingCustomerOption = (customer) => ({
|
|
|
170
221
|
value: customer.id,
|
|
171
222
|
});
|
|
172
223
|
export const getInvoicingSubscriptionFormView = (state, invoicingSubscriptionID) => {
|
|
173
|
-
const { editDraftById, error, fetchState, newSubscriptionDraft, savedSubscriptionId, } = state.editInvoicingSubscriptionDetailViewState;
|
|
224
|
+
const { editDraftById, error, estimateState, fetchState, newSubscriptionDraft, savedSubscriptionId, } = state.editInvoicingSubscriptionDetailViewState;
|
|
174
225
|
const mode = invoicingSubscriptionID != null ? 'edit' : 'create';
|
|
175
226
|
const subscription = invoicingSubscriptionID != null
|
|
176
227
|
? getInvoicingSubscriptionById(state.invoicingSubscriptionState, invoicingSubscriptionID)
|
|
@@ -224,6 +275,7 @@ export const getInvoicingSubscriptionFormView = (state, invoicingSubscriptionID)
|
|
|
224
275
|
subscriptionMetadataEditAllowedFromStatuses: configState.subscriptionMetadataEditAllowedFromStatuses,
|
|
225
276
|
recordState,
|
|
226
277
|
isFormLoading: isInvoicingFormDraftPending(editDraftById, invoicingSubscriptionID),
|
|
278
|
+
estimate: toInvoicingSubscriptionEstimateView(estimateState, invoicingSubscriptionID),
|
|
227
279
|
fieldHelp: invoicingFieldHelpForGroup(state, 'subscription'),
|
|
228
280
|
addons: catalogItemOptionsOfType('addon'),
|
|
229
281
|
charges: catalogItemOptionsOfType('charge'),
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, map, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { getInvoicingCouponByCode } from '../../../entity/invoicing/coupon/couponSelector';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
|
+
import { mapInvoicingSubscriptionEstimatePayloadToState, } from './editInvoicingSubscriptionDetailViewPayload';
|
|
6
|
+
import { fetchInvoicingSubscriptionEstimate, updateInvoicingSubscriptionEstimate, updateInvoicingSubscriptionEstimateFailure, } from './editInvoicingSubscriptionDetailViewReducer';
|
|
7
|
+
import { invoicingSubscriptionSaveRequest, isInvoicingSubscriptionCouponChanged, } from './saveInvoicingSubscriptionEpic';
|
|
8
|
+
// Posts Save's exact body; a changed coupon rides along as `coupons` (Save syncs it after the PUT).
|
|
9
|
+
export const fetchInvoicingSubscriptionEstimateEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingSubscriptionEstimate.match), switchMap((action) => {
|
|
10
|
+
const { id } = action.payload;
|
|
11
|
+
const { data, localData, previousCouponCode } = invoicingSubscriptionSaveRequest(state$.value, id);
|
|
12
|
+
const couponCode = localData.couponId;
|
|
13
|
+
const coupon = getInvoicingCouponByCode(state$.value.invoicingCouponState, couponCode);
|
|
14
|
+
const body = id != null &&
|
|
15
|
+
isInvoicingSubscriptionCouponChanged(previousCouponCode, couponCode)
|
|
16
|
+
? {
|
|
17
|
+
...data,
|
|
18
|
+
coupons: couponCode !== ''
|
|
19
|
+
? [
|
|
20
|
+
{
|
|
21
|
+
applied_count: 0,
|
|
22
|
+
apply_till: null,
|
|
23
|
+
coupon_code: couponCode,
|
|
24
|
+
coupon_id: coupon?.id ?? couponCode,
|
|
25
|
+
},
|
|
26
|
+
]
|
|
27
|
+
: [],
|
|
28
|
+
}
|
|
29
|
+
: data;
|
|
30
|
+
const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/subscriptions`;
|
|
31
|
+
const url = id != null
|
|
32
|
+
? `${baseUrl}/${encodeURIComponent(id)}/estimate`
|
|
33
|
+
: `${baseUrl}/estimate`;
|
|
34
|
+
return zeniAPI
|
|
35
|
+
.postAndGetJSON(url, body)
|
|
36
|
+
.pipe(map((response) => isSuccessResponse(response) && response.data != null
|
|
37
|
+
? updateInvoicingSubscriptionEstimate({
|
|
38
|
+
estimate: mapInvoicingSubscriptionEstimatePayloadToState(response.data),
|
|
39
|
+
id,
|
|
40
|
+
})
|
|
41
|
+
: updateInvoicingSubscriptionEstimateFailure({
|
|
42
|
+
id,
|
|
43
|
+
status: response.status,
|
|
44
|
+
})), catchError((error) => of(updateInvoicingSubscriptionEstimateFailure({
|
|
45
|
+
id,
|
|
46
|
+
status: createZeniAPIStatus('Unexpected Error', 'Subscription estimate REST API call errored out ' +
|
|
47
|
+
JSON.stringify(error)),
|
|
48
|
+
}))));
|
|
49
|
+
}));
|
package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js
CHANGED
|
@@ -14,9 +14,10 @@ import { localDataToSaveInvoicingSubscriptionPayload, } from './editInvoicingSub
|
|
|
14
14
|
import { submitInvoicingSubscriptionForm, submitInvoicingSubscriptionFormFailure, submitInvoicingSubscriptionFormSuccess, syncInvoicingSubscriptionCoupons, } from './editInvoicingSubscriptionDetailViewReducer';
|
|
15
15
|
import { INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE } from './invoicingSubscriptionFormConfig';
|
|
16
16
|
const normalizeCouponCode = (value) => (value ?? '').trim().toUpperCase();
|
|
17
|
-
export const
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
export const isInvoicingSubscriptionCouponChanged = (previousCouponCode, nextCouponCode) => normalizeCouponCode(previousCouponCode) !==
|
|
18
|
+
normalizeCouponCode(nextCouponCode);
|
|
19
|
+
// The draft a save reads and the body it sends; the estimate previews the same body.
|
|
20
|
+
export const invoicingSubscriptionSaveRequest = (rootState, id) => {
|
|
20
21
|
const viewState = rootState.editInvoicingSubscriptionDetailViewState;
|
|
21
22
|
const localData = (id != null
|
|
22
23
|
? viewState.editDraftById[id]?.localData
|
|
@@ -25,18 +26,23 @@ export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => acti
|
|
|
25
26
|
// object in the payload (same pattern as the customer save flow).
|
|
26
27
|
const shippingAddress = rootState.addressViewState.newAddressState?.[INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE]?.addressToCreate;
|
|
27
28
|
const data = localDataToSaveInvoicingSubscriptionPayload(localData, shippingAddress);
|
|
28
|
-
// Coupons are synced via apply/remove-coupon after PUT (not via coupon_ids).
|
|
29
29
|
if (id != null) {
|
|
30
30
|
delete data.coupon_ids;
|
|
31
31
|
}
|
|
32
|
+
const savedCoupon = id != null
|
|
33
|
+
? rootState.invoicingSubscriptionState.invoicingSubscriptionByID[id]
|
|
34
|
+
?.coupons?.[0]
|
|
35
|
+
: undefined;
|
|
36
|
+
return {
|
|
37
|
+
data,
|
|
38
|
+
localData,
|
|
39
|
+
previousCouponCode: savedCoupon?.couponCode ?? savedCoupon?.couponID ?? '',
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(submitInvoicingSubscriptionForm.match), mergeMap((action) => {
|
|
43
|
+
const { id } = action.payload;
|
|
44
|
+
const { data, localData, previousCouponCode } = invoicingSubscriptionSaveRequest(state$.value, id);
|
|
32
45
|
const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
|
|
33
|
-
const previousCouponCode = id != null
|
|
34
|
-
? (rootState.invoicingSubscriptionState.invoicingSubscriptionByID[id]
|
|
35
|
-
?.coupons?.[0]?.couponCode ??
|
|
36
|
-
rootState.invoicingSubscriptionState.invoicingSubscriptionByID[id]
|
|
37
|
-
?.coupons?.[0]?.couponID ??
|
|
38
|
-
'')
|
|
39
|
-
: '';
|
|
40
46
|
const request$ = id != null
|
|
41
47
|
? zeniAPI.putAndGetJSON(`${baseUrl}/subscriptions/${encodeURIComponent(id)}`, { ...data })
|
|
42
48
|
: zeniAPI.postAndGetJSON(`${baseUrl}/subscriptions`, { ...data });
|
|
@@ -54,8 +60,7 @@ export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => acti
|
|
|
54
60
|
}
|
|
55
61
|
const saved = response.data;
|
|
56
62
|
const couponChanged = id != null &&
|
|
57
|
-
|
|
58
|
-
normalizeCouponCode(localData.couponId);
|
|
63
|
+
isInvoicingSubscriptionCouponChanged(previousCouponCode, localData.couponId);
|
|
59
64
|
// Edit + coupon change: merge the saved subscription, then hand the
|
|
60
65
|
// coupon attach/detach to syncInvoicingSubscriptionCouponsEpic, which
|
|
61
66
|
// finishes the flow (form success on both calls ok, form failure
|
package/lib/index.d.ts
CHANGED
|
@@ -1126,12 +1126,12 @@ export type { InvoicingCustomerFormLocalData } from './view/invoicing/editInvoic
|
|
|
1126
1126
|
export { INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE, entityToInvoicingCustomerFormLocalData, initialInvoicingCustomerFormLocalData, } from './view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig';
|
|
1127
1127
|
export { getInvoicingCustomerFormView } from './view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector';
|
|
1128
1128
|
export type { InvoicingCustomerFormView } from './view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector';
|
|
1129
|
-
export { fetchInvoicingSubscriptionFormPage, initializeInvoicingSubscriptionAddress, resetEditInvoicingSubscriptionDetailView, submitInvoicingSubscriptionForm, updateInvoicingSubscriptionFormDraft, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
1129
|
+
export { clearInvoicingSubscriptionEstimate, fetchInvoicingSubscriptionEstimate, fetchInvoicingSubscriptionFormPage, initializeInvoicingSubscriptionAddress, resetEditInvoicingSubscriptionDetailView, submitInvoicingSubscriptionForm, updateInvoicingSubscriptionFormDraft, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
1130
1130
|
export type { SubmitInvoicingSubscriptionFormPayload, UpdateInvoicingSubscriptionFormDraftPayload, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
1131
|
-
export type { InvoicingSubscriptionFormLocalData } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState';
|
|
1131
|
+
export type { InvoicingSubscriptionEstimateLineItem, InvoicingSubscriptionFormLocalData, InvoicingSubscriptionInvoiceEstimate, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState';
|
|
1132
1132
|
export { INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE, entityToInvoicingSubscriptionFormLocalData, initialInvoicingSubscriptionFormLocalData, invoicingSubscriptionTodayIso, toInvoicingSubscriptionQuantity, } from './view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig';
|
|
1133
1133
|
export { getEditInvoicingSubscriptionDetailViewState, getInvoicingSubscriptionFormView, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector';
|
|
1134
|
-
export type { EditInvoicingSubscriptionDetailView, InvoicingSubscriptionFormView, InvoicingSubscriptionOption, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector';
|
|
1134
|
+
export type { EditInvoicingSubscriptionDetailView, InvoicingSubscriptionEstimateKind, InvoicingSubscriptionEstimateView, InvoicingSubscriptionFormView, InvoicingSubscriptionOption, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector';
|
|
1135
1135
|
export { resetEditInvoicingCatalogItemDetailView, submitInvoicingCatalogItemForm, updateInvoicingCatalogItemFormDraft, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
1136
1136
|
export type { SubmitInvoicingCatalogItemFormPayload, UpdateInvoicingCatalogItemFormDraftPayload, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
1137
1137
|
export type { InvoicingCatalogAccountingLookup } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload';
|
package/lib/index.js
CHANGED
|
@@ -81,11 +81,11 @@ exports.toMccCategoryLike = exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION = expor
|
|
|
81
81
|
exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.getUpdateCardPolicyFetchState = exports.getCardPolicyFormDraft = exports.getCardPolicyDetailView = exports.getCardPolicyDetailFetchState = exports.updateCardPolicyFormDraft = exports.updateCardPolicyFetchStatus = exports.updateCardPolicyDetailFetchStatus = exports.updateCardPolicy = exports.fetchCardPolicyDetail = exports.getCardPolicyTemplateIds = exports.getCardPolicyListView = exports.getCardPolicyListFetchState = exports.getArchiveCardPolicyFetchState = exports.updateCardPolicyListFetchStatus = exports.updateArchiveCardPolicyFetchStatus = exports.prependCardPolicyTemplateIds = exports.fetchCardPolicyList = exports.archiveCardPolicy = exports.toManualCardPolicyTemplateRequestFromDraft = exports.toBulkCardPolicyTemplateRequestsFromDraft = exports.toCardPolicyTemplateRequestFromDraft = exports.applyAiCardPolicyFormDraftUpdate = exports.deriveAiPolicyReviewRowsFromInputs = exports.buildManualCardPolicyFormDraftSeed = exports.buildUploadReviewRows = exports.buildEmptyLimitRows = exports.buildAiCardPolicyFormDraftSeed = exports.toVendorChipFieldValue = exports.toMccCategoryChipFieldValue = exports.buildVendorChipId = exports.buildMccCategoryChipId = exports.VENDOR_CHIP_ID_PREFIX = exports.MCC_CHIP_ID_PREFIX = void 0;
|
|
82
82
|
exports.resetCreateInvoice = exports.fetchCreateInvoiceFormPage = exports.createInvoice = exports.getInvoiceDetail = exports.fetchInvoiceDetailPage = exports.fetchInvoiceDetail = exports.getInvoiceListView = exports.ALL_INVOICING_INVOICE_TAB_IDS = exports.updateInvoiceListFilters = exports.setInvoiceActiveTab = exports.fetchInvoiceListPage = exports.fetchInvoiceList = exports.fetchInvoiceKPIs = exports.fetchInvoiceCounts = exports.getInvoicesByIds = exports.getInvoiceById = exports.updateInvoices = exports.removeInvoice = exports.mapAuditLogEntry = exports.toAuditLogEntityRouteOption = exports.isInvoicingEntityLinkable = exports.buildInvoicingEntityPath = exports.toInvoicingDiscountLifecycleActionOption = exports.toInvoicingDiscountLifecycleAction = exports.toInvoicingCatalogProductLifecycleActionOption = exports.toInvoicingCatalogItemLifecycleActionOption = exports.toInvoicingCatalogProductLifecycleAction = exports.toInvoicingCatalogItemLifecycleAction = exports.toInvoicingSubscriptionLifecycleActionOption = exports.toInvoicingSubscriptionLifecycleAction = exports.toInvoicingDunningAction = exports.INVOICING_DISCOUNT_LIFECYCLE_ACTIONS = exports.INVOICING_CATALOG_PRODUCT_LIFECYCLE_ACTIONS = exports.INVOICING_CATALOG_ITEM_LIFECYCLE_ACTIONS = exports.INVOICING_SUBSCRIPTION_LIFECYCLE_ACTIONS = exports.INVOICING_DUNNING_ACTIONS = exports.toKycProvidedDocumentTypeFromAllowed = exports.toKycProvidedDocumentType = exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = void 0;
|
|
83
83
|
exports.entityToInvoicingCustomerFormLocalData = exports.INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE = exports.updateInvoicingCustomerFormDraft = exports.submitInvoicingCustomerFormSuccess = exports.submitInvoicingCustomerFormFailure = exports.submitInvoicingCustomerForm = exports.resetEditInvoicingCustomerDetailView = exports.initializeInvoicingCustomerAddress = exports.getRecordPaymentView = exports.getRecordPaymentInvoiceOptions = exports.getRecordPaymentFormView = exports.getCreateInvoiceFormView = exports.getInvoicingAuditView = exports.fetchInvoicingAuditLog = exports.getInvoicingOverview = exports.buildPeriodOptions = exports.fetchInvoicingOverview = exports.clearInvoicingOverview = exports.initialRecordPaymentFormLocalData = exports.localDataToRecordPaymentPayload = exports.localDataToInvoiceRecordPaymentBody = exports.initializeRecordPaymentDraftFromInvoice = exports.getCreateCreditNoteView = exports.getCreateCreditNoteFormView = exports.initialCreateCreditNoteFormLocalData = exports.localDataToCreateCreditNotePayload = exports.updateCreateCreditNoteFormDraft = exports.submitCreateCreditNote = exports.resetCreateCreditNote = exports.createCreditNoteSuccess = exports.createCreditNoteFailure = exports.getIssueCreditNoteView = exports.initialIssueCreditNoteFormLocalData = exports.localDataToIssueCreditNotePayload = exports.initializeIssueCreditNoteDraftFromInvoice = exports.computeIssueCreditNoteTotal = exports.updateIssueCreditNoteFormDraft = exports.submitIssueCreditNote = exports.resetIssueCreditNote = exports.issueCreditNoteSuccess = exports.issueCreditNoteFailure = exports.initializeIssueCreditNoteDraft = exports.updateRecordPaymentFormDraft = exports.submitRecordPayment = exports.initializeRecordPaymentDraft = exports.resetRecordPayment = exports.initialInvoicingCreateInvoiceFormLocalData = exports.createInvoiceFormLocalDataToRequest = exports.blankInvoicingCreateInvoiceLineItem = exports.updateInvoicingCreateInvoiceFormDraft = void 0;
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
88
|
-
exports.isPendingReviewAccrual = exports.isManuallyReversedAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getExpenseAutomationActualMatchingMatchView = exports.parseActualMatchingMatchId = exports.getCloseMatchAfterUndoMatchId = exports.getCloseMatchAfterUndo = exports.getCloseMatchAfterIgnoreMatchId = exports.getActualMatchingMatchModalConfirmStatus = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.invoicingQboSettingsLocalDataToPayload = exports.initialInvoicingQboSettingsLocalData = exports.entityToInvoicingQboSettingsLocalData = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = void 0;
|
|
84
|
+
exports.runInvoicingCatalogProductAction = exports.runInvoicingCatalogPlanAction = exports.fetchInvoicingCatalogItemDetailPage = exports.shouldDefaultAdjustmentCreditNote = exports.isBackdatedInvoiceDate = exports.buildVoidInvoiceSubmitBody = exports.updateInvoicingInvoice = exports.runInvoicingInvoiceAction = exports.getInvoicingCouponFormView = exports.getEditInvoicingCouponDetailViewState = exports.initialInvoicingCouponFormLocalData = exports.entityToInvoicingCouponFormLocalData = exports.updateInvoicingCouponFormDraft = exports.submitInvoicingCouponForm = exports.saveInvoicingCoupon = exports.resetEditInvoicingCouponDetailView = exports.fetchInvoicingCouponDetailPage = exports.getSavedInvoicingCatalogItemKind = exports.getSavedInvoicingCatalogItemId = exports.getInvoicingCatalogItemFormView = exports.getInvoicingApplicableCatalogItemOptions = exports.isTieredCatalogPricingModel = exports.initialInvoicingCatalogItemFormLocalData = exports.invoicingProductToCatalogItemFormSubFamily = exports.entityToInvoicingCatalogItemFormLocalData = exports.blankInvoicingCatalogTier = exports.blankInvoicingCatalogSubFamily = exports.INVOICING_CATALOG_TIER_TYPE_VALUES = exports.INVOICING_CATALOG_PRORATION_VALUES = exports.INVOICING_CATALOG_PRICING_MODEL_VALUES = exports.INVOICING_CATALOG_APPLICABILITY_VALUES = exports.updateInvoicingCatalogItemFormDraft = exports.submitInvoicingCatalogItemForm = exports.resetEditInvoicingCatalogItemDetailView = exports.getInvoicingSubscriptionFormView = exports.getEditInvoicingSubscriptionDetailViewState = exports.toInvoicingSubscriptionQuantity = exports.invoicingSubscriptionTodayIso = exports.initialInvoicingSubscriptionFormLocalData = exports.entityToInvoicingSubscriptionFormLocalData = exports.INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE = exports.updateInvoicingSubscriptionFormDraft = exports.submitInvoicingSubscriptionForm = exports.resetEditInvoicingSubscriptionDetailView = exports.initializeInvoicingSubscriptionAddress = exports.fetchInvoicingSubscriptionFormPage = exports.fetchInvoicingSubscriptionEstimate = exports.clearInvoicingSubscriptionEstimate = exports.getInvoicingCustomerFormView = exports.initialInvoicingCustomerFormLocalData = void 0;
|
|
85
|
+
exports.setInvoicingSubscriptionActiveTab = exports.fetchInvoicingSubscriptionListPage = exports.fetchInvoicingSubscriptionList = exports.fetchInvoicingSubscriptionCounts = exports.updateInvoicingSubscriptions = exports.removeInvoicingSubscription = exports.resetPromotionalCreditAction = exports.submitAddPromotionalCredits = exports.getInvoicingSetupIntentFetchState = exports.getInvoicingSetupIntent = exports.getInvoicingSentPaymentLinkMagicUrl = exports.getInvoicingSentPaymentLinkEmail = exports.getInvoicingPlaidLinkToken = exports.getInvoicingPaymentMethodSaveState = exports.getInvoicingPaymentLinkSendState = exports.sendInvoicingPaymentLink = exports.saveInvoicingPaymentMethod = exports.resetInvoicingCustomerPaymentMethod = exports.fetchInvoicingPlaidLinkToken = exports.createInvoicingSetupIntent = exports.fetchInvoicingPaymentLinkEmailPreviewPage = exports.fetchInvoicingCustomerDetailPage = exports.fetchInvoicingCustomerDetail = exports.getInvoicingCustomerListView = exports.INVOICING_CUSTOMER_COLUMNS = exports.ALL_INVOICING_CUSTOMER_TAB_IDS = exports.ALL_INVOICING_CUSTOMER_SORT_KEYS = exports.updateInvoicingCustomerFilters = exports.setInvoicingCustomerActiveTab = exports.fetchInvoicingCustomerListPage = exports.fetchInvoicingCustomerList = exports.fetchInvoicingCustomerCounts = exports.updateInvoicingCustomers = exports.removeInvoicingCustomer = exports.INVOICING_LIST_PAGE_SIZE = exports.uploadInvoicingMigrationFiles = exports.startInvoicingMigration = exports.rollbackInvoicingMigration = exports.retryInvoicingMigration = exports.connectInvoicingChargebee = exports.getInvoicingDataImportView = exports.setInvoicingActiveMigrationSessionId = exports.fetchInvoicingMigrationSessions = exports.fetchInvoicingMigrationSession = exports.fetchInvoicingMigrationDiagnostics = exports.fetchInvoicingDataImportStatus = exports.runInvoicingPaymentAction = exports.runInvoicingDunningAction = exports.runInvoicingSubscriptionAction = exports.runInvoicingDiscountAction = void 0;
|
|
86
|
+
exports.getInvoicingCouponListItems = exports.getInvoicingCouponListHasMore = exports.getInvoicingCouponListFilters = exports.getInvoicingCouponListFetchState = exports.getInvoicingCouponCounts = exports.INVOICING_COUPON_COLUMNS = exports.ALL_INVOICING_COUPON_TAB_IDS = exports.ALL_INVOICING_COUPON_SORT_KEYS = exports.updateInvoicingCouponFilters = exports.setInvoicingCouponActiveTab = exports.fetchInvoicingCouponListPage = exports.fetchInvoicingCouponList = exports.fetchInvoicingCouponCounts = exports.updateInvoicingCoupons = exports.removeInvoicingCoupon = exports.getInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteById = exports.fetchInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteListView = exports.INVOICING_CREDIT_NOTE_COLUMNS = exports.ALL_INVOICING_CREDIT_NOTE_TAB_IDS = exports.ALL_INVOICING_CREDIT_NOTE_SORT_KEYS = exports.updateInvoicingCreditNoteFilters = exports.setInvoicingCreditNoteActiveTab = exports.fetchInvoicingCreditNoteListPage = exports.fetchInvoicingCreditNoteList = exports.fetchInvoicingCreditNoteCounts = exports.updateInvoicingCreditNotes = exports.removeInvoicingCreditNote = exports.getInvoicingTransactionDetail = exports.getInvoicingTransactionById = exports.fetchInvoicingTransactionDetail = exports.getInvoicingTransactionListView = exports.INVOICING_TRANSACTION_COLUMNS = exports.ALL_INVOICING_TRANSACTION_TAB_IDS = exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = exports.updateInvoicingTransactionFilters = exports.setInvoicingTransactionActiveTab = exports.fetchInvoicingTransactionListPage = exports.fetchInvoicingTransactionList = exports.updateInvoicingTransactions = exports.removeInvoicingTransaction = exports.getInvoicingSubscriptionById = exports.fetchInvoicingSubscriptionDetailPage = exports.fetchInvoicingSubscriptionDetail = exports.getInvoicingSubscriptionListView = exports.INVOICING_SUBSCRIPTION_COLUMNS = exports.ALL_INVOICING_SUBSCRIPTION_TAB_IDS = exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = exports.updateInvoicingSubscriptionFilters = void 0;
|
|
87
|
+
exports.getInvoicingQboSettingsFormView = exports.getInvoicingBrandingFormView = exports.updateInvoicingSettings = exports.updateInvoicingQboSettingsDraft = exports.updateInvoicingBrandingFormDraft = exports.submitInvoicingQboSettings = exports.submitInvoicingBrandingForm = exports.saveInvoicingSettings = exports.resetSaveInvoicingSettings = exports.resetInvoicingQboSettingsDraft = exports.resetInvoicingBrandingFormDraft = exports.fetchInvoicingSettings = exports.disconnectInvoicingStripe = exports.connectInvoicingStripe = exports.getLowestInvoicingCatalogPricePointAmount = exports.getInvoicingCatalogItemById = exports.fetchInvoicingCatalogItemDetail = exports.getInvoicingCatalogListView = exports.updateInvoicingCatalogProductFilters = exports.updateInvoicingCatalogPlanFilters = exports.fetchInvoicingCatalogProductList = exports.fetchInvoicingCatalogPlanList = exports.fetchInvoicingCatalogListPage = exports.fetchInvoicingCatalogCounts = exports.updateInvoicingCatalogItems = exports.removeInvoicingCatalogItem = exports.mergeInvoicingCatalogPricePoint = exports.getInvoicingDunningEmailPreview = exports.getInvoicingDunningCaseDetail = exports.getInvoicingDunningCaseById = exports.invalidateInvoicingDunningEmailPreview = exports.fetchInvoicingDunningEmailPreviewPage = exports.fetchInvoicingDunningCaseDetailPage = exports.fetchInvoicingDunningCaseDetail = exports.clearInvoicingDunningCaseDetailView = exports.getInvoicingDunningCaseListView = exports.INVOICING_DUNNING_CASE_COLUMNS = exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS = exports.ALL_INVOICING_DUNNING_CASE_SORT_KEYS = exports.updateInvoicingDunningCaseFilters = exports.setInvoicingDunningCaseActiveTab = exports.fetchInvoicingDunningCaseListPage = exports.fetchInvoicingDunningCaseList = exports.fetchInvoicingDunningCaseCounts = exports.updateInvoicingDunningCases = exports.removeInvoicingDunningCase = exports.fetchInvoicingCouponDetail = exports.getInvoicingCouponById = exports.getInvoicingCouponListView = exports.getInvoicingCouponListNextCursor = void 0;
|
|
88
|
+
exports.isPendingReviewAccrual = exports.isManuallyReversedAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getExpenseAutomationActualMatchingMatchView = exports.parseActualMatchingMatchId = exports.getCloseMatchAfterUndoMatchId = exports.getCloseMatchAfterUndo = exports.getCloseMatchAfterIgnoreMatchId = exports.getActualMatchingMatchModalConfirmStatus = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.invoicingQboSettingsLocalDataToPayload = exports.initialInvoicingQboSettingsLocalData = exports.entityToInvoicingQboSettingsLocalData = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = void 0;
|
|
89
89
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
90
90
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
91
91
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -2915,6 +2915,8 @@ Object.defineProperty(exports, "initialInvoicingCustomerFormLocalData", { enumer
|
|
|
2915
2915
|
var editInvoicingCustomerDetailViewSelector_1 = require("./view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector");
|
|
2916
2916
|
Object.defineProperty(exports, "getInvoicingCustomerFormView", { enumerable: true, get: function () { return editInvoicingCustomerDetailViewSelector_1.getInvoicingCustomerFormView; } });
|
|
2917
2917
|
var editInvoicingSubscriptionDetailViewReducer_1 = require("./view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer");
|
|
2918
|
+
Object.defineProperty(exports, "clearInvoicingSubscriptionEstimate", { enumerable: true, get: function () { return editInvoicingSubscriptionDetailViewReducer_1.clearInvoicingSubscriptionEstimate; } });
|
|
2919
|
+
Object.defineProperty(exports, "fetchInvoicingSubscriptionEstimate", { enumerable: true, get: function () { return editInvoicingSubscriptionDetailViewReducer_1.fetchInvoicingSubscriptionEstimate; } });
|
|
2918
2920
|
Object.defineProperty(exports, "fetchInvoicingSubscriptionFormPage", { enumerable: true, get: function () { return editInvoicingSubscriptionDetailViewReducer_1.fetchInvoicingSubscriptionFormPage; } });
|
|
2919
2921
|
Object.defineProperty(exports, "initializeInvoicingSubscriptionAddress", { enumerable: true, get: function () { return editInvoicingSubscriptionDetailViewReducer_1.initializeInvoicingSubscriptionAddress; } });
|
|
2920
2922
|
Object.defineProperty(exports, "resetEditInvoicingSubscriptionDetailView", { enumerable: true, get: function () { return editInvoicingSubscriptionDetailViewReducer_1.resetEditInvoicingSubscriptionDetailView; } });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InvoicingSubscriptionPayload } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
3
|
import { AddressUpdatableInfo } from '../../addressView/addressViewState';
|
|
4
|
-
import { InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionDetailViewState';
|
|
4
|
+
import { InvoicingSubscriptionEstimate, InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionDetailViewState';
|
|
5
5
|
export type SaveInvoicingSubscriptionResponse = ZeniAPIResponse<InvoicingSubscriptionPayload>;
|
|
6
6
|
/**
|
|
7
7
|
* Build the create/update subscription request body from the form draft. The
|
|
@@ -74,3 +74,48 @@ export type ScheduleChargeBody = {
|
|
|
74
74
|
};
|
|
75
75
|
export type InvoicingSubscriptionActionBody = ApplyCouponBody | RemoveCouponBody | AddChargesBody | PauseSubscriptionBody | CancelSubscriptionBody | ChangePlanBody | ChangeTermEndBody | ScheduleChargeBody | Record<string, never>;
|
|
76
76
|
export type InvoicingSubscriptionDetailResponse = ZeniAPIResponse<InvoicingSubscriptionPayload>;
|
|
77
|
+
interface InvoicingSubscriptionEstimateLineItemPayload {
|
|
78
|
+
amount: number;
|
|
79
|
+
description: string;
|
|
80
|
+
discount_amount: number;
|
|
81
|
+
quantity: number;
|
|
82
|
+
unit_amount: number;
|
|
83
|
+
date_from?: string;
|
|
84
|
+
date_to?: string;
|
|
85
|
+
tax_amount?: number | null;
|
|
86
|
+
}
|
|
87
|
+
interface InvoicingSubscriptionInvoiceEstimatePayload {
|
|
88
|
+
amount_due: number;
|
|
89
|
+
coupon_discount_total: number;
|
|
90
|
+
credits_applied: number;
|
|
91
|
+
gross_sub_total: number;
|
|
92
|
+
line_items: InvoicingSubscriptionEstimateLineItemPayload[];
|
|
93
|
+
promotional_credits_applied: number;
|
|
94
|
+
sub_total: number;
|
|
95
|
+
tax: number | null;
|
|
96
|
+
total: number;
|
|
97
|
+
due_date?: string;
|
|
98
|
+
invoice_date?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface InvoicingSubscriptionEstimatePayload {
|
|
101
|
+
currency_code: string;
|
|
102
|
+
currency_symbol: string;
|
|
103
|
+
invoice_estimate: InvoicingSubscriptionInvoiceEstimatePayload | null;
|
|
104
|
+
next_invoice_estimate: InvoicingSubscriptionInvoiceEstimatePayload | null;
|
|
105
|
+
proration_estimate: {
|
|
106
|
+
document_type: string;
|
|
107
|
+
invoice_estimate: InvoicingSubscriptionInvoiceEstimatePayload | null;
|
|
108
|
+
net: number;
|
|
109
|
+
} | null;
|
|
110
|
+
reason: string;
|
|
111
|
+
subscription_estimate: {
|
|
112
|
+
becomes_non_renewing_after_this_term?: boolean;
|
|
113
|
+
current_term_end?: string;
|
|
114
|
+
current_term_start?: string;
|
|
115
|
+
next_billing_at?: string | null;
|
|
116
|
+
} | null;
|
|
117
|
+
will_be_invoiced: boolean;
|
|
118
|
+
}
|
|
119
|
+
export type InvoicingSubscriptionEstimateResponse = ZeniAPIResponse<InvoicingSubscriptionEstimatePayload>;
|
|
120
|
+
export declare const mapInvoicingSubscriptionEstimatePayloadToState: (payload: InvoicingSubscriptionEstimatePayload) => InvoicingSubscriptionEstimate;
|
|
121
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.localDataToSaveInvoicingSubscriptionPayload = void 0;
|
|
3
|
+
exports.mapInvoicingSubscriptionEstimatePayloadToState = exports.localDataToSaveInvoicingSubscriptionPayload = void 0;
|
|
4
|
+
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
4
6
|
const addressViewPayload_1 = require("../../addressView/addressViewPayload");
|
|
5
7
|
const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
|
|
6
8
|
/**
|
|
@@ -60,3 +62,57 @@ const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingAddress)
|
|
|
60
62
|
};
|
|
61
63
|
};
|
|
62
64
|
exports.localDataToSaveInvoicingSubscriptionPayload = localDataToSaveInvoicingSubscriptionPayload;
|
|
65
|
+
const toEstimateDate = (value) => value != null && value !== '' ? (0, zeniDayJS_1.date)(value) : undefined;
|
|
66
|
+
const mapInvoiceEstimate = (payload, money) => payload == null
|
|
67
|
+
? undefined
|
|
68
|
+
: {
|
|
69
|
+
amountDue: money(payload.amount_due),
|
|
70
|
+
couponDiscountTotal: money(payload.coupon_discount_total),
|
|
71
|
+
creditsApplied: money(payload.credits_applied),
|
|
72
|
+
dueDate: toEstimateDate(payload.due_date),
|
|
73
|
+
grossSubTotal: money(payload.gross_sub_total),
|
|
74
|
+
invoiceDate: toEstimateDate(payload.invoice_date),
|
|
75
|
+
lineItems: payload.line_items.map((lineItem) => ({
|
|
76
|
+
amount: money(lineItem.amount),
|
|
77
|
+
dateFrom: toEstimateDate(lineItem.date_from),
|
|
78
|
+
dateTo: toEstimateDate(lineItem.date_to),
|
|
79
|
+
description: lineItem.description,
|
|
80
|
+
discountAmount: money(lineItem.discount_amount),
|
|
81
|
+
quantity: lineItem.quantity,
|
|
82
|
+
taxAmount: lineItem.tax_amount != null
|
|
83
|
+
? money(lineItem.tax_amount)
|
|
84
|
+
: undefined,
|
|
85
|
+
unitAmount: money(lineItem.unit_amount),
|
|
86
|
+
})),
|
|
87
|
+
promotionalCreditsApplied: money(payload.promotional_credits_applied),
|
|
88
|
+
subTotal: money(payload.sub_total),
|
|
89
|
+
tax: payload.tax != null ? money(payload.tax) : undefined,
|
|
90
|
+
total: money(payload.total),
|
|
91
|
+
};
|
|
92
|
+
const mapInvoicingSubscriptionEstimatePayloadToState = (payload) => {
|
|
93
|
+
const money = (amount) => (0, amount_1.toAmount)(amount, payload.currency_code, payload.currency_symbol);
|
|
94
|
+
const term = payload.subscription_estimate;
|
|
95
|
+
const proration = payload.proration_estimate;
|
|
96
|
+
return {
|
|
97
|
+
invoice: mapInvoiceEstimate(payload.invoice_estimate, money),
|
|
98
|
+
nextInvoice: mapInvoiceEstimate(payload.next_invoice_estimate, money),
|
|
99
|
+
proration: proration != null
|
|
100
|
+
? {
|
|
101
|
+
documentType: proration.document_type,
|
|
102
|
+
invoice: mapInvoiceEstimate(proration.invoice_estimate, money),
|
|
103
|
+
net: money(proration.net),
|
|
104
|
+
}
|
|
105
|
+
: undefined,
|
|
106
|
+
reason: payload.reason,
|
|
107
|
+
term: term != null
|
|
108
|
+
? {
|
|
109
|
+
becomesNonRenewing: term.becomes_non_renewing_after_this_term === true,
|
|
110
|
+
currentTermEnd: toEstimateDate(term.current_term_end),
|
|
111
|
+
currentTermStart: toEstimateDate(term.current_term_start),
|
|
112
|
+
nextBillingAt: toEstimateDate(term.next_billing_at),
|
|
113
|
+
}
|
|
114
|
+
: undefined,
|
|
115
|
+
willBeInvoiced: payload.will_be_invoiced,
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
exports.mapInvoicingSubscriptionEstimatePayloadToState = mapInvoicingSubscriptionEstimatePayloadToState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
3
|
import { InvoicingSubscriptionActionBody } from './editInvoicingSubscriptionDetailViewPayload';
|
|
4
|
-
import { EditInvoicingSubscriptionDetailViewState, InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionDetailViewState';
|
|
4
|
+
import { EditInvoicingSubscriptionDetailViewState, InvoicingSubscriptionEstimate, InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionDetailViewState';
|
|
5
5
|
/** Push the full form draft into CES (edit tree when `id` is present). */
|
|
6
6
|
export interface UpdateInvoicingSubscriptionFormDraftPayload {
|
|
7
7
|
localData: InvoicingSubscriptionFormLocalData;
|
|
@@ -59,6 +59,14 @@ export declare const runInvoicingSubscriptionAction: import("@reduxjs/toolkit").
|
|
|
59
59
|
id?: ID;
|
|
60
60
|
} | undefined, "editInvoicingSubscriptionDetailView/resetEditInvoicingSubscriptionDetailView">, initializeInvoicingSubscriptionAddress: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: InitializeInvoicingSubscriptionAddressPayload], InitializeInvoicingSubscriptionAddressPayload, "editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddress", never, never>, claimInvoicingSubscriptionShippingAddress: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
61
61
|
id: ID;
|
|
62
|
-
}, "editInvoicingSubscriptionDetailView/claimInvoicingSubscriptionShippingAddress">, syncInvoicingSubscriptionCoupons: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SyncInvoicingSubscriptionCouponsPayload], SyncInvoicingSubscriptionCouponsPayload, "editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCoupons", never, never
|
|
62
|
+
}, "editInvoicingSubscriptionDetailView/claimInvoicingSubscriptionShippingAddress">, syncInvoicingSubscriptionCoupons: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SyncInvoicingSubscriptionCouponsPayload], SyncInvoicingSubscriptionCouponsPayload, "editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCoupons", never, never>, fetchInvoicingSubscriptionEstimate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
63
|
+
id?: ID;
|
|
64
|
+
}, "editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionEstimate">, updateInvoicingSubscriptionEstimate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
65
|
+
estimate: InvoicingSubscriptionEstimate;
|
|
66
|
+
id?: ID;
|
|
67
|
+
}, "editInvoicingSubscriptionDetailView/updateInvoicingSubscriptionEstimate">, updateInvoicingSubscriptionEstimateFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
68
|
+
status: ZeniAPIStatus;
|
|
69
|
+
id?: ID;
|
|
70
|
+
}, "editInvoicingSubscriptionDetailView/updateInvoicingSubscriptionEstimateFailure">, clearInvoicingSubscriptionEstimate: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"editInvoicingSubscriptionDetailView/clearInvoicingSubscriptionEstimate">;
|
|
63
71
|
declare const _default: import("redux").Reducer<EditInvoicingSubscriptionDetailViewState>;
|
|
64
72
|
export default _default;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.syncInvoicingSubscriptionCoupons = exports.claimInvoicingSubscriptionShippingAddress = exports.initializeInvoicingSubscriptionAddress = exports.resetEditInvoicingSubscriptionDetailView = exports.submitInvoicingSubscriptionFormFailure = exports.submitInvoicingSubscriptionFormSuccess = exports.submitInvoicingSubscriptionForm = exports.updateInvoicingSubscriptionFormDraft = exports.updateInvoicingSubscriptionDetailFailure = exports.updateInvoicingSubscriptionDetail = exports.seedInvoicingSubscriptionFormDraft = exports.fetchInvoicingSubscriptionFormPage = exports.fetchInvoicingSubscriptionDetailPage = exports.fetchInvoicingSubscriptionDetail = exports.runInvoicingSubscriptionActionSuccess = exports.runInvoicingSubscriptionActionFailure = exports.runInvoicingSubscriptionAction = exports.initialState = void 0;
|
|
4
|
+
exports.clearInvoicingSubscriptionEstimate = exports.updateInvoicingSubscriptionEstimateFailure = exports.updateInvoicingSubscriptionEstimate = exports.fetchInvoicingSubscriptionEstimate = exports.syncInvoicingSubscriptionCoupons = exports.claimInvoicingSubscriptionShippingAddress = exports.initializeInvoicingSubscriptionAddress = exports.resetEditInvoicingSubscriptionDetailView = exports.submitInvoicingSubscriptionFormFailure = exports.submitInvoicingSubscriptionFormSuccess = exports.submitInvoicingSubscriptionForm = exports.updateInvoicingSubscriptionFormDraft = exports.updateInvoicingSubscriptionDetailFailure = exports.updateInvoicingSubscriptionDetail = exports.seedInvoicingSubscriptionFormDraft = exports.fetchInvoicingSubscriptionFormPage = exports.fetchInvoicingSubscriptionDetailPage = exports.fetchInvoicingSubscriptionDetail = exports.runInvoicingSubscriptionActionSuccess = exports.runInvoicingSubscriptionActionFailure = exports.runInvoicingSubscriptionAction = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const rootActions_1 = require("../../../rootActions");
|
|
7
7
|
const invoicingFormDraft_1 = require("../invoicingFormDraft");
|
|
8
8
|
const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
|
|
9
|
+
const initialEstimateState = {
|
|
10
|
+
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
11
|
+
};
|
|
9
12
|
exports.initialState = {
|
|
10
13
|
fetchState: 'Not-Started',
|
|
11
14
|
error: undefined,
|
|
12
15
|
editDraftById: {},
|
|
16
|
+
estimateState: initialEstimateState,
|
|
13
17
|
actionStateById: {},
|
|
14
18
|
recordStateById: {},
|
|
15
19
|
shippingAddressOwnerId: undefined,
|
|
@@ -23,6 +27,36 @@ const editInvoicingSubscriptionDetailView = (0, toolkit_1.createSlice)({
|
|
|
23
27
|
name: 'editInvoicingSubscriptionDetailView',
|
|
24
28
|
initialState: exports.initialState,
|
|
25
29
|
reducers: {
|
|
30
|
+
// What saving the draft would bill (no id: create); see the estimate epic.
|
|
31
|
+
fetchInvoicingSubscriptionEstimate(draft, action) {
|
|
32
|
+
draft.estimateState = {
|
|
33
|
+
fetchState: { fetchState: 'In-Progress', error: undefined },
|
|
34
|
+
subscriptionId: action.payload.id,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
// Dropped when the dialog has since moved to another subscription.
|
|
38
|
+
updateInvoicingSubscriptionEstimate(draft, action) {
|
|
39
|
+
if (draft.estimateState.subscriptionId !== action.payload.id) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
draft.estimateState.estimate = action.payload.estimate;
|
|
43
|
+
draft.estimateState.fetchState = {
|
|
44
|
+
fetchState: 'Completed',
|
|
45
|
+
error: undefined,
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
updateInvoicingSubscriptionEstimateFailure(draft, action) {
|
|
49
|
+
if (draft.estimateState.subscriptionId !== action.payload.id) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
draft.estimateState.fetchState = {
|
|
53
|
+
fetchState: 'Error',
|
|
54
|
+
error: action.payload.status,
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
clearInvoicingSubscriptionEstimate(draft) {
|
|
58
|
+
draft.estimateState = initialEstimateState;
|
|
59
|
+
},
|
|
26
60
|
runInvoicingSubscriptionAction(draft, action) {
|
|
27
61
|
draft.actionStateById[action.payload.id] = {
|
|
28
62
|
fetchState: 'In-Progress',
|
|
@@ -162,5 +196,5 @@ const editInvoicingSubscriptionDetailView = (0, toolkit_1.createSlice)({
|
|
|
162
196
|
});
|
|
163
197
|
},
|
|
164
198
|
});
|
|
165
|
-
_a = editInvoicingSubscriptionDetailView.actions, exports.runInvoicingSubscriptionAction = _a.runInvoicingSubscriptionAction, exports.runInvoicingSubscriptionActionFailure = _a.runInvoicingSubscriptionActionFailure, exports.runInvoicingSubscriptionActionSuccess = _a.runInvoicingSubscriptionActionSuccess, exports.fetchInvoicingSubscriptionDetail = _a.fetchInvoicingSubscriptionDetail, exports.fetchInvoicingSubscriptionDetailPage = _a.fetchInvoicingSubscriptionDetailPage, exports.fetchInvoicingSubscriptionFormPage = _a.fetchInvoicingSubscriptionFormPage, exports.seedInvoicingSubscriptionFormDraft = _a.seedInvoicingSubscriptionFormDraft, exports.updateInvoicingSubscriptionDetail = _a.updateInvoicingSubscriptionDetail, exports.updateInvoicingSubscriptionDetailFailure = _a.updateInvoicingSubscriptionDetailFailure, exports.updateInvoicingSubscriptionFormDraft = _a.updateInvoicingSubscriptionFormDraft, exports.submitInvoicingSubscriptionForm = _a.submitInvoicingSubscriptionForm, exports.submitInvoicingSubscriptionFormSuccess = _a.submitInvoicingSubscriptionFormSuccess, exports.submitInvoicingSubscriptionFormFailure = _a.submitInvoicingSubscriptionFormFailure, exports.resetEditInvoicingSubscriptionDetailView = _a.resetEditInvoicingSubscriptionDetailView, exports.initializeInvoicingSubscriptionAddress = _a.initializeInvoicingSubscriptionAddress, exports.claimInvoicingSubscriptionShippingAddress = _a.claimInvoicingSubscriptionShippingAddress, exports.syncInvoicingSubscriptionCoupons = _a.syncInvoicingSubscriptionCoupons;
|
|
199
|
+
_a = editInvoicingSubscriptionDetailView.actions, exports.runInvoicingSubscriptionAction = _a.runInvoicingSubscriptionAction, exports.runInvoicingSubscriptionActionFailure = _a.runInvoicingSubscriptionActionFailure, exports.runInvoicingSubscriptionActionSuccess = _a.runInvoicingSubscriptionActionSuccess, exports.fetchInvoicingSubscriptionDetail = _a.fetchInvoicingSubscriptionDetail, exports.fetchInvoicingSubscriptionDetailPage = _a.fetchInvoicingSubscriptionDetailPage, exports.fetchInvoicingSubscriptionFormPage = _a.fetchInvoicingSubscriptionFormPage, exports.seedInvoicingSubscriptionFormDraft = _a.seedInvoicingSubscriptionFormDraft, exports.updateInvoicingSubscriptionDetail = _a.updateInvoicingSubscriptionDetail, exports.updateInvoicingSubscriptionDetailFailure = _a.updateInvoicingSubscriptionDetailFailure, exports.updateInvoicingSubscriptionFormDraft = _a.updateInvoicingSubscriptionFormDraft, exports.submitInvoicingSubscriptionForm = _a.submitInvoicingSubscriptionForm, exports.submitInvoicingSubscriptionFormSuccess = _a.submitInvoicingSubscriptionFormSuccess, exports.submitInvoicingSubscriptionFormFailure = _a.submitInvoicingSubscriptionFormFailure, exports.resetEditInvoicingSubscriptionDetailView = _a.resetEditInvoicingSubscriptionDetailView, exports.initializeInvoicingSubscriptionAddress = _a.initializeInvoicingSubscriptionAddress, exports.claimInvoicingSubscriptionShippingAddress = _a.claimInvoicingSubscriptionShippingAddress, exports.syncInvoicingSubscriptionCoupons = _a.syncInvoicingSubscriptionCoupons, exports.fetchInvoicingSubscriptionEstimate = _a.fetchInvoicingSubscriptionEstimate, exports.updateInvoicingSubscriptionEstimate = _a.updateInvoicingSubscriptionEstimate, exports.updateInvoicingSubscriptionEstimateFailure = _a.updateInvoicingSubscriptionEstimateFailure, exports.clearInvoicingSubscriptionEstimate = _a.clearInvoicingSubscriptionEstimate;
|
|
166
200
|
exports.default = editInvoicingSubscriptionDetailView.reducer;
|
|
@@ -5,7 +5,8 @@ import { InvoicingCatalogPricePoint } from '../../../entity/invoicing/invoicingC
|
|
|
5
5
|
import { InvoicingFieldHelpByCode, InvoicingNamedOption, InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
6
6
|
import { InvoicingSubscription } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionState';
|
|
7
7
|
import { RootState } from '../../../rootStateTypes';
|
|
8
|
-
import {
|
|
8
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
9
|
+
import { InvoicingSubscriptionEstimateState, InvoicingSubscriptionFormLocalData, InvoicingSubscriptionInvoiceEstimate } from './editInvoicingSubscriptionDetailViewState';
|
|
9
10
|
/**
|
|
10
11
|
* Bundled view for the subscription create/edit form's save concern: the save
|
|
11
12
|
* fetch state/error, the id of the subscription last saved, and — when an
|
|
@@ -29,6 +30,22 @@ export interface EditInvoicingSubscriptionDetailView extends SelectorView {
|
|
|
29
30
|
* `{label, value}` records, so this stays free of any web-components
|
|
30
31
|
* dependency while leaving the screen nothing to derive.
|
|
31
32
|
*/
|
|
33
|
+
export type InvoicingSubscriptionEstimateKind = 'invoice_now' | 'later_invoice' | 'proration_credit' | 'proration_invoice' | 'reason_only';
|
|
34
|
+
export interface InvoicingSubscriptionEstimateView {
|
|
35
|
+
/** A later invoice quotes today's credit balances, which can change by then. */
|
|
36
|
+
creditsMayChange: boolean;
|
|
37
|
+
fetchState: FetchStateAndError;
|
|
38
|
+
nonRenewing: boolean;
|
|
39
|
+
/** The one invoice to show, whichever estimate it came from. */
|
|
40
|
+
invoice?: InvoicingSubscriptionInvoiceEstimate;
|
|
41
|
+
kind?: InvoicingSubscriptionEstimateKind;
|
|
42
|
+
nextBillingAt?: ZeniDate;
|
|
43
|
+
reason?: string;
|
|
44
|
+
storeCredit?: Amount;
|
|
45
|
+
termEnd?: ZeniDate;
|
|
46
|
+
termStart?: ZeniDate;
|
|
47
|
+
}
|
|
48
|
+
export declare const toInvoicingSubscriptionEstimateView: ({ estimate, fetchState, subscriptionId }: InvoicingSubscriptionEstimateState, invoicingSubscriptionID?: ID) => InvoicingSubscriptionEstimateView;
|
|
32
49
|
export interface InvoicingSubscriptionFormView extends SelectorView {
|
|
33
50
|
/** Lifecycle action in flight, folded in from the record view. */
|
|
34
51
|
actionState: FetchStateAndError;
|
|
@@ -43,6 +60,8 @@ export interface InvoicingSubscriptionFormView extends SelectorView {
|
|
|
43
60
|
charges: InvoicingSubscriptionOption[];
|
|
44
61
|
coupons: InvoicingSubscriptionOption[];
|
|
45
62
|
customers: InvoicingSubscriptionOption[];
|
|
63
|
+
/** The review dialog's cost estimate for saving this draft. */
|
|
64
|
+
estimate: InvoicingSubscriptionEstimateView;
|
|
46
65
|
fieldHelp: InvoicingFieldHelpByCode;
|
|
47
66
|
/**
|
|
48
67
|
* True while the subscription being edited is still on its way to the form.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingSubscriptionFormView = exports.isInvoicingAddonPeriodCompatible = exports.getInvoicingItemsAllowedForPlan = exports.getEditInvoicingSubscriptionDetailViewState = void 0;
|
|
3
|
+
exports.getInvoicingSubscriptionFormView = exports.isInvoicingAddonPeriodCompatible = exports.getInvoicingItemsAllowedForPlan = exports.getEditInvoicingSubscriptionDetailViewState = exports.toInvoicingSubscriptionEstimateView = void 0;
|
|
4
4
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
5
5
|
const addressSelector_1 = require("../../../entity/address/addressSelector");
|
|
6
6
|
const invoicingSubscriptionSelector_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionSelector");
|
|
@@ -12,6 +12,58 @@ const invoicingCustomerListViewSelector_1 = require("../invoicingCustomerListVie
|
|
|
12
12
|
const invoicingFormDraft_1 = require("../invoicingFormDraft");
|
|
13
13
|
const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
|
|
14
14
|
const invoicingSubscriptionFormConfig_2 = require("./invoicingSubscriptionFormConfig");
|
|
15
|
+
const notStartedEstimateView = {
|
|
16
|
+
creditsMayChange: false,
|
|
17
|
+
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
18
|
+
nonRenewing: false,
|
|
19
|
+
};
|
|
20
|
+
const toInvoicingSubscriptionEstimateView = ({ estimate, fetchState, subscriptionId }, invoicingSubscriptionID) => {
|
|
21
|
+
// A slot asked for another subscription is not this form's estimate.
|
|
22
|
+
if (subscriptionId !== invoicingSubscriptionID) {
|
|
23
|
+
return notStartedEstimateView;
|
|
24
|
+
}
|
|
25
|
+
if (estimate == null) {
|
|
26
|
+
return { ...notStartedEstimateView, fetchState };
|
|
27
|
+
}
|
|
28
|
+
const { invoice, nextInvoice, proration, reason, term } = estimate;
|
|
29
|
+
const base = {
|
|
30
|
+
fetchState,
|
|
31
|
+
nonRenewing: term?.becomesNonRenewing === true,
|
|
32
|
+
nextBillingAt: term?.nextBillingAt,
|
|
33
|
+
reason: reason !== '' ? reason : undefined,
|
|
34
|
+
termEnd: term?.currentTermEnd,
|
|
35
|
+
termStart: term?.currentTermStart,
|
|
36
|
+
};
|
|
37
|
+
if (proration?.documentType === 'invoice' && proration.invoice != null) {
|
|
38
|
+
return {
|
|
39
|
+
...base,
|
|
40
|
+
creditsMayChange: false,
|
|
41
|
+
invoice: proration.invoice,
|
|
42
|
+
kind: 'proration_invoice',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (proration?.documentType === 'credit_note') {
|
|
46
|
+
return {
|
|
47
|
+
...base,
|
|
48
|
+
creditsMayChange: false,
|
|
49
|
+
kind: 'proration_credit',
|
|
50
|
+
storeCredit: { ...proration.net, amount: Math.abs(proration.net.amount) },
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (estimate.willBeInvoiced && invoice != null) {
|
|
54
|
+
return { ...base, creditsMayChange: false, invoice, kind: 'invoice_now' };
|
|
55
|
+
}
|
|
56
|
+
if (nextInvoice != null) {
|
|
57
|
+
return {
|
|
58
|
+
...base,
|
|
59
|
+
creditsMayChange: true,
|
|
60
|
+
invoice: nextInvoice,
|
|
61
|
+
kind: 'later_invoice',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return { ...base, creditsMayChange: false, kind: 'reason_only' };
|
|
65
|
+
};
|
|
66
|
+
exports.toInvoicingSubscriptionEstimateView = toInvoicingSubscriptionEstimateView;
|
|
15
67
|
const getEditInvoicingSubscriptionDetailViewState = (state, invoicingSubscriptionID) => {
|
|
16
68
|
const { error, fetchState, savedSubscriptionId } = state.editInvoicingSubscriptionDetailViewState;
|
|
17
69
|
const { subscriptionCommercialEditAllowedFromStatuses, subscriptionLifecycleActionOptions, subscriptionMetadataEditAllowedFromStatuses, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
@@ -176,7 +228,7 @@ const toInvoicingCustomerOption = (customer) => ({
|
|
|
176
228
|
value: customer.id,
|
|
177
229
|
});
|
|
178
230
|
const getInvoicingSubscriptionFormView = (state, invoicingSubscriptionID) => {
|
|
179
|
-
const { editDraftById, error, fetchState, newSubscriptionDraft, savedSubscriptionId, } = state.editInvoicingSubscriptionDetailViewState;
|
|
231
|
+
const { editDraftById, error, estimateState, fetchState, newSubscriptionDraft, savedSubscriptionId, } = state.editInvoicingSubscriptionDetailViewState;
|
|
180
232
|
const mode = invoicingSubscriptionID != null ? 'edit' : 'create';
|
|
181
233
|
const subscription = invoicingSubscriptionID != null
|
|
182
234
|
? (0, invoicingSubscriptionSelector_1.getInvoicingSubscriptionById)(state.invoicingSubscriptionState, invoicingSubscriptionID)
|
|
@@ -230,6 +282,7 @@ const getInvoicingSubscriptionFormView = (state, invoicingSubscriptionID) => {
|
|
|
230
282
|
subscriptionMetadataEditAllowedFromStatuses: configState.subscriptionMetadataEditAllowedFromStatuses,
|
|
231
283
|
recordState,
|
|
232
284
|
isFormLoading: (0, invoicingFormDraft_1.isInvoicingFormDraftPending)(editDraftById, invoicingSubscriptionID),
|
|
285
|
+
estimate: (0, exports.toInvoicingSubscriptionEstimateView)(estimateState, invoicingSubscriptionID),
|
|
233
286
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'subscription'),
|
|
234
287
|
addons: catalogItemOptionsOfType('addon'),
|
|
235
288
|
charges: catalogItemOptionsOfType('charge'),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
2
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
4
|
import { InvoicingFormDraftById } from '../invoicingFormDraft';
|
|
4
5
|
/**
|
|
5
6
|
* Draft form state for the create/edit subscription form. Held in CES so the
|
|
@@ -39,10 +40,67 @@ export interface InvoicingSubscriptionFormLocalData {
|
|
|
39
40
|
/** Unset until the user enters one, so an explicit 0 stays distinguishable. */
|
|
40
41
|
setupFee?: Amount;
|
|
41
42
|
}
|
|
43
|
+
export interface InvoicingSubscriptionEstimateLineItem {
|
|
44
|
+
amount: Amount;
|
|
45
|
+
description: string;
|
|
46
|
+
discountAmount: Amount;
|
|
47
|
+
quantity: number;
|
|
48
|
+
unitAmount: Amount;
|
|
49
|
+
dateFrom?: ZeniDate;
|
|
50
|
+
dateTo?: ZeniDate;
|
|
51
|
+
taxAmount?: Amount;
|
|
52
|
+
}
|
|
53
|
+
/** An invoice the save would raise now, or the next one it would raise later. */
|
|
54
|
+
export interface InvoicingSubscriptionInvoiceEstimate {
|
|
55
|
+
amountDue: Amount;
|
|
56
|
+
couponDiscountTotal: Amount;
|
|
57
|
+
/** Refundable credits plus excess payments; promotional credits are separate. */
|
|
58
|
+
creditsApplied: Amount;
|
|
59
|
+
grossSubTotal: Amount;
|
|
60
|
+
lineItems: InvoicingSubscriptionEstimateLineItem[];
|
|
61
|
+
promotionalCreditsApplied: Amount;
|
|
62
|
+
/** After coupons and promotional credits. */
|
|
63
|
+
subTotal: Amount;
|
|
64
|
+
total: Amount;
|
|
65
|
+
dueDate?: ZeniDate;
|
|
66
|
+
invoiceDate?: ZeniDate;
|
|
67
|
+
/** Absent when the tax quote failed on a later invoice; Save still succeeds. */
|
|
68
|
+
tax?: Amount;
|
|
69
|
+
}
|
|
70
|
+
export interface InvoicingSubscriptionProrationEstimate {
|
|
71
|
+
/** `invoice`, `credit_note`, or `none` when the change nets to zero. */
|
|
72
|
+
documentType: string;
|
|
73
|
+
net: Amount;
|
|
74
|
+
invoice?: InvoicingSubscriptionInvoiceEstimate;
|
|
75
|
+
}
|
|
76
|
+
export interface InvoicingSubscriptionTermEstimate {
|
|
77
|
+
becomesNonRenewing: boolean;
|
|
78
|
+
currentTermEnd?: ZeniDate;
|
|
79
|
+
currentTermStart?: ZeniDate;
|
|
80
|
+
nextBillingAt?: ZeniDate;
|
|
81
|
+
}
|
|
82
|
+
/** What a save would bill, from `POST /subscriptions[/{id}]/estimate`. */
|
|
83
|
+
export interface InvoicingSubscriptionEstimate {
|
|
84
|
+
/** The service's sentence for why nothing is invoiced now; empty otherwise. */
|
|
85
|
+
reason: string;
|
|
86
|
+
willBeInvoiced: boolean;
|
|
87
|
+
invoice?: InvoicingSubscriptionInvoiceEstimate;
|
|
88
|
+
nextInvoice?: InvoicingSubscriptionInvoiceEstimate;
|
|
89
|
+
proration?: InvoicingSubscriptionProrationEstimate;
|
|
90
|
+
term?: InvoicingSubscriptionTermEstimate;
|
|
91
|
+
}
|
|
92
|
+
export interface InvoicingSubscriptionEstimateState {
|
|
93
|
+
fetchState: FetchStateAndError;
|
|
94
|
+
estimate?: InvoicingSubscriptionEstimate;
|
|
95
|
+
/** The subscription the estimate was asked for; absent for a new one. */
|
|
96
|
+
subscriptionId?: ID;
|
|
97
|
+
}
|
|
42
98
|
export interface EditInvoicingSubscriptionDetailViewState extends FetchedState {
|
|
43
99
|
/** Lifecycle action fetch state per subscription id. */
|
|
44
100
|
actionStateById: Record<ID, FetchStateAndError>;
|
|
45
101
|
editDraftById: InvoicingFormDraftById<InvoicingSubscriptionFormLocalData>;
|
|
102
|
+
/** The cost estimate shown before a save; nothing is saved by asking. */
|
|
103
|
+
estimateState: InvoicingSubscriptionEstimateState;
|
|
46
104
|
newSubscriptionDraft: InvoicingSubscriptionFormLocalData;
|
|
47
105
|
/** Detail-load state per subscription id. */
|
|
48
106
|
recordStateById: Record<ID, FetchStateAndError>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../rootStateTypes';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { fetchInvoicingSubscriptionEstimate, updateInvoicingSubscriptionEstimate, updateInvoicingSubscriptionEstimateFailure } from './editInvoicingSubscriptionDetailViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchInvoicingSubscriptionEstimate> | ReturnType<typeof updateInvoicingSubscriptionEstimate> | ReturnType<typeof updateInvoicingSubscriptionEstimateFailure>;
|
|
7
|
+
export declare const fetchInvoicingSubscriptionEstimateEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchInvoicingSubscriptionEstimateEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const couponSelector_1 = require("../../../entity/invoicing/coupon/couponSelector");
|
|
7
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
+
const editInvoicingSubscriptionDetailViewPayload_1 = require("./editInvoicingSubscriptionDetailViewPayload");
|
|
9
|
+
const editInvoicingSubscriptionDetailViewReducer_1 = require("./editInvoicingSubscriptionDetailViewReducer");
|
|
10
|
+
const saveInvoicingSubscriptionEpic_1 = require("./saveInvoicingSubscriptionEpic");
|
|
11
|
+
// Posts Save's exact body; a changed coupon rides along as `coupons` (Save syncs it after the PUT).
|
|
12
|
+
const fetchInvoicingSubscriptionEstimateEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(editInvoicingSubscriptionDetailViewReducer_1.fetchInvoicingSubscriptionEstimate.match), (0, operators_1.switchMap)((action) => {
|
|
13
|
+
const { id } = action.payload;
|
|
14
|
+
const { data, localData, previousCouponCode } = (0, saveInvoicingSubscriptionEpic_1.invoicingSubscriptionSaveRequest)(state$.value, id);
|
|
15
|
+
const couponCode = localData.couponId;
|
|
16
|
+
const coupon = (0, couponSelector_1.getInvoicingCouponByCode)(state$.value.invoicingCouponState, couponCode);
|
|
17
|
+
const body = id != null &&
|
|
18
|
+
(0, saveInvoicingSubscriptionEpic_1.isInvoicingSubscriptionCouponChanged)(previousCouponCode, couponCode)
|
|
19
|
+
? {
|
|
20
|
+
...data,
|
|
21
|
+
coupons: couponCode !== ''
|
|
22
|
+
? [
|
|
23
|
+
{
|
|
24
|
+
applied_count: 0,
|
|
25
|
+
apply_till: null,
|
|
26
|
+
coupon_code: couponCode,
|
|
27
|
+
coupon_id: coupon?.id ?? couponCode,
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
: [],
|
|
31
|
+
}
|
|
32
|
+
: data;
|
|
33
|
+
const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/subscriptions`;
|
|
34
|
+
const url = id != null
|
|
35
|
+
? `${baseUrl}/${encodeURIComponent(id)}/estimate`
|
|
36
|
+
: `${baseUrl}/estimate`;
|
|
37
|
+
return zeniAPI
|
|
38
|
+
.postAndGetJSON(url, body)
|
|
39
|
+
.pipe((0, operators_1.map)((response) => (0, responsePayload_1.isSuccessResponse)(response) && response.data != null
|
|
40
|
+
? (0, editInvoicingSubscriptionDetailViewReducer_1.updateInvoicingSubscriptionEstimate)({
|
|
41
|
+
estimate: (0, editInvoicingSubscriptionDetailViewPayload_1.mapInvoicingSubscriptionEstimatePayloadToState)(response.data),
|
|
42
|
+
id,
|
|
43
|
+
})
|
|
44
|
+
: (0, editInvoicingSubscriptionDetailViewReducer_1.updateInvoicingSubscriptionEstimateFailure)({
|
|
45
|
+
id,
|
|
46
|
+
status: response.status,
|
|
47
|
+
})), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, editInvoicingSubscriptionDetailViewReducer_1.updateInvoicingSubscriptionEstimateFailure)({
|
|
48
|
+
id,
|
|
49
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Subscription estimate REST API call errored out ' +
|
|
50
|
+
JSON.stringify(error)),
|
|
51
|
+
}))));
|
|
52
|
+
}));
|
|
53
|
+
exports.fetchInvoicingSubscriptionEstimateEpic = fetchInvoicingSubscriptionEstimateEpic;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
3
4
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
5
|
import { updateInvoicingSubscriptions } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
5
6
|
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
@@ -10,5 +11,12 @@ import { invalidateInvoicingCustomerDetail } from '../editInvoicingCustomerDetai
|
|
|
10
11
|
import { invalidateInvoiceListForCustomer } from '../invoiceList/invoiceListReducer';
|
|
11
12
|
import { addInvoicingSubscriptionToList } from '../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer';
|
|
12
13
|
import { submitInvoicingSubscriptionForm, submitInvoicingSubscriptionFormFailure, submitInvoicingSubscriptionFormSuccess, syncInvoicingSubscriptionCoupons } from './editInvoicingSubscriptionDetailViewReducer';
|
|
14
|
+
import { InvoicingSubscriptionFormLocalData } from './editInvoicingSubscriptionDetailViewState';
|
|
13
15
|
export type ActionType = ReturnType<typeof submitInvoicingSubscriptionForm> | ReturnType<typeof submitInvoicingSubscriptionFormSuccess> | ReturnType<typeof submitInvoicingSubscriptionFormFailure> | ReturnType<typeof syncInvoicingSubscriptionCoupons> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions> | ReturnType<typeof addInvoicingSubscriptionToList> | ReturnType<typeof invalidateInvoicingCustomerDetail> | ReturnType<typeof invalidateInvoiceListForCustomer> | ReturnType<typeof openSnackbar>;
|
|
16
|
+
export declare const isInvoicingSubscriptionCouponChanged: (previousCouponCode: string, nextCouponCode: string) => boolean;
|
|
17
|
+
export declare const invoicingSubscriptionSaveRequest: (rootState: RootState, id?: ID) => {
|
|
18
|
+
data: Record<string, unknown>;
|
|
19
|
+
localData: InvoicingSubscriptionFormLocalData;
|
|
20
|
+
previousCouponCode: string;
|
|
21
|
+
};
|
|
14
22
|
export declare const saveInvoicingSubscriptionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveInvoicingSubscriptionEpic = void 0;
|
|
3
|
+
exports.saveInvoicingSubscriptionEpic = exports.invoicingSubscriptionSaveRequest = exports.isInvoicingSubscriptionCouponChanged = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
@@ -17,9 +17,11 @@ const editInvoicingSubscriptionDetailViewPayload_1 = require("./editInvoicingSub
|
|
|
17
17
|
const editInvoicingSubscriptionDetailViewReducer_1 = require("./editInvoicingSubscriptionDetailViewReducer");
|
|
18
18
|
const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
|
|
19
19
|
const normalizeCouponCode = (value) => (value ?? '').trim().toUpperCase();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const isInvoicingSubscriptionCouponChanged = (previousCouponCode, nextCouponCode) => normalizeCouponCode(previousCouponCode) !==
|
|
21
|
+
normalizeCouponCode(nextCouponCode);
|
|
22
|
+
exports.isInvoicingSubscriptionCouponChanged = isInvoicingSubscriptionCouponChanged;
|
|
23
|
+
// The draft a save reads and the body it sends; the estimate previews the same body.
|
|
24
|
+
const invoicingSubscriptionSaveRequest = (rootState, id) => {
|
|
23
25
|
const viewState = rootState.editInvoicingSubscriptionDetailViewState;
|
|
24
26
|
const localData = (id != null
|
|
25
27
|
? viewState.editDraftById[id]?.localData
|
|
@@ -28,18 +30,24 @@ const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
28
30
|
// object in the payload (same pattern as the customer save flow).
|
|
29
31
|
const shippingAddress = rootState.addressViewState.newAddressState?.[invoicingSubscriptionFormConfig_1.INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE]?.addressToCreate;
|
|
30
32
|
const data = (0, editInvoicingSubscriptionDetailViewPayload_1.localDataToSaveInvoicingSubscriptionPayload)(localData, shippingAddress);
|
|
31
|
-
// Coupons are synced via apply/remove-coupon after PUT (not via coupon_ids).
|
|
32
33
|
if (id != null) {
|
|
33
34
|
delete data.coupon_ids;
|
|
34
35
|
}
|
|
36
|
+
const savedCoupon = id != null
|
|
37
|
+
? rootState.invoicingSubscriptionState.invoicingSubscriptionByID[id]
|
|
38
|
+
?.coupons?.[0]
|
|
39
|
+
: undefined;
|
|
40
|
+
return {
|
|
41
|
+
data,
|
|
42
|
+
localData,
|
|
43
|
+
previousCouponCode: savedCoupon?.couponCode ?? savedCoupon?.couponID ?? '',
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
exports.invoicingSubscriptionSaveRequest = invoicingSubscriptionSaveRequest;
|
|
47
|
+
const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(editInvoicingSubscriptionDetailViewReducer_1.submitInvoicingSubscriptionForm.match), (0, operators_1.mergeMap)((action) => {
|
|
48
|
+
const { id } = action.payload;
|
|
49
|
+
const { data, localData, previousCouponCode } = (0, exports.invoicingSubscriptionSaveRequest)(state$.value, id);
|
|
35
50
|
const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
|
|
36
|
-
const previousCouponCode = id != null
|
|
37
|
-
? (rootState.invoicingSubscriptionState.invoicingSubscriptionByID[id]
|
|
38
|
-
?.coupons?.[0]?.couponCode ??
|
|
39
|
-
rootState.invoicingSubscriptionState.invoicingSubscriptionByID[id]
|
|
40
|
-
?.coupons?.[0]?.couponID ??
|
|
41
|
-
'')
|
|
42
|
-
: '';
|
|
43
51
|
const request$ = id != null
|
|
44
52
|
? zeniAPI.putAndGetJSON(`${baseUrl}/subscriptions/${encodeURIComponent(id)}`, { ...data })
|
|
45
53
|
: zeniAPI.postAndGetJSON(`${baseUrl}/subscriptions`, { ...data });
|
|
@@ -57,8 +65,7 @@ const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
57
65
|
}
|
|
58
66
|
const saved = response.data;
|
|
59
67
|
const couponChanged = id != null &&
|
|
60
|
-
|
|
61
|
-
normalizeCouponCode(localData.couponId);
|
|
68
|
+
(0, exports.isInvoicingSubscriptionCouponChanged)(previousCouponCode, localData.couponId);
|
|
62
69
|
// Edit + coupon change: merge the saved subscription, then hand the
|
|
63
70
|
// coupon attach/detach to syncInvoicingSubscriptionCouponsEpic, which
|
|
64
71
|
// finishes the flow (form success on both calls ok, form failure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.75",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|