@zeniai/client-epic-state 5.1.84-beta3ND → 5.1.84

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.
Files changed (61) hide show
  1. package/lib/entity/company/companyPayload.d.ts +0 -1
  2. package/lib/entity/company/companyPayload.js +0 -1
  3. package/lib/entity/company/companyStateTypes.d.ts +0 -1
  4. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
  5. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +6 -2
  6. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  7. package/lib/entity/snackbar/snackbarTypes.js +0 -2
  8. package/lib/entity/tenant/clearAllEpic.d.ts +15 -2
  9. package/lib/entity/tenant/clearAllEpic.js +27 -0
  10. package/lib/entity/tenant/tenantReducer.d.ts +1 -5
  11. package/lib/entity/tenant/tenantReducer.js +2 -19
  12. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  13. package/lib/entity/vendor/vendorType.d.ts +1 -1
  14. package/lib/epic.d.ts +1 -3
  15. package/lib/epic.js +1 -3
  16. package/lib/esm/entity/company/companyPayload.js +0 -1
  17. package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +4 -1
  18. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
  19. package/lib/esm/entity/tenant/clearAllEpic.js +27 -0
  20. package/lib/esm/entity/tenant/tenantReducer.js +1 -18
  21. package/lib/esm/epic.js +1 -3
  22. package/lib/esm/index.js +2 -3
  23. package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +4 -1
  24. package/lib/esm/view/companyView/companyViewReducer.js +1 -55
  25. package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +0 -8
  26. package/lib/esm/view/companyView/types/cockpitTypes.js +0 -2
  27. package/lib/esm/view/companyView/types/companyManagementViewState.js +0 -7
  28. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
  29. package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +4 -1
  30. package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +4 -1
  31. package/lib/index.d.ts +3 -3
  32. package/lib/index.js +33 -37
  33. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
  34. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +5 -2
  35. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  36. package/lib/view/companyView/companyViewReducer.d.ts +1 -19
  37. package/lib/view/companyView/companyViewReducer.js +3 -57
  38. package/lib/view/companyView/selector/companyManagementViewSelector.js +0 -8
  39. package/lib/view/companyView/types/cockpitTypes.d.ts +4 -4
  40. package/lib/view/companyView/types/cockpitTypes.js +0 -2
  41. package/lib/view/companyView/types/companyManagementViewState.d.ts +0 -2
  42. package/lib/view/companyView/types/companyManagementViewState.js +0 -8
  43. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +0 -1
  44. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
  45. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  46. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  47. package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +1 -1
  48. package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.d.ts +1 -1
  49. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  50. package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
  51. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
  52. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +5 -2
  53. package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
  54. package/lib/view/vendorTabView/vendorTabViewReducer.js +5 -2
  55. package/package.json +1 -1
  56. package/lib/esm/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.js +0 -81
  57. package/lib/esm/view/companyView/epic/updateCompanyQboRealmIdEpic.js +0 -62
  58. package/lib/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.d.ts +0 -10
  59. package/lib/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.js +0 -85
  60. package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.d.ts +0 -8
  61. package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.js +0 -66
@@ -4,10 +4,10 @@ import { SubscriptionViewSortKey } from '../../subscriptionView/types/subscripti
4
4
  import { FilterCategoryValueType } from '../helpers/cockpitHelpers';
5
5
  import { CockpitDownloadTabsID, CockpitTabsFileType } from './cockpitTabsID';
6
6
  export declare const toPortfolioSortKeyType: (v: string) => "companyName" | "expenses" | "runway" | "cashBalance" | "revenues" | "netIncome";
7
- export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "companyName" | "group" | "controller" | "plans" | "monthlyRecurringRevenue" | "notes" | "taxStatus" | "preparer" | "reviewer" | "annualRecurringRevenue" | "realmId" | "task" | "productVerticals" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
8
- export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "businessVerified" | "identityVerified" | "bankAccountLinked" | "customerCreated" | "groupCreated" | "qboLinked" | "enroller" | "invite" | "latestCreated";
9
- export declare const toHealthSortKeyType: (v: string) => "companyName" | "group" | "controller" | "monthlyRecurringRevenue" | "runway" | "companyEngagementMetricsUpdatedAt" | "customerSatisfactionScore" | "externalProductServiceExposure" | "netPromoterScore" | "productVerticals" | "customerSuccessManager" | "issues" | "churnProbability" | "lastReportSent" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
10
- export declare const toTaskManagerSortKeyType: (v: string) => "status" | "name" | "priority" | "tags" | "createdBy" | "dueDate" | "assignee" | "taskName";
7
+ export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "companyName" | "group" | "taxStatus" | "controller" | "preparer" | "reviewer" | "annualRecurringRevenue" | "monthlyRecurringRevenue" | "notes" | "task" | "plans" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
8
+ export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "businessVerified" | "identityVerified" | "bankAccountLinked" | "customerCreated" | "groupCreated" | "qboLinked" | "notes" | "enroller" | "invite" | "latestCreated";
9
+ export declare const toHealthSortKeyType: (v: string) => "companyName" | "group" | "controller" | "runway" | "monthlyRecurringRevenue" | "companyEngagementMetricsUpdatedAt" | "customerSatisfactionScore" | "externalProductServiceExposure" | "netPromoterScore" | "customerSuccessManager" | "lastReportSent" | "issues" | "productVerticals" | "churnProbability" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
10
+ export declare const toTaskManagerSortKeyType: (v: string) => "status" | "name" | "priority" | "tags" | "createdBy" | "dueDate" | "taskName" | "assignee";
11
11
  export type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
12
12
  export type ManagementViewSortKey = ReturnType<typeof toManagementSortKeyType>;
13
13
  export type OnboardingViewSortKey = ReturnType<typeof toOnboardingSortKeyType>;
@@ -16,8 +16,6 @@ const ALL_MANAGEMENT_SORT_KEYS = [
16
16
  'status',
17
17
  'group',
18
18
  'plans',
19
- 'productVerticals',
20
- 'realmId',
21
19
  'controller',
22
20
  'customerSuccessManager',
23
21
  'reviewer',
@@ -4,7 +4,6 @@ import { CompanyManagementInfo } from '../../../entity/company/companyStateTypes
4
4
  import { CockpitFilters, ManagementViewSortKey } from './cockpitTypes';
5
5
  import { CommonState } from './commonState';
6
6
  export interface CompanyManagementViewState extends CommonState {
7
- qboRealmIdUpdateStatusByCompanyId: Record<ID, FetchStateAndError>;
8
7
  uiState: ManagementUIState;
9
8
  updatesByCompanyId: Record<ID, CompanyManagementUpdateState>;
10
9
  }
@@ -19,7 +18,6 @@ export interface CompanyManagementUpdateState {
19
18
  }
20
19
  export declare function getCompanyManagementUpdatesInProgress(state: CompanyManagementViewState, companyId: ID, includeCompletedUpdates?: boolean): CompanyManagementUpdatesInProgress | undefined;
21
20
  export declare function getCompanyManagementPendingUpdates(companyId: ID, state: CompanyManagementViewState): Partial<CompanyManagementInfo> | undefined;
22
- export declare function getCompanyQboRealmIdUpdateStatus(state: CompanyManagementViewState, companyId: ID): FetchStateAndError;
23
21
  export interface ManagementUIState {
24
22
  filters: CockpitFilters;
25
23
  filterText: string;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initialCompanyManagementView = void 0;
4
4
  exports.getCompanyManagementUpdatesInProgress = getCompanyManagementUpdatesInProgress;
5
5
  exports.getCompanyManagementPendingUpdates = getCompanyManagementPendingUpdates;
6
- exports.getCompanyQboRealmIdUpdateStatus = getCompanyQboRealmIdUpdateStatus;
7
6
  const commonState_1 = require("./commonState");
8
7
  function getCompanyManagementUpdatesInProgress(state, companyId, includeCompletedUpdates = false) {
9
8
  const updatesInProgress = state.updatesByCompanyId[companyId]?.updatesInProgress;
@@ -22,16 +21,9 @@ function getCompanyManagementUpdatesInProgress(state, companyId, includeComplete
22
21
  function getCompanyManagementPendingUpdates(companyId, state) {
23
22
  return state.updatesByCompanyId[companyId]?.pendingUpdates;
24
23
  }
25
- function getCompanyQboRealmIdUpdateStatus(state, companyId) {
26
- return (state.qboRealmIdUpdateStatusByCompanyId[companyId] ?? {
27
- fetchState: 'Not-Started',
28
- error: undefined,
29
- });
30
- }
31
24
  exports.initialCompanyManagementView = {
32
25
  ...commonState_1.initialCommonState,
33
26
  updatesByCompanyId: {},
34
- qboRealmIdUpdateStatusByCompanyId: {},
35
27
  uiState: {
36
28
  sortKey: 'status',
37
29
  sortOrder: 'ascending',
@@ -20,6 +20,5 @@ export interface CompanyPassportViewState extends CommonState, FetchedState {
20
20
  updateStatus: FetchStateAndError;
21
21
  localData?: PrimaryContactLocalData;
22
22
  };
23
- productServicesUpdateStatus: FetchStateAndError;
24
23
  }
25
24
  export declare const initialCompanyPassportView: CompanyPassportViewState;
@@ -12,10 +12,6 @@ exports.initialCompanyPassportView = {
12
12
  fetchState: 'Not-Started',
13
13
  error: undefined,
14
14
  },
15
- productServicesUpdateStatus: {
16
- fetchState: 'Not-Started',
17
- error: undefined,
18
- },
19
15
  capitalizationThresholdUpdateStatus: {
20
16
  fetchState: 'Not-Started',
21
17
  error: undefined,
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
39
39
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
40
40
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
41
41
  export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
42
- messageSection: "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" | "product_services_update" | "qbo_realm_id_update" | "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";
42
+ messageSection: "reconcile" | "save_reconcile_for_later" | "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" | "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";
43
43
  messageText: "notification" | "failed" | "success";
44
44
  type: "error" | "success" | "info";
45
45
  variables: {
@@ -3,7 +3,7 @@ import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
3
3
  import { OnboardingInfo } from '../../entity/company/companyStateTypes';
4
4
  import { ZeniDate } from '../../zeniDayJS';
5
5
  import { AuditSummaryPayload, ReviewCompanyPayload } from './reviewCompanyPayload';
6
- export declare const toReviewColumnKeyType: (v: string) => "companyName" | "notes" | "uncategorized" | "auditScore" | "miscategorized" | "warnings" | "vendorReview" | "reviewVendor";
6
+ export declare const toReviewColumnKeyType: (v: string) => "companyName" | "uncategorized" | "notes" | "auditScore" | "miscategorized" | "warnings" | "vendorReview" | "reviewVendor";
7
7
  export type ReviewCompanyColumnKey = ReturnType<typeof toReviewColumnKeyType>;
8
8
  export type ReviewTransactionsType = 'income' | 'expense';
9
9
  export interface AuditSummary {
@@ -23,7 +23,7 @@ export interface BulkReviewState {
23
23
  transactionId: ID;
24
24
  errors?: BulkActionReviewError[];
25
25
  }
26
- export declare const toBulkReviewStatusCode: (v: string) => "error" | "warning" | "valid";
26
+ export declare const toBulkReviewStatusCode: (v: string) => "error" | "valid" | "warning";
27
27
  export declare type BulkReviewStatusCode = ReturnType<typeof toBulkReviewStatusCode>;
28
28
  export declare const toBulkReviewErrorCode: (v: string) => "ERR_INSUFFICIENT_DATA" | "ERR_INVOICE_DATE_OUTSIDE_ACCOUNTING_PERIOD" | "ERR_FUTURE_PAYMENT_DATE_SUPPORTED" | "ERR_POSSIBLE_DUPLICATE_TRANSACTION" | "ERR_INVALID_DATA" | "ERR_PAYMENT_DATE_CURRENT_OR_FUTURE_DATE_SUPPORTED" | "ERR_PHYSICAL_ADDRESS_REQUIRED" | "ERR_START_DATE_GT_END_DATE" | "ERR_RECURRING_PAYMENT_START_DATE_IS_PAST_DATE" | "ERR_INCORRECT_RECURRING_PAYMENT_CYCLE" | "ERR_INCORRECT_FIELD" | "ERR_UPDATE_VENDOR_DETAILS" | "ERR_AMOUNT_ZERO" | "ERR_INSUFFICIENT_FUNDS" | "ERR_BANK_CONNECTION";
29
29
  export declare type BulkReviewErrorCode = ReturnType<typeof toBulkReviewErrorCode>;
@@ -23,7 +23,7 @@ export interface BulkReviewState {
23
23
  };
24
24
  }
25
25
  export declare const BULK_REVIEW_STATUS_CODES: readonly ["valid", "error", "warning"];
26
- export declare const toBulkReviewStatusCode: (v: string) => "error" | "warning" | "valid";
26
+ export declare const toBulkReviewStatusCode: (v: string) => "error" | "valid" | "warning";
27
27
  export declare type BulkReviewStatusCode = ReturnType<typeof toBulkReviewStatusCode>;
28
28
  export declare const BULK_REVIEW_ERROR_CODES: readonly ["ERR_INSUFFICIENT_DATA", "ERR_INVOICE_DATE_OUTSIDE_ACCOUNTING_PERIOD", "ERR_FUTURE_PAYMENT_DATE_SUPPORTED", "ERR_POSSIBLE_DUPLICATE_TRANSACTION", "ERR_INVALID_DATA", "ERR_PAYMENT_DATE_CURRENT_OR_FUTURE_DATE_SUPPORTED", "ERR_PHYSICAL_ADDRESS_REQUIRED", "ERR_START_DATE_GT_END_DATE", "ERR_RECURRING_PAYMENT_START_DATE_IS_PAST_DATE", "ERR_INCORRECT_RECURRING_PAYMENT_CYCLE", "ERR_INCORRECT_FIELD", "ERR_UPDATE_VENDOR_DETAILS", "ERR_AMOUNT_ZERO"];
29
29
  export declare const toBulkReviewErrorCode: (v: string) => "ERR_INSUFFICIENT_DATA" | "ERR_INVOICE_DATE_OUTSIDE_ACCOUNTING_PERIOD" | "ERR_FUTURE_PAYMENT_DATE_SUPPORTED" | "ERR_POSSIBLE_DUPLICATE_TRANSACTION" | "ERR_INVALID_DATA" | "ERR_PAYMENT_DATE_CURRENT_OR_FUTURE_DATE_SUPPORTED" | "ERR_PHYSICAL_ADDRESS_REQUIRED" | "ERR_START_DATE_GT_END_DATE" | "ERR_RECURRING_PAYMENT_START_DATE_IS_PAST_DATE" | "ERR_INCORRECT_RECURRING_PAYMENT_CYCLE" | "ERR_INCORRECT_FIELD" | "ERR_UPDATE_VENDOR_DETAILS" | "ERR_AMOUNT_ZERO";
@@ -1,4 +1,4 @@
1
- export declare const toSubscriptionSortKeyType: (v: string) => "status" | "companyName" | "controller" | "plans" | "planLowerLimit" | "planHigherLimit" | "avg2MonthExpenses" | "addons" | "upgradeStatus" | "monthlyRecurringRevenue" | "notes";
1
+ export declare const toSubscriptionSortKeyType: (v: string) => "status" | "companyName" | "controller" | "avg2MonthExpenses" | "monthlyRecurringRevenue" | "notes" | "plans" | "planLowerLimit" | "planHigherLimit" | "addons" | "upgradeStatus";
2
2
  export type SubscriptionViewSortKey = ReturnType<typeof toSubscriptionSortKeyType>;
3
3
  export declare const SUBSCRIPTION_STATUS_CODES: string[];
4
4
  declare const toSubscriptionStatusCodeType: (v: string) => string;
@@ -58,7 +58,7 @@ export interface TaskListUIState extends SpendManagementUIState {
58
58
  searchText: string;
59
59
  sortKey: TaskListViewSortKey;
60
60
  }
61
- declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "priority" | "dueDate" | "tag" | "timeSpent" | "assignee" | "creationDate" | "visibility";
61
+ declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "priority" | "dueDate" | "tag" | "timeSpent" | "creationDate" | "assignee" | "visibility";
62
62
  export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
63
63
  export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
64
64
  interface TaskListFilterCategoryOption {
@@ -6,7 +6,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
6
6
  import { W9Form } from './vendorFiling1099UploadDetailsPayload';
7
7
  import { VendorFiling1099UploadDetailsState, VendorsFiling1099UploadDetailsLocalData } from './vendorFiling1099UploadDetailsState';
8
8
  export declare const initialState: VendorFiling1099UploadDetailsState;
9
- export declare const updateW9FormUploadFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
+ export declare const clearVendorFiling1099UploadDetails: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorFiling1099UploadDetails/clearVendorFiling1099UploadDetails">, updateW9FormUploadFile: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
10
  w9FormFile: FilePayload;
11
11
  }, "vendorFiling1099UploadDetails/updateW9FormUploadFile">, updateW9FormUploadFetchState: import("@reduxjs/toolkit").ActionCreatorWithPayload<FetchStateAndError, "vendorFiling1099UploadDetails/updateW9FormUploadFetchState">, vendorFiling1099UploadDetailsSave: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, signal?: AbortSignal | undefined], {
12
12
  vendorId: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.vendorFiling1099UploadDetailsResetFormStatus = exports.updateW9FormOCRDataToLocalData = exports.updateVendor1099DetailsLocalData = exports.initializeVendorFiling1099UploadDetailsLocalState = exports.vendorFiling1099UploadDetailsSuccessOrFailure = exports.vendorFiling1099UploadDetailsResetLocalData = exports.vendorFiling1099UploadDetailsSave = exports.updateW9FormUploadFetchState = exports.updateW9FormUploadFile = exports.initialState = void 0;
4
+ exports.vendorFiling1099UploadDetailsResetFormStatus = exports.updateW9FormOCRDataToLocalData = exports.updateVendor1099DetailsLocalData = exports.initializeVendorFiling1099UploadDetailsLocalState = exports.vendorFiling1099UploadDetailsSuccessOrFailure = exports.vendorFiling1099UploadDetailsResetLocalData = exports.vendorFiling1099UploadDetailsSave = exports.updateW9FormUploadFetchState = exports.updateW9FormUploadFile = exports.clearVendorFiling1099UploadDetails = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const vendorFiling1099UploadDetailsPayload_1 = require("./vendorFiling1099UploadDetailsPayload");
7
7
  exports.initialState = {
@@ -209,7 +209,10 @@ const vendorFiling1099UploadDetails = (0, toolkit_1.createSlice)({
209
209
  address: action.payload.ocrData.address != null,
210
210
  };
211
211
  },
212
+ clearVendorFiling1099UploadDetails() {
213
+ return exports.initialState;
214
+ },
212
215
  },
213
216
  });
214
- _a = vendorFiling1099UploadDetails.actions, exports.updateW9FormUploadFile = _a.updateW9FormUploadFile, exports.updateW9FormUploadFetchState = _a.updateW9FormUploadFetchState, exports.vendorFiling1099UploadDetailsSave = _a.vendorFiling1099UploadDetailsSave, exports.vendorFiling1099UploadDetailsResetLocalData = _a.vendorFiling1099UploadDetailsResetLocalData, exports.vendorFiling1099UploadDetailsSuccessOrFailure = _a.vendorFiling1099UploadDetailsSuccessOrFailure, exports.initializeVendorFiling1099UploadDetailsLocalState = _a.initializeVendorFiling1099UploadDetailsLocalState, exports.updateVendor1099DetailsLocalData = _a.updateVendor1099DetailsLocalData, exports.updateW9FormOCRDataToLocalData = _a.updateW9FormOCRDataToLocalData, exports.vendorFiling1099UploadDetailsResetFormStatus = _a.vendorFiling1099UploadDetailsResetFormStatus;
217
+ _a = vendorFiling1099UploadDetails.actions, exports.clearVendorFiling1099UploadDetails = _a.clearVendorFiling1099UploadDetails, exports.updateW9FormUploadFile = _a.updateW9FormUploadFile, exports.updateW9FormUploadFetchState = _a.updateW9FormUploadFetchState, exports.vendorFiling1099UploadDetailsSave = _a.vendorFiling1099UploadDetailsSave, exports.vendorFiling1099UploadDetailsResetLocalData = _a.vendorFiling1099UploadDetailsResetLocalData, exports.vendorFiling1099UploadDetailsSuccessOrFailure = _a.vendorFiling1099UploadDetailsSuccessOrFailure, exports.initializeVendorFiling1099UploadDetailsLocalState = _a.initializeVendorFiling1099UploadDetailsLocalState, exports.updateVendor1099DetailsLocalData = _a.updateVendor1099DetailsLocalData, exports.updateW9FormOCRDataToLocalData = _a.updateW9FormOCRDataToLocalData, exports.vendorFiling1099UploadDetailsResetFormStatus = _a.vendorFiling1099UploadDetailsResetFormStatus;
215
218
  exports.default = vendorFiling1099UploadDetails.reducer;
@@ -1,6 +1,6 @@
1
1
  import { VendorTabViewState } from './vendorTabViewState';
2
2
  export declare const initialState: VendorTabViewState;
3
- export declare const fetchVendorTabView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
3
+ export declare const clearVendorTabView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorTabView/clearVendorTabView">, fetchVendorTabView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
4
4
  shouldFetchAccruedExpenses: boolean;
5
5
  shouldFetchFiling1099Vendor: boolean;
6
6
  shouldFetchFixedAssets: boolean;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateVendorTabViewTab = exports.fetchVendorTabView = exports.initialState = void 0;
4
+ exports.updateVendorTabViewTab = exports.fetchVendorTabView = exports.clearVendorTabView = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const vendorTabViewState_1 = require("./vendorTabViewState");
7
7
  exports.initialState = {
@@ -46,7 +46,10 @@ const vendorTabView = (0, toolkit_1.createSlice)({
46
46
  draft.currentTab = action.payload.tab;
47
47
  },
48
48
  },
49
+ clearVendorTabView(draft) {
50
+ Object.assign(draft, exports.initialState);
51
+ },
49
52
  },
50
53
  });
51
- _a = vendorTabView.actions, exports.fetchVendorTabView = _a.fetchVendorTabView, exports.updateVendorTabViewTab = _a.updateVendorTabViewTab;
54
+ _a = vendorTabView.actions, exports.clearVendorTabView = _a.clearVendorTabView, exports.fetchVendorTabView = _a.fetchVendorTabView, exports.updateVendorTabViewTab = _a.updateVendorTabViewTab;
52
55
  exports.default = vendorTabView.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.84-beta3ND",
3
+ "version": "5.1.84",
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",
@@ -1,81 +0,0 @@
1
- import { from } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { updateCompanies } from '../../../../entity/company/companyReducer';
4
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
- import { updateTenantProductSettings } from '../../../../entity/tenant/tenantReducer';
6
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
7
- import { updateCompanyProductServices, updateCompanyProductServicesFailure, updateCompanyProductServicesSuccess, } from '../../companyViewReducer';
8
- export const updateCompanyProductServicesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateCompanyProductServices.match), switchMap((action) => {
9
- const { companyId, services } = action.payload;
10
- const { isBookkeepingEnabled, isBillPayEnabled, isReimbursementEnabled } = services;
11
- const tenantId = Object.values(state$.value.tenantState.tenantsById).find((tenant) => tenant?.companyId === companyId)?.tenantId;
12
- // Send only the service-enable fields so the backend routes this through
13
- // its isolated "enable services" path. Bookkeeping is a Tenant product
14
- // flag and implies spend management; bill pay / reimbursement are Company
15
- // feature flags.
16
- const requestBody = {};
17
- if (isBookkeepingEnabled != null) {
18
- requestBody.is_book_keeping_enabled = isBookkeepingEnabled;
19
- requestBody.is_spend_management_enabled = isBookkeepingEnabled;
20
- }
21
- if (isBillPayEnabled != null) {
22
- requestBody.is_bill_pay_feature_enabled = isBillPayEnabled;
23
- }
24
- if (isReimbursementEnabled != null) {
25
- requestBody.is_reimbursement_feature_enabled = isReimbursementEnabled;
26
- }
27
- return zeniAPI
28
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, requestBody)
29
- .pipe(mergeMap((response) => {
30
- if (isSuccessResponse(response)) {
31
- const companies = response.data?.companies ?? [];
32
- if (companies.length > 0) {
33
- const actions = [
34
- updateCompanies({
35
- payload: companies,
36
- schema: {},
37
- }),
38
- ];
39
- // The company response carries the company feature flags; the
40
- // tenant product flags are not part of it, so merge them from
41
- // the (now-succeeded) request values.
42
- if (isBookkeepingEnabled != null && tenantId != null) {
43
- actions.push(updateTenantProductSettings({
44
- tenantId,
45
- isBookkeepingEnabled,
46
- isSpendManagementEnabled: isBookkeepingEnabled,
47
- }));
48
- }
49
- actions.push(updateCompanyProductServicesSuccess());
50
- actions.push(openSnackbar({
51
- messageSection: 'product_services_update',
52
- messageText: 'success',
53
- type: 'success',
54
- }));
55
- return from(actions);
56
- }
57
- }
58
- return from([
59
- updateCompanyProductServicesFailure({
60
- status: response.status,
61
- }),
62
- openSnackbar({
63
- messageSection: 'product_services_update',
64
- messageText: 'failed',
65
- type: 'error',
66
- }),
67
- ]);
68
- }), catchError((error) => from([
69
- updateCompanyProductServicesFailure({
70
- status: createZeniAPIStatus('Unexpected error', 'Update Company Product Services errored out' +
71
- (error instanceof Error
72
- ? error.message
73
- : JSON.stringify(error))),
74
- }),
75
- openSnackbar({
76
- messageSection: 'product_services_update',
77
- messageText: 'failed',
78
- type: 'error',
79
- }),
80
- ])));
81
- }));
@@ -1,62 +0,0 @@
1
- import { from } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { getCompanyByCompanyId } from '../../../entity/company/companySelector';
4
- import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
5
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
6
- import { updateCompanyQboRealmId, updateCompanyQboRealmIdFailure, updateCompanyQboRealmIdSuccess, } from '../companyViewReducer';
7
- export const updateCompanyQboRealmIdEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateCompanyQboRealmId.match),
8
- // Per-row admin action: several rows can be in flight at once, so each
9
- // trigger keeps its own request instead of cancelling the previous one.
10
- mergeMap((action) => {
11
- const { companyId, qboRealmId } = action.payload;
12
- // Cockpit populates companyState (with a companyId->tenantId mapping) but
13
- // not tenantState, so resolve from company first and fall back to tenant.
14
- const tenantId = getCompanyByCompanyId(state$.value.companyState, companyId)?.company
15
- .companyInfo.tenantId ??
16
- Object.values(state$.value.tenantState.tenantsById).find((tenant) => tenant?.companyId === companyId)?.tenantId;
17
- if (tenantId == null) {
18
- return from([
19
- updateCompanyQboRealmIdFailure(companyId, createZeniAPIStatus('Unexpected error', `No tenant found for companyId: ${companyId}`)),
20
- openSnackbar({
21
- messageSection: 'qbo_realm_id_update',
22
- messageText: 'failed',
23
- type: 'error',
24
- }),
25
- ]);
26
- }
27
- // The FE route reads the target tenant from the zeni-tenant-id header,
28
- // which overrides the operator's ambient tenant for this request only.
29
- // qboRealmId omitted -> null clears the pin; a value overwrites it.
30
- return zeniAPI
31
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/qbo-realm-id`, { qbo_realm_id: qboRealmId ?? null }, { 'zeni-tenant-id': tenantId })
32
- .pipe(mergeMap((response) => {
33
- if (isSuccessResponse(response)) {
34
- return from([
35
- updateCompanyQboRealmIdSuccess({ companyId }),
36
- openSnackbar({
37
- messageSection: 'qbo_realm_id_update',
38
- messageText: 'success',
39
- type: 'success',
40
- }),
41
- ]);
42
- }
43
- return from([
44
- updateCompanyQboRealmIdFailure(companyId, response.status),
45
- openSnackbar({
46
- messageSection: 'qbo_realm_id_update',
47
- messageText: 'failed',
48
- type: 'error',
49
- }),
50
- ]);
51
- }), catchError((error) => from([
52
- updateCompanyQboRealmIdFailure(companyId, createZeniAPIStatus('Unexpected error', 'Update Company QBO realm id errored out' +
53
- (error instanceof Error
54
- ? error.message
55
- : JSON.stringify(error)))),
56
- openSnackbar({
57
- messageSection: 'qbo_realm_id_update',
58
- messageText: 'failed',
59
- type: 'error',
60
- }),
61
- ])));
62
- }));
@@ -1,10 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateCompanies } from '../../../../entity/company/companyReducer';
4
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
- import { updateTenantProductSettings } from '../../../../entity/tenant/tenantReducer';
6
- import { RootState } from '../../../../reducer';
7
- import { ZeniAPI } from '../../../../zeniAPI';
8
- import { updateCompanyProductServices, updateCompanyProductServicesFailure, updateCompanyProductServicesSuccess } from '../../companyViewReducer';
9
- export type ActionType = ReturnType<typeof updateCompanies> | ReturnType<typeof updateTenantProductSettings> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateCompanyProductServices> | ReturnType<typeof updateCompanyProductServicesSuccess> | ReturnType<typeof updateCompanyProductServicesFailure>;
10
- export declare const updateCompanyProductServicesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCompanyProductServicesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const companyReducer_1 = require("../../../../entity/company/companyReducer");
7
- const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
8
- const tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
9
- const responsePayload_1 = require("../../../../responsePayload");
10
- const companyViewReducer_1 = require("../../companyViewReducer");
11
- const updateCompanyProductServicesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateCompanyProductServices.match), (0, operators_1.switchMap)((action) => {
12
- const { companyId, services } = action.payload;
13
- const { isBookkeepingEnabled, isBillPayEnabled, isReimbursementEnabled } = services;
14
- const tenantId = Object.values(state$.value.tenantState.tenantsById).find((tenant) => tenant?.companyId === companyId)?.tenantId;
15
- // Send only the service-enable fields so the backend routes this through
16
- // its isolated "enable services" path. Bookkeeping is a Tenant product
17
- // flag and implies spend management; bill pay / reimbursement are Company
18
- // feature flags.
19
- const requestBody = {};
20
- if (isBookkeepingEnabled != null) {
21
- requestBody.is_book_keeping_enabled = isBookkeepingEnabled;
22
- requestBody.is_spend_management_enabled = isBookkeepingEnabled;
23
- }
24
- if (isBillPayEnabled != null) {
25
- requestBody.is_bill_pay_feature_enabled = isBillPayEnabled;
26
- }
27
- if (isReimbursementEnabled != null) {
28
- requestBody.is_reimbursement_feature_enabled = isReimbursementEnabled;
29
- }
30
- return zeniAPI
31
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, requestBody)
32
- .pipe((0, operators_1.mergeMap)((response) => {
33
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
34
- const companies = response.data?.companies ?? [];
35
- if (companies.length > 0) {
36
- const actions = [
37
- (0, companyReducer_1.updateCompanies)({
38
- payload: companies,
39
- schema: {},
40
- }),
41
- ];
42
- // The company response carries the company feature flags; the
43
- // tenant product flags are not part of it, so merge them from
44
- // the (now-succeeded) request values.
45
- if (isBookkeepingEnabled != null && tenantId != null) {
46
- actions.push((0, tenantReducer_1.updateTenantProductSettings)({
47
- tenantId,
48
- isBookkeepingEnabled,
49
- isSpendManagementEnabled: isBookkeepingEnabled,
50
- }));
51
- }
52
- actions.push((0, companyViewReducer_1.updateCompanyProductServicesSuccess)());
53
- actions.push((0, snackbarReducer_1.openSnackbar)({
54
- messageSection: 'product_services_update',
55
- messageText: 'success',
56
- type: 'success',
57
- }));
58
- return (0, rxjs_1.from)(actions);
59
- }
60
- }
61
- return (0, rxjs_1.from)([
62
- (0, companyViewReducer_1.updateCompanyProductServicesFailure)({
63
- status: response.status,
64
- }),
65
- (0, snackbarReducer_1.openSnackbar)({
66
- messageSection: 'product_services_update',
67
- messageText: 'failed',
68
- type: 'error',
69
- }),
70
- ]);
71
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
72
- (0, companyViewReducer_1.updateCompanyProductServicesFailure)({
73
- status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update Company Product Services errored out' +
74
- (error instanceof Error
75
- ? error.message
76
- : JSON.stringify(error))),
77
- }),
78
- (0, snackbarReducer_1.openSnackbar)({
79
- messageSection: 'product_services_update',
80
- messageText: 'failed',
81
- type: 'error',
82
- }),
83
- ])));
84
- }));
85
- exports.updateCompanyProductServicesEpic = updateCompanyProductServicesEpic;
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
4
- import { RootState } from '../../../reducer';
5
- import { ZeniAPI } from '../../../zeniAPI';
6
- import { updateCompanyQboRealmId, updateCompanyQboRealmIdFailure, updateCompanyQboRealmIdSuccess } from '../companyViewReducer';
7
- export type ActionType = ReturnType<typeof openSnackbar> | ReturnType<typeof updateCompanyQboRealmId> | ReturnType<typeof updateCompanyQboRealmIdSuccess> | ReturnType<typeof updateCompanyQboRealmIdFailure>;
8
- export declare const updateCompanyQboRealmIdEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCompanyQboRealmIdEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const companySelector_1 = require("../../../entity/company/companySelector");
7
- const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
8
- const responsePayload_1 = require("../../../responsePayload");
9
- const companyViewReducer_1 = require("../companyViewReducer");
10
- const updateCompanyQboRealmIdEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateCompanyQboRealmId.match),
11
- // Per-row admin action: several rows can be in flight at once, so each
12
- // trigger keeps its own request instead of cancelling the previous one.
13
- (0, operators_1.mergeMap)((action) => {
14
- const { companyId, qboRealmId } = action.payload;
15
- // Cockpit populates companyState (with a companyId->tenantId mapping) but
16
- // not tenantState, so resolve from company first and fall back to tenant.
17
- const tenantId = (0, companySelector_1.getCompanyByCompanyId)(state$.value.companyState, companyId)?.company
18
- .companyInfo.tenantId ??
19
- Object.values(state$.value.tenantState.tenantsById).find((tenant) => tenant?.companyId === companyId)?.tenantId;
20
- if (tenantId == null) {
21
- return (0, rxjs_1.from)([
22
- (0, companyViewReducer_1.updateCompanyQboRealmIdFailure)(companyId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', `No tenant found for companyId: ${companyId}`)),
23
- (0, snackbarReducer_1.openSnackbar)({
24
- messageSection: 'qbo_realm_id_update',
25
- messageText: 'failed',
26
- type: 'error',
27
- }),
28
- ]);
29
- }
30
- // The FE route reads the target tenant from the zeni-tenant-id header,
31
- // which overrides the operator's ambient tenant for this request only.
32
- // qboRealmId omitted -> null clears the pin; a value overwrites it.
33
- return zeniAPI
34
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/qbo-realm-id`, { qbo_realm_id: qboRealmId ?? null }, { 'zeni-tenant-id': tenantId })
35
- .pipe((0, operators_1.mergeMap)((response) => {
36
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
37
- return (0, rxjs_1.from)([
38
- (0, companyViewReducer_1.updateCompanyQboRealmIdSuccess)({ companyId }),
39
- (0, snackbarReducer_1.openSnackbar)({
40
- messageSection: 'qbo_realm_id_update',
41
- messageText: 'success',
42
- type: 'success',
43
- }),
44
- ]);
45
- }
46
- return (0, rxjs_1.from)([
47
- (0, companyViewReducer_1.updateCompanyQboRealmIdFailure)(companyId, response.status),
48
- (0, snackbarReducer_1.openSnackbar)({
49
- messageSection: 'qbo_realm_id_update',
50
- messageText: 'failed',
51
- type: 'error',
52
- }),
53
- ]);
54
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
55
- (0, companyViewReducer_1.updateCompanyQboRealmIdFailure)(companyId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update Company QBO realm id errored out' +
56
- (error instanceof Error
57
- ? error.message
58
- : JSON.stringify(error)))),
59
- (0, snackbarReducer_1.openSnackbar)({
60
- messageSection: 'qbo_realm_id_update',
61
- messageText: 'failed',
62
- type: 'error',
63
- }),
64
- ])));
65
- }));
66
- exports.updateCompanyQboRealmIdEpic = updateCompanyQboRealmIdEpic;