@zeniai/client-epic-state 5.1.82 → 5.1.83
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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +29 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +29 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +24 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +24 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +33 -9
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +35 -9
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +32 -5
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +23 -3
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +24 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +24 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +20 -3
- package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +60 -17
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +30 -0
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +29 -10
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +28 -5
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +24 -4
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +22 -14
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +46 -7
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +26 -8
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +4 -1
- package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +41 -9
- package/lib/index.d.ts +4 -3
- package/lib/index.js +7 -8
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +23 -3
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -1
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +23 -3
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +22 -8
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +2 -1
- package/lib/view/invoicing/discountAction/discountActionEpic.js +32 -8
- package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +2 -1
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +34 -8
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +31 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +22 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +23 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +23 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +19 -2
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +2 -1
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +59 -16
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +13 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +30 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +11 -31
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +2 -1
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +28 -9
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +27 -4
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +23 -3
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +24 -7
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +23 -16
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +2 -1
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +45 -6
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +2 -1
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +25 -7
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +10 -1
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +4 -2
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +4 -1
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +2 -1
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +40 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed";
|
|
1
|
+
export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
|
|
2
2
|
export type SnackbarMessageSections = ReturnType<typeof toSnackbarMessageSection>;
|
|
3
3
|
export declare const toSnackbarMessageSectionTexts: (v: string) => "notification" | "failed" | "success";
|
|
4
4
|
export type SnackbarMessageSectionTexts = ReturnType<typeof toSnackbarMessageSectionTexts>;
|
|
@@ -230,6 +230,35 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
230
230
|
'qbo_connection_already_linked',
|
|
231
231
|
'qbo_connection_failed',
|
|
232
232
|
'accounting_projects_qbo_reconnect_failed',
|
|
233
|
+
'invoicing_dunning_case_resolved',
|
|
234
|
+
'invoicing_dunning_retry',
|
|
235
|
+
'invoicing_dunning_cancel',
|
|
236
|
+
'invoicing_dunning_settings_save',
|
|
237
|
+
'invoicing_qbo_backfill',
|
|
238
|
+
'invoicing_qbo_sync_health_retry',
|
|
239
|
+
'invoicing_qbo_settings_save',
|
|
240
|
+
'invoicing_branding_save',
|
|
241
|
+
'invoicing_discount_archive',
|
|
242
|
+
'invoicing_discount_unarchive',
|
|
243
|
+
'invoicing_discount_delete',
|
|
244
|
+
'invoicing_invoice_reminder_sent',
|
|
245
|
+
'invoicing_invoice_regenerated',
|
|
246
|
+
'invoicing_invoice_voided',
|
|
247
|
+
'invoicing_catalog_item_saved',
|
|
248
|
+
'invoicing_customer_saved',
|
|
249
|
+
'invoicing_subscription_saved',
|
|
250
|
+
'invoicing_coupon_saved',
|
|
251
|
+
'invoicing_invoice_saved',
|
|
252
|
+
'invoicing_credit_note_saved',
|
|
253
|
+
'invoicing_payment_recorded',
|
|
254
|
+
'invoicing_subscription_activated',
|
|
255
|
+
'invoicing_subscription_cancellation_removed',
|
|
256
|
+
'invoicing_subscription_cancelled',
|
|
257
|
+
'invoicing_subscription_non_renewing',
|
|
258
|
+
'invoicing_subscription_paused',
|
|
259
|
+
'invoicing_subscription_reactivated',
|
|
260
|
+
'invoicing_subscription_resumed',
|
|
261
|
+
'invoicing_subscription_term_end_changed',
|
|
233
262
|
];
|
|
234
263
|
const toSnackbarMessageSection = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_SNACKBAR_MESSAGE_SECTIONS);
|
|
235
264
|
exports.toSnackbarMessageSection = toSnackbarMessageSection;
|
|
@@ -227,6 +227,35 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
227
227
|
'qbo_connection_already_linked',
|
|
228
228
|
'qbo_connection_failed',
|
|
229
229
|
'accounting_projects_qbo_reconnect_failed',
|
|
230
|
+
'invoicing_dunning_case_resolved',
|
|
231
|
+
'invoicing_dunning_retry',
|
|
232
|
+
'invoicing_dunning_cancel',
|
|
233
|
+
'invoicing_dunning_settings_save',
|
|
234
|
+
'invoicing_qbo_backfill',
|
|
235
|
+
'invoicing_qbo_sync_health_retry',
|
|
236
|
+
'invoicing_qbo_settings_save',
|
|
237
|
+
'invoicing_branding_save',
|
|
238
|
+
'invoicing_discount_archive',
|
|
239
|
+
'invoicing_discount_unarchive',
|
|
240
|
+
'invoicing_discount_delete',
|
|
241
|
+
'invoicing_invoice_reminder_sent',
|
|
242
|
+
'invoicing_invoice_regenerated',
|
|
243
|
+
'invoicing_invoice_voided',
|
|
244
|
+
'invoicing_catalog_item_saved',
|
|
245
|
+
'invoicing_customer_saved',
|
|
246
|
+
'invoicing_subscription_saved',
|
|
247
|
+
'invoicing_coupon_saved',
|
|
248
|
+
'invoicing_invoice_saved',
|
|
249
|
+
'invoicing_credit_note_saved',
|
|
250
|
+
'invoicing_payment_recorded',
|
|
251
|
+
'invoicing_subscription_activated',
|
|
252
|
+
'invoicing_subscription_cancellation_removed',
|
|
253
|
+
'invoicing_subscription_cancelled',
|
|
254
|
+
'invoicing_subscription_non_renewing',
|
|
255
|
+
'invoicing_subscription_paused',
|
|
256
|
+
'invoicing_subscription_reactivated',
|
|
257
|
+
'invoicing_subscription_resumed',
|
|
258
|
+
'invoicing_subscription_term_end_changed',
|
|
230
259
|
];
|
|
231
260
|
export const toSnackbarMessageSection = (v) => stringToUnion(v, ALL_SNACKBAR_MESSAGE_SECTIONS);
|
|
232
261
|
// Keeping this different from the message type, since we may not have messages in all instances
|
package/lib/esm/index.js
CHANGED
|
@@ -734,7 +734,7 @@ export { resetRecordPayment, initializeRecordPaymentDraft, submitRecordPayment,
|
|
|
734
734
|
export { initializeIssueCreditNoteDraft, issueCreditNoteFailure, issueCreditNoteSuccess, resetIssueCreditNote, submitIssueCreditNote, updateIssueCreditNoteFormDraft, } from './view/invoicing/issueCreditNote/issueCreditNoteReducer';
|
|
735
735
|
export { computeIssueCreditNoteTotal, initializeIssueCreditNoteDraftFromInvoice, localDataToIssueCreditNotePayload, } from './view/invoicing/issueCreditNote/issueCreditNotePayload';
|
|
736
736
|
export { INVOICING_CREDIT_NOTE_REASON_CODES, initialIssueCreditNoteFormLocalData, } from './view/invoicing/issueCreditNote/issueCreditNoteFormConfig';
|
|
737
|
-
export {
|
|
737
|
+
export { getIssueCreditNoteView } from './view/invoicing/issueCreditNote/issueCreditNoteSelector';
|
|
738
738
|
export { createCreditNoteFailure, createCreditNoteSuccess, resetCreateCreditNote, submitCreateCreditNote, updateCreateCreditNoteFormDraft, } from './view/invoicing/createCreditNote/createCreditNoteReducer';
|
|
739
739
|
export { localDataToCreateCreditNotePayload } from './view/invoicing/createCreditNote/createCreditNotePayload';
|
|
740
740
|
export { initialCreateCreditNoteFormLocalData } from './view/invoicing/createCreditNote/createCreditNoteFormConfig';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCreditNotes } from '../../../entity/invoicing/creditNote/creditNoteReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
6
|
import { localDataToCreateCreditNotePayload, } from './createCreditNotePayload';
|
|
6
7
|
import { createCreditNoteFailure, createCreditNoteSuccess, submitCreateCreditNote, } from './createCreditNoteReducer';
|
|
@@ -15,9 +16,28 @@ export const createCreditNoteEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
15
16
|
return [
|
|
16
17
|
updateInvoicingCreditNotes([response.data], 'merge'),
|
|
17
18
|
createCreditNoteSuccess({ creditNoteId: response.data.id }),
|
|
19
|
+
openSnackbar({
|
|
20
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
21
|
+
messageText: 'success',
|
|
22
|
+
type: 'success',
|
|
23
|
+
}),
|
|
18
24
|
];
|
|
19
25
|
}
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
return from([
|
|
27
|
+
createCreditNoteFailure(response.status),
|
|
28
|
+
openSnackbar({
|
|
29
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
30
|
+
messageText: 'failed',
|
|
31
|
+
type: 'error',
|
|
32
|
+
}),
|
|
33
|
+
]);
|
|
34
|
+
}), catchError((error) => from([
|
|
35
|
+
createCreditNoteFailure(createZeniAPIStatus('Unexpected Error', 'Create credit note REST API call errored out ' +
|
|
36
|
+
JSON.stringify(error))),
|
|
37
|
+
openSnackbar({
|
|
38
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
39
|
+
messageText: 'failed',
|
|
40
|
+
type: 'error',
|
|
41
|
+
}),
|
|
42
|
+
])));
|
|
23
43
|
}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { extractInvoicingInvoiceAddresses } from '../../../entity/invoicing/invoice/invoicePayload';
|
|
5
5
|
import { updateInvoices } from '../../../entity/invoicing/invoice/invoiceReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
7
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
8
|
import { addInvoiceToList } from '../invoiceList/invoiceListReducer';
|
|
8
9
|
import { createInvoice, createInvoiceFailure, createInvoiceSuccess, } from './createInvoiceReducer';
|
|
@@ -22,9 +23,28 @@ export const createInvoiceEpic = (actions$, _state$, zeniAPI) => actions$.pipe(f
|
|
|
22
23
|
status: response.data.status,
|
|
23
24
|
}),
|
|
24
25
|
createInvoiceSuccess({ invoiceId: response.data.id }),
|
|
26
|
+
openSnackbar({
|
|
27
|
+
messageSection: 'invoicing_invoice_saved',
|
|
28
|
+
messageText: 'success',
|
|
29
|
+
type: 'success',
|
|
30
|
+
}),
|
|
25
31
|
];
|
|
26
32
|
}
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
return from([
|
|
34
|
+
createInvoiceFailure(response.status),
|
|
35
|
+
openSnackbar({
|
|
36
|
+
messageSection: 'invoicing_invoice_saved',
|
|
37
|
+
messageText: 'failed',
|
|
38
|
+
type: 'error',
|
|
39
|
+
}),
|
|
40
|
+
]);
|
|
41
|
+
}), catchError((error) => from([
|
|
42
|
+
createInvoiceFailure(createZeniAPIStatus('Unexpected Error', 'Create invoice REST API call errored out ' +
|
|
43
|
+
JSON.stringify(error))),
|
|
44
|
+
openSnackbar({
|
|
45
|
+
messageSection: 'invoicing_invoice_saved',
|
|
46
|
+
messageText: 'failed',
|
|
47
|
+
type: 'error',
|
|
48
|
+
}),
|
|
49
|
+
])));
|
|
30
50
|
}));
|
|
@@ -1,25 +1,52 @@
|
|
|
1
|
+
import { getAddressByAddressId } from '../../../entity/address/addressSelector';
|
|
1
2
|
import { getInvoicingCatalogListView, getInvoicingCatalogPrices, } from '../invoicingCatalogListView/invoicingCatalogListViewSelector';
|
|
2
3
|
import { getInvoicingCustomerListView } from '../invoicingCustomerListView/invoicingCustomerListViewSelector';
|
|
3
4
|
import { getInvoicingSettings } from '../settingsView/settingsViewSelector';
|
|
5
|
+
/**
|
|
6
|
+
* Display name for a customer option: company, else the full name, else the
|
|
7
|
+
* email, else the raw id.
|
|
8
|
+
*/
|
|
9
|
+
const customerDisplayName = (customer) => {
|
|
10
|
+
const fullName = [customer.firstName, customer.lastName]
|
|
11
|
+
.filter((part) => part != null && part.trim() !== '')
|
|
12
|
+
.join(' ')
|
|
13
|
+
.trim();
|
|
14
|
+
const company = customer.company?.trim() ?? '';
|
|
15
|
+
const email = customer.email?.trim() ?? '';
|
|
16
|
+
return company !== ''
|
|
17
|
+
? company
|
|
18
|
+
: fullName !== ''
|
|
19
|
+
? fullName
|
|
20
|
+
: email !== ''
|
|
21
|
+
? email
|
|
22
|
+
: customer.id;
|
|
23
|
+
};
|
|
4
24
|
/**
|
|
5
25
|
* Single bundled view for the create-invoice screen — web-ui consumes only this.
|
|
6
26
|
* Carries the form draft (`localData`), the option sources the form needs
|
|
7
|
-
* (
|
|
8
|
-
* state/error, and the id of the invoice last created
|
|
9
|
-
* navigate on success).
|
|
10
|
-
* option shapes.
|
|
27
|
+
* (customer picker rows, catalog plan names, products, settings), the
|
|
28
|
+
* create-invoice fetch state/error, and the id of the invoice last created
|
|
29
|
+
* (`savedInvoiceId`, to navigate on success).
|
|
11
30
|
*/
|
|
12
31
|
export const getCreateInvoiceFormView = (state) => {
|
|
13
32
|
const createInvoiceState = state.invoicingCreateInvoiceState;
|
|
14
33
|
const catalogListView = getInvoicingCatalogListView(state);
|
|
15
|
-
const plans = getInvoicingCatalogPrices(catalogListView.plans);
|
|
16
34
|
return {
|
|
17
|
-
customers: getInvoicingCustomerListView(state).customers
|
|
35
|
+
customers: getInvoicingCustomerListView(state).customers.map((customer) => ({
|
|
36
|
+
billingAddress: customer.billingAddressId != null
|
|
37
|
+
? getAddressByAddressId(state.addressState, customer.billingAddressId)
|
|
38
|
+
: undefined,
|
|
39
|
+
email: customer.email,
|
|
40
|
+
id: customer.id,
|
|
41
|
+
name: customerDisplayName(customer),
|
|
42
|
+
})),
|
|
18
43
|
localData: createInvoiceState.formDraft,
|
|
19
|
-
planNames: plans
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
|
|
44
|
+
planNames: catalogListView.plans.flatMap((plan) => (plan.subFamilies ?? [])
|
|
45
|
+
.filter((subFamily) => (subFamily.name ?? '') !== '')
|
|
46
|
+
.map((subFamily) => ({
|
|
47
|
+
planName: plan.name ?? '',
|
|
48
|
+
subFamilyName: subFamily.name ?? '',
|
|
49
|
+
}))),
|
|
23
50
|
products: getInvoicingCatalogPrices(catalogListView.products),
|
|
24
51
|
savedInvoiceId: createInvoiceState.createdInvoiceId,
|
|
25
52
|
settings: getInvoicingSettings(state),
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
6
|
import { runInvoicingDiscountAction, runInvoicingDiscountActionFailure, runInvoicingDiscountActionSuccess, } from './discountActionReducer';
|
|
7
|
+
/** Snackbar copy per action kind; unlisted kinds run without one. */
|
|
8
|
+
const SNACKBAR_SECTION_BY_KIND = {
|
|
9
|
+
archive: 'invoicing_discount_archive',
|
|
10
|
+
delete: 'invoicing_discount_delete',
|
|
11
|
+
unarchive: 'invoicing_discount_unarchive',
|
|
12
|
+
};
|
|
6
13
|
export const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingDiscountAction.match), mergeMap((action) => {
|
|
7
14
|
const { action: kind, id } = action.payload;
|
|
8
15
|
const requestBody = { action: kind };
|
|
16
|
+
const snackbarSection = SNACKBAR_SECTION_BY_KIND[kind];
|
|
17
|
+
const snackbar = (messageText) => snackbarSection == null
|
|
18
|
+
? []
|
|
19
|
+
: [
|
|
20
|
+
openSnackbar({
|
|
21
|
+
messageSection: snackbarSection,
|
|
22
|
+
messageText,
|
|
23
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
24
|
+
}),
|
|
25
|
+
];
|
|
9
26
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/discounts/${encodeURIComponent(id)}/actions`;
|
|
10
27
|
return zeniAPI
|
|
11
28
|
.postAndGetJSON(apiUrl, requestBody)
|
|
@@ -14,15 +31,22 @@ export const runInvoicingDiscountActionEpic = (actions$, _state$, zeniAPI) => ac
|
|
|
14
31
|
return [
|
|
15
32
|
updateInvoicingCoupons([response.data], 'merge'),
|
|
16
33
|
runInvoicingDiscountActionSuccess({ id }),
|
|
34
|
+
...snackbar('success'),
|
|
17
35
|
];
|
|
18
36
|
}
|
|
19
|
-
return
|
|
20
|
-
|
|
37
|
+
return from([
|
|
38
|
+
runInvoicingDiscountActionFailure({
|
|
39
|
+
error: response.status,
|
|
40
|
+
id,
|
|
41
|
+
}),
|
|
42
|
+
...snackbar('failed'),
|
|
43
|
+
]);
|
|
44
|
+
}), catchError((error) => from([
|
|
45
|
+
runInvoicingDiscountActionFailure({
|
|
46
|
+
error: createZeniAPIStatus('Unexpected Error', 'Discount action REST API call errored out ' +
|
|
47
|
+
JSON.stringify(error)),
|
|
21
48
|
id,
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
JSON.stringify(error)),
|
|
26
|
-
id,
|
|
27
|
-
}))));
|
|
49
|
+
}),
|
|
50
|
+
...snackbar('failed'),
|
|
51
|
+
])));
|
|
28
52
|
}));
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingDunningCases } from '../../../entity/invoicing/dunningCase/dunningCaseReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
6
|
import { runInvoicingDunningAction, runInvoicingDunningActionFailure, runInvoicingDunningActionSuccess, } from './dunningActionReducer';
|
|
7
|
+
/**
|
|
8
|
+
* Snackbar copy is per action kind; anything not listed here runs without one.
|
|
9
|
+
*/
|
|
10
|
+
const SNACKBAR_SECTION_BY_KIND = {
|
|
11
|
+
cancel: 'invoicing_dunning_cancel',
|
|
12
|
+
resolve: 'invoicing_dunning_case_resolved',
|
|
13
|
+
retry: 'invoicing_dunning_retry',
|
|
14
|
+
};
|
|
6
15
|
export const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingDunningAction.match), mergeMap((action) => {
|
|
7
16
|
const { action: kind, body, id } = action.payload;
|
|
17
|
+
const snackbarSection = SNACKBAR_SECTION_BY_KIND[kind];
|
|
18
|
+
const snackbar = (messageText) => snackbarSection == null
|
|
19
|
+
? []
|
|
20
|
+
: [
|
|
21
|
+
openSnackbar({
|
|
22
|
+
messageSection: snackbarSection,
|
|
23
|
+
messageText,
|
|
24
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
25
|
+
}),
|
|
26
|
+
];
|
|
8
27
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/dunning/${encodeURIComponent(id)}/${kind}`;
|
|
9
28
|
return zeniAPI
|
|
10
29
|
.postAndGetJSON(apiUrl, (body ?? {}))
|
|
@@ -13,15 +32,22 @@ export const runInvoicingDunningActionEpic = (actions$, _state$, zeniAPI) => act
|
|
|
13
32
|
return [
|
|
14
33
|
updateInvoicingDunningCases([response.data], 'merge'),
|
|
15
34
|
runInvoicingDunningActionSuccess({ id }),
|
|
35
|
+
...snackbar('success'),
|
|
16
36
|
];
|
|
17
37
|
}
|
|
18
|
-
return
|
|
19
|
-
|
|
38
|
+
return from([
|
|
39
|
+
runInvoicingDunningActionFailure({
|
|
40
|
+
error: response.status,
|
|
41
|
+
id,
|
|
42
|
+
}),
|
|
43
|
+
...snackbar('failed'),
|
|
44
|
+
]);
|
|
45
|
+
}), catchError((error) => from([
|
|
46
|
+
runInvoicingDunningActionFailure({
|
|
47
|
+
error: createZeniAPIStatus('Unexpected Error', 'Dunning action REST API call errored out ' +
|
|
48
|
+
JSON.stringify(error)),
|
|
20
49
|
id,
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
JSON.stringify(error)),
|
|
25
|
-
id,
|
|
26
|
-
}))));
|
|
50
|
+
}),
|
|
51
|
+
...snackbar('failed'),
|
|
52
|
+
])));
|
|
27
53
|
}));
|
package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js
CHANGED
|
@@ -116,17 +116,21 @@ export const catalogDetailEditValuesToSavePayload = (values, itemType = 'plan',
|
|
|
116
116
|
export const createSubFamilyFormToPayload = (itemId, itemType, values) => {
|
|
117
117
|
const name = values.name.trim();
|
|
118
118
|
const priceCode = trimOrUndefined(values.priceCode) ?? toProductCode(name);
|
|
119
|
+
const tiered = isTieredCatalogPricingModel(values.pricingModel);
|
|
119
120
|
const payload = {
|
|
120
121
|
currency_code: 'USD',
|
|
121
122
|
free_quantity: Number(values.freeQuantity) || 0,
|
|
122
123
|
is_taxable: true,
|
|
123
124
|
item_id: itemId,
|
|
124
125
|
name,
|
|
125
|
-
price: values.priceDollars?.amount ?? 0,
|
|
126
|
+
price: tiered ? 0 : (values.priceDollars?.amount ?? 0),
|
|
126
127
|
price_code: priceCode,
|
|
127
128
|
pricing_model: values.pricingModel || 'flat_fee',
|
|
128
129
|
show_description_in_invoices: true,
|
|
129
130
|
};
|
|
131
|
+
if (tiered) {
|
|
132
|
+
payload.tiers = (values.tiers ?? []).map(tierToPayload);
|
|
133
|
+
}
|
|
130
134
|
const description = trimOrUndefined(values.description);
|
|
131
135
|
if (description != null) {
|
|
132
136
|
payload.description = description;
|
package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { forkJoin,
|
|
1
|
+
import { forkJoin, from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { mergeInvoicingPlanSubFamily, updateInvoicingPlans, } from '../../../entity/invoicing/plan/planReducer';
|
|
4
4
|
import { updateInvoicingProducts } from '../../../entity/invoicing/product/productReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
6
7
|
import { addInvoicingCatalogItem } from '../invoicingCatalogListView/invoicingCatalogListViewReducer';
|
|
7
8
|
import { localDataToSaveInvoicingCatalogItemPayload, } from './editInvoicingCatalogItemDetailViewPayload';
|
|
@@ -38,7 +39,14 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
38
39
|
const failedProductResponse = productResponses.find((productResponse) => !isSuccessResponse(productResponse) ||
|
|
39
40
|
productResponse.data == null);
|
|
40
41
|
if (failedProductResponse != null) {
|
|
41
|
-
return
|
|
42
|
+
return from([
|
|
43
|
+
submitInvoicingCatalogItemFormFailure(failedProductResponse.status),
|
|
44
|
+
openSnackbar({
|
|
45
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
46
|
+
messageText: 'failed',
|
|
47
|
+
type: 'error',
|
|
48
|
+
}),
|
|
49
|
+
]);
|
|
42
50
|
}
|
|
43
51
|
const savedProducts = productResponses.flatMap((productResponse) => productResponse.data != null ? [productResponse.data] : []);
|
|
44
52
|
const resultActions = [
|
|
@@ -65,6 +73,11 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
65
73
|
: 'plan';
|
|
66
74
|
resultActions.push(addInvoicingCatalogItem({ id: savedItem.id, type: itemType }));
|
|
67
75
|
}
|
|
76
|
+
resultActions.push(openSnackbar({
|
|
77
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
78
|
+
messageText: 'success',
|
|
79
|
+
type: 'success',
|
|
80
|
+
}));
|
|
68
81
|
return resultActions;
|
|
69
82
|
};
|
|
70
83
|
const productUpdates = saveInvoicingCatalogItem.match(action)
|
|
@@ -75,7 +88,21 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
|
|
|
75
88
|
}
|
|
76
89
|
return forkJoin(productUpdates.map((productUpdate) => zeniAPI.putAndGetJSON(`${baseUrl}/catalog/products/${encodeURIComponent(productUpdate.id)}`, productUpdate.data))).pipe(mergeMap(completeSave));
|
|
77
90
|
}
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
return from([
|
|
92
|
+
submitInvoicingCatalogItemFormFailure(response.status),
|
|
93
|
+
openSnackbar({
|
|
94
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
95
|
+
messageText: 'failed',
|
|
96
|
+
type: 'error',
|
|
97
|
+
}),
|
|
98
|
+
]);
|
|
99
|
+
}), catchError((error) => from([
|
|
100
|
+
submitInvoicingCatalogItemFormFailure(createZeniAPIStatus('Unexpected Error', 'Save catalog item REST API call errored out ' +
|
|
101
|
+
JSON.stringify(error))),
|
|
102
|
+
openSnackbar({
|
|
103
|
+
messageSection: 'invoicing_catalog_item_saved',
|
|
104
|
+
messageText: 'failed',
|
|
105
|
+
type: 'error',
|
|
106
|
+
}),
|
|
107
|
+
])));
|
|
81
108
|
}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
6
|
import { addInvoicingCouponToList } from '../couponView/couponViewReducer';
|
|
6
7
|
import { localDataToSaveInvoicingCouponPayload, } from './editInvoicingCouponDetailViewPayload';
|
|
@@ -43,8 +44,27 @@ export const saveInvoicingCouponEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
43
44
|
status: couponPayload.status,
|
|
44
45
|
}));
|
|
45
46
|
}
|
|
47
|
+
resultActions.push(openSnackbar({
|
|
48
|
+
messageSection: 'invoicing_coupon_saved',
|
|
49
|
+
messageText: 'success',
|
|
50
|
+
type: 'success',
|
|
51
|
+
}));
|
|
46
52
|
return resultActions;
|
|
47
53
|
}
|
|
48
|
-
return
|
|
49
|
-
|
|
54
|
+
return from([
|
|
55
|
+
submitInvoicingCouponFormFailure(response.status),
|
|
56
|
+
openSnackbar({
|
|
57
|
+
messageSection: 'invoicing_coupon_saved',
|
|
58
|
+
messageText: 'failed',
|
|
59
|
+
type: 'error',
|
|
60
|
+
}),
|
|
61
|
+
]);
|
|
62
|
+
}), catchError((error) => from([
|
|
63
|
+
submitInvoicingCouponFormFailure(createZeniAPIStatus('Unexpected Error', 'Save coupon REST API call errored out ' + JSON.stringify(error))),
|
|
64
|
+
openSnackbar({
|
|
65
|
+
messageSection: 'invoicing_coupon_saved',
|
|
66
|
+
messageText: 'failed',
|
|
67
|
+
type: 'error',
|
|
68
|
+
}),
|
|
69
|
+
])));
|
|
50
70
|
}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { extractInvoicingCustomerAddresses } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerPayload';
|
|
5
5
|
import { updateInvoicingCustomers } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
7
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { addInvoicingCustomerToList } from '../invoicingCustomerListView/invoicingCustomerListViewReducer';
|
|
@@ -45,9 +46,28 @@ export const saveInvoicingCustomerEpic = (actions$, state$, zeniAPI) => actions$
|
|
|
45
46
|
status: response.data.status,
|
|
46
47
|
}));
|
|
47
48
|
}
|
|
49
|
+
resultActions.push(openSnackbar({
|
|
50
|
+
messageSection: 'invoicing_customer_saved',
|
|
51
|
+
messageText: 'success',
|
|
52
|
+
type: 'success',
|
|
53
|
+
}));
|
|
48
54
|
return resultActions;
|
|
49
55
|
}
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
return from([
|
|
57
|
+
submitInvoicingCustomerFormFailure(response.status),
|
|
58
|
+
openSnackbar({
|
|
59
|
+
messageSection: 'invoicing_customer_saved',
|
|
60
|
+
messageText: 'failed',
|
|
61
|
+
type: 'error',
|
|
62
|
+
}),
|
|
63
|
+
]);
|
|
64
|
+
}), catchError((error) => from([
|
|
65
|
+
submitInvoicingCustomerFormFailure(createZeniAPIStatus('Unexpected Error', 'Save customer REST API call errored out ' +
|
|
66
|
+
JSON.stringify(error))),
|
|
67
|
+
openSnackbar({
|
|
68
|
+
messageSection: 'invoicing_customer_saved',
|
|
69
|
+
messageText: 'failed',
|
|
70
|
+
type: 'error',
|
|
71
|
+
}),
|
|
72
|
+
])));
|
|
53
73
|
}));
|
package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { extractInvoicingSubscriptionAddresses } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload';
|
|
5
5
|
import { updateInvoicingSubscriptions } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
7
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
7
8
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
8
9
|
import { addInvoicingSubscriptionToList } from '../invoicingSubscriptionListView/invoicingSubscriptionListViewReducer';
|
|
@@ -38,7 +39,14 @@ export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => acti
|
|
|
38
39
|
: zeniAPI.postAndGetJSON(`${baseUrl}/subscriptions`, { ...data });
|
|
39
40
|
return request$.pipe(mergeMap((response) => {
|
|
40
41
|
if (!isSuccessResponse(response) || response.data == null) {
|
|
41
|
-
return [
|
|
42
|
+
return [
|
|
43
|
+
submitInvoicingSubscriptionFormFailure(response.status),
|
|
44
|
+
openSnackbar({
|
|
45
|
+
messageSection: 'invoicing_subscription_saved',
|
|
46
|
+
messageText: 'failed',
|
|
47
|
+
type: 'error',
|
|
48
|
+
}),
|
|
49
|
+
];
|
|
42
50
|
}
|
|
43
51
|
const saved = response.data;
|
|
44
52
|
const couponChanged = id != null &&
|
|
@@ -78,7 +86,19 @@ export const saveInvoicingSubscriptionEpic = (actions$, state$, zeniAPI) => acti
|
|
|
78
86
|
status: saved.status,
|
|
79
87
|
}));
|
|
80
88
|
}
|
|
89
|
+
resultActions.push(openSnackbar({
|
|
90
|
+
messageSection: 'invoicing_subscription_saved',
|
|
91
|
+
messageText: 'success',
|
|
92
|
+
type: 'success',
|
|
93
|
+
}));
|
|
81
94
|
return resultActions;
|
|
82
|
-
}), catchError((error) =>
|
|
83
|
-
|
|
95
|
+
}), catchError((error) => from([
|
|
96
|
+
submitInvoicingSubscriptionFormFailure(createZeniAPIStatus('Unexpected Error', 'Save subscription REST API call errored out ' +
|
|
97
|
+
JSON.stringify(error))),
|
|
98
|
+
openSnackbar({
|
|
99
|
+
messageSection: 'invoicing_subscription_saved',
|
|
100
|
+
messageText: 'failed',
|
|
101
|
+
type: 'error',
|
|
102
|
+
}),
|
|
103
|
+
])));
|
|
84
104
|
}));
|