@zeniai/client-epic-state 4.11.47 → 4.11.48

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 (67) hide show
  1. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  2. package/lib/entity/company/companyPayload.d.ts +0 -12
  3. package/lib/entity/company/companyPayload.js +0 -21
  4. package/lib/entity/company/companyReducer.d.ts +0 -7
  5. package/lib/entity/company/companyReducer.js +2 -22
  6. package/lib/entity/company/companyStateTypes.d.ts +0 -12
  7. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  8. package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +0 -2
  9. package/lib/entity/paymentAccount/paymentAccountPayload.js +0 -2
  10. package/lib/entity/paymentAccount/paymentAccountState.d.ts +0 -2
  11. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  12. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
  13. package/lib/index.d.ts +6 -6
  14. package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
  15. package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
  16. package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
  17. package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
  18. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
  19. package/lib/view/onboardingView/customerView/epic/plaidConnection/establishOnboardingPlaidConnectionEpic.js +0 -2
  20. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  21. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  22. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  23. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  24. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  25. package/lib/view/referralView/referralState.d.ts +1 -1
  26. package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +41 -45
  27. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  28. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +4 -6
  29. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +6 -29
  30. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  31. package/lib/view/settingsView/settingsViewHelpers.js +12 -6
  32. package/lib/view/settingsView/settingsViewReducer.d.ts +1 -3
  33. package/lib/view/settingsView/settingsViewReducer.js +2 -11
  34. package/lib/view/settingsView/settingsViewSelector.d.ts +1 -1
  35. package/lib/view/settingsView/settingsViewSelector.js +7 -56
  36. package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +2 -10
  37. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -2
  38. package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
  39. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +1 -4
  40. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +4 -16
  41. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -2
  42. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +2 -1
  43. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
  44. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +1 -4
  45. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +4 -16
  46. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -4
  47. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +32 -42
  48. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +2 -1
  49. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updateMappedCashAccountEpic.js +5 -4
  50. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
  51. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
  52. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +12 -34
  53. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
  54. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +16 -52
  55. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/getPlaidLinkTokenEpic.js +1 -1
  56. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +29 -22
  57. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +78 -49
  58. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +8 -2
  59. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +3 -5
  60. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +19 -6
  61. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
  62. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +1 -4
  63. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +9 -20
  64. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
  65. package/lib/view/tagView/epics/createTagEpic.d.ts +6 -6
  66. package/lib/view/tagView/epics/deleteTagEpic.d.ts +6 -6
  67. package/package.json +1 -1
@@ -32,7 +32,7 @@ export declare const inviteZeniPeopleEpic: (actions$: ActionsObservable<ActionTy
32
32
  type: string;
33
33
  } | {
34
34
  payload: {
35
- messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "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_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "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_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" | "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_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "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";
35
+ messageSection: "reimbursement_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "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_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "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_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" | "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" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "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";
36
36
  messageText: "failed" | "success" | "notification";
37
37
  type: import("../..").SnackbarMessageType;
38
38
  showStatusIcon?: boolean | undefined;
@@ -13,7 +13,7 @@ export declare const resendInviteEpic: (actions$: ActionsObservable<ActionType>,
13
13
  type: string;
14
14
  } | {
15
15
  payload: {
16
- messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "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_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "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_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" | "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_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "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";
16
+ messageSection: "reimbursement_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "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_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "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_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" | "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" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "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";
17
17
  messageText: "failed" | "success" | "notification";
18
18
  type: import("../..").SnackbarMessageType;
19
19
  showStatusIcon?: boolean | undefined;
@@ -46,7 +46,7 @@ export declare const REFERRAL_LIST_VIEW_SORT_KEYS: readonly ["invitee_email", "a
46
46
  export declare const toReferralListViewSortKeyType: (v: string) => "status" | "amount" | "invitee_email" | "referral_date";
47
47
  export declare type ReferralListViewSortKey = ReturnType<typeof toReferralListViewSortKeyType>;
48
48
  export declare const ALL_REFERRAL_STATUSES: readonly ["invite_processing", "invite_sent", "onboarding", "active", "declined", "resend_invite", "reward_sent"];
49
- export declare const toReferralStatusType: (v: string) => "active" | "onboarding" | "invite_processing" | "invite_sent" | "declined" | "resend_invite" | "reward_sent";
49
+ export declare const toReferralStatusType: (v: string) => "active" | "onboarding" | "declined" | "invite_processing" | "invite_sent" | "resend_invite" | "reward_sent";
50
50
  export declare type ReferralStatus = ReturnType<typeof toReferralStatusType>;
51
51
  export declare const StatusTypes: Record<ReferralStatus, string>;
52
52
  export declare const ALL_REFERRAL_AMOUNT_STATUSES: readonly ["received", "to_be_received"];
@@ -69,51 +69,47 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
69
69
  }
70
70
  });
71
71
  const sortOrderValue = (0, sortOrderPayload_1.getSortOrder)(sortOrder);
72
- const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValues, sortKey === 'auditScore'
73
- ? ['auditSummary.auditScorePercentage', 'auditSummary.fixesRequired']
74
- : (company) => {
75
- var _a;
76
- const warningCount = (0, exports.getAuditWarningsCount)(company);
77
- let primarySortValue;
78
- let secondarySortValue;
79
- let isSecondarySortApplicable;
80
- switch (sortKey) {
81
- case 'notes':
82
- primarySortValue = (_a = company.note) === null || _a === void 0 ? void 0 : _a.toLowerCase();
83
- break;
84
- case 'uncategorized':
85
- isSecondarySortApplicable = true;
86
- primarySortValue = company.uncategorizedTransactions.income
87
- ? 1
88
- : 0;
89
- secondarySortValue = company.uncategorizedTransactions.expense
90
- ? 1
91
- : 0;
92
- break;
93
- case 'miscategorized':
94
- isSecondarySortApplicable = true;
95
- primarySortValue = company.miscategorizedTransactions.income
96
- ? 1
97
- : 0;
98
- secondarySortValue = company.miscategorizedTransactions.expense
99
- ? 1
100
- : 0;
101
- break;
102
- case 'warnings':
103
- primarySortValue = warningCount;
104
- break;
105
- case 'reviewVendor':
106
- primarySortValue = company.isVendorReviewReqiured;
107
- break;
108
- case 'companyName':
109
- default:
110
- primarySortValue = company.name.toLowerCase();
111
- break;
112
- }
113
- return isSecondarySortApplicable === true
114
- ? [primarySortValue, secondarySortValue]
115
- : primarySortValue;
116
- }, [sortOrderValue, sortOrderValue]);
72
+ const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValues, (sortKey === 'auditScore') ? ['auditSummary.auditScorePercentage', 'auditSummary.fixesRequired'] : (company) => {
73
+ var _a;
74
+ const warningCount = (0, exports.getAuditWarningsCount)(company);
75
+ let primarySortValue;
76
+ let secondarySortValue;
77
+ let isSecondarySortApplicable;
78
+ switch (sortKey) {
79
+ case 'notes':
80
+ primarySortValue = (_a = company.note) === null || _a === void 0 ? void 0 : _a.toLowerCase();
81
+ break;
82
+ case 'uncategorized':
83
+ isSecondarySortApplicable = true;
84
+ primarySortValue = company.uncategorizedTransactions.income ? 1 : 0;
85
+ secondarySortValue = company.uncategorizedTransactions.expense
86
+ ? 1
87
+ : 0;
88
+ break;
89
+ case 'miscategorized':
90
+ isSecondarySortApplicable = true;
91
+ primarySortValue = company.miscategorizedTransactions.income
92
+ ? 1
93
+ : 0;
94
+ secondarySortValue = company.miscategorizedTransactions.expense
95
+ ? 1
96
+ : 0;
97
+ break;
98
+ case 'warnings':
99
+ primarySortValue = warningCount;
100
+ break;
101
+ case 'reviewVendor':
102
+ primarySortValue = company.isVendorReviewReqiured;
103
+ break;
104
+ case 'companyName':
105
+ default:
106
+ primarySortValue = company.name.toLowerCase();
107
+ break;
108
+ }
109
+ return isSecondarySortApplicable === true
110
+ ? [primarySortValue, secondarySortValue]
111
+ : primarySortValue;
112
+ }, [sortOrderValue, sortOrderValue]);
117
113
  return {
118
114
  companies: [
119
115
  ...sortedCompaniesWithSortKeyValue,
@@ -10,7 +10,7 @@ export declare const ALL_SCHEDULES_SUB_TABS: readonly ["all", "new", "ongoing",
10
10
  export declare const toScheduleSubTabType: (v: string) => "all" | "new" | "completed" | "ongoing";
11
11
  export declare type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
12
12
  export declare const ALL_SCHEDULES_PAY_SORT_KEYS: readonly ["transactionDate", "vendor", "scheduleCategory", "expenseCategory", "accumulatedDepreciationCategory", "class", "amount", "balanceAsOfToday", "memo", "startMonth", "endMonth", "months", "transactionType", "status", "assetId", "user"];
13
- export declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "amount" | "vendor" | "class" | "memo" | "transactionDate" | "transactionType" | "balanceAsOfToday" | "scheduleCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "startMonth" | "endMonth" | "assetId";
13
+ export declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "amount" | "vendor" | "class" | "memo" | "transactionDate" | "scheduleCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "balanceAsOfToday" | "startMonth" | "endMonth" | "transactionType" | "assetId";
14
14
  export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
15
15
  export interface DownloadJEScheduleTabOptions {
16
16
  timezone: string;
@@ -1,8 +1,6 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
1
+ import { ActionsObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { RootState } from '../../../reducer';
4
3
  import { fetchBankConnectionsView, fetchBankAccountsList } from '../settingsViewReducer';
5
- import { fetchPaymentAccountList } from '../../spendManagement/zeniAccounts/paymentAccountList/paymentAccountListReducer';
6
- import { fetchDepositAccountList } from '../../spendManagement/zeniAccounts/depositAccountList/depositAccountListReducer';
7
- export declare type ActionType = ReturnType<typeof fetchBankConnectionsView> | ReturnType<typeof fetchBankAccountsList> | ReturnType<typeof fetchPaymentAccountList> | ReturnType<typeof fetchDepositAccountList>;
8
- export declare const fetchBankConnectionsViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
4
+ import { getPaymentAccounts } from '../../spendManagement/plaidAccount/plaidAccountViewReducer';
5
+ export declare type ActionType = ReturnType<typeof fetchBankConnectionsView> | ReturnType<typeof fetchBankAccountsList> | ReturnType<typeof getPaymentAccounts>;
6
+ export declare const fetchBankConnectionsViewEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
@@ -4,34 +4,11 @@ exports.fetchBankConnectionsViewEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const settingsViewReducer_1 = require("../settingsViewReducer");
7
- const paymentAccountListReducer_1 = require("../../spendManagement/zeniAccounts/paymentAccountList/paymentAccountListReducer");
8
- const depositAccountListReducer_1 = require("../../spendManagement/zeniAccounts/depositAccountList/depositAccountListReducer");
9
- const fetchBankConnectionsViewEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBankConnectionsView.match), (0, operators_1.mergeMap)((action) => {
10
- const { cacheOverride } = action.payload;
11
- const bankConnectionActions = [];
12
- const state = state$.value;
13
- if (cacheOverride === true) {
14
- bankConnectionActions.push((0, settingsViewReducer_1.fetchBankAccountsList)());
15
- bankConnectionActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
16
- bankConnectionActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
17
- }
18
- else {
19
- const bankAccountsList = state.settingsViewState.bankConnection;
20
- if (bankAccountsList.fetchState !== 'Completed' &&
21
- bankAccountsList.fetchState !== 'In-Progress') {
22
- bankConnectionActions.push((0, settingsViewReducer_1.fetchBankAccountsList)());
23
- }
24
- const paymentAccountList = state.paymentAccountListState;
25
- if (paymentAccountList.hasValidState() === false &&
26
- paymentAccountList.fetchState !== 'In-Progress') {
27
- bankConnectionActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
28
- }
29
- const depositAccountList = state.depositAccountListState;
30
- if (depositAccountList.hasValidState() === false &&
31
- depositAccountList.fetchState !== 'In-Progress') {
32
- bankConnectionActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
33
- }
34
- }
35
- return (0, rxjs_1.concat)((0, rxjs_1.from)(bankConnectionActions));
7
+ const plaidAccountViewReducer_1 = require("../../spendManagement/plaidAccount/plaidAccountViewReducer");
8
+ const fetchBankConnectionsViewEpic = (actions$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBankConnectionsView.match), (0, operators_1.switchMap)(() => {
9
+ return (0, rxjs_1.from)([
10
+ (0, settingsViewReducer_1.fetchBankAccountsList)(),
11
+ (0, plaidAccountViewReducer_1.getPaymentAccounts)('bill_pay', 'spend_management_setup', false),
12
+ ]);
36
13
  }));
37
14
  exports.fetchBankConnectionsViewEpic = fetchBankConnectionsViewEpic;
@@ -18,7 +18,7 @@ export declare const saveNotificationSettingsEpic: (actions$: ActionsObservable<
18
18
  type: string;
19
19
  } | {
20
20
  payload: {
21
- messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "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_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "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_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" | "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_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "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";
21
+ messageSection: "reimbursement_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "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_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "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_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" | "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" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "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";
22
22
  messageText: "failed" | "success" | "notification";
23
23
  type: import("../../..").SnackbarMessageType;
24
24
  showStatusIcon?: boolean | undefined;
@@ -11,7 +11,8 @@ const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
11
11
  return (((0, userRoleType_1.hasBillPayAccessible)(currentTenant, userRoleMap) ||
12
12
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
13
13
  (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole)) &&
14
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false);
14
+ (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
15
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
15
16
  }
16
17
  else {
17
18
  return false;
@@ -30,7 +31,8 @@ const isApprovalRulesTabVisible = (userRole, currentTenant, userRoleMap) => {
30
31
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
31
32
  ((isBillPayTOSAccepted || isReimbursementTOSAccepted) &&
32
33
  (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole))) &&
33
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false);
34
+ (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
35
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
34
36
  }
35
37
  else {
36
38
  return false;
@@ -46,7 +48,8 @@ const isBankConnectionsTabVisible = (currentTenant, userRoleMap) => {
46
48
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
47
49
  (0, userRoleType_1.hasZeniAccountsAccessible)(currentTenant, userRoleMap) ||
48
50
  (0, userRoleType_1.hasChargeCardAccessible)(currentTenant, userRoleMap)) &&
49
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false);
51
+ (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
52
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
50
53
  }
51
54
  else {
52
55
  return false;
@@ -62,7 +65,8 @@ const isBusinessVerificationTabVisible = (currentTenant, userRoleMap) => {
62
65
  (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
63
66
  (0, userRoleType_1.hasZeniAccountsAccessible)(currentTenant, userRoleMap) ||
64
67
  (0, userRoleType_1.hasChargeCardAccessible)(currentTenant, userRoleMap)) &&
65
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false);
68
+ (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
69
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
66
70
  }
67
71
  else {
68
72
  return false;
@@ -88,7 +92,8 @@ const isIntegrationsTabVisible = (userRole, currentTenant) => {
88
92
  return false;
89
93
  }
90
94
  if ((0, exports.isSettingsVisible)(currentTenant)) {
91
- return ((0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole) && !(0, tenantSelector_1.isTenantBankingOnly)(currentTenant));
95
+ return ((0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole) &&
96
+ !((0, tenantSelector_1.isTenantBankingOnly)(currentTenant) || (0, tenantSelector_1.isTenantCardsOnly)(currentTenant)));
92
97
  }
93
98
  else {
94
99
  return false;
@@ -137,6 +142,7 @@ const isNotificationsTabVisible = (notificationSettings, signedInUseEmail, curre
137
142
  const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettings;
138
143
  return (((0, exports.isRemindersSectionVisibleOnSettingsPage)(reminderNotificationSettings) ||
139
144
  (0, exports.isMonthEndNotificationsSectionVisibleOnSettingsPage)(monthEndInsightsNotificationSettings, signedInUseEmail)) &&
140
- (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false);
145
+ (0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
146
+ (0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
141
147
  };
142
148
  exports.isNotificationsTabVisible = isNotificationsTabVisible;
@@ -11,9 +11,7 @@ export declare const fetchMyProfileView: import("@reduxjs/toolkit").ActionCreato
11
11
  companyId: string;
12
12
  }, string, never, never>, updateMyProfileOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string], {
13
13
  userId: string;
14
- }, string, never, never>, updateMyProfileOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankConnectionsView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: any], {
15
- cacheOverride: any;
16
- }, string, never, never>, fetchBillingAccountsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateBankConnectionOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
14
+ }, string, never, never>, updateMyProfileOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankConnectionsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchBillingAccountsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateBankConnectionOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
17
15
  bankAccountIds: ID[];
18
16
  }, string>, updateBankConnectionOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankAccountsList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchNotificationSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateNotificationSettingsOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[data: NotificationSettingsPayload, loggedInUserEmail: string], {
19
17
  data: NotificationSettingsPayload;
@@ -94,17 +94,8 @@ const settings = (0, toolkit_1.createSlice)({
94
94
  draft.profile.fetchState = 'Error';
95
95
  draft.profile.error = action.payload;
96
96
  },
97
- fetchBankConnectionsView: {
98
- reducer() {
99
- // do nothing
100
- },
101
- prepare(cacheOverride) {
102
- return {
103
- payload: {
104
- cacheOverride,
105
- },
106
- };
107
- },
97
+ fetchBankConnectionsView() {
98
+ // Do nothing.
108
99
  },
109
100
  fetchBillingAccountsView() {
110
101
  // Do nothing.
@@ -3,7 +3,7 @@ import { FetchStateAndError, ID } from '../../commonStateTypes/common';
3
3
  import { MyBankConnectionsView, BankConnectionsSetupView, MyProfileSelectorView, NotificationSettingsSelectorView, IntegrationsView, BillingView } from './types/settingsViewSelectorTypes';
4
4
  import { NotificationSettings } from './settingsViewState';
5
5
  export declare function getApprovalRuleViewDetails(state: RootState): FetchStateAndError;
6
- export declare function getBankConnectionsSetupViewDetails(state: RootState, companyId: ID, isAccountEnabled: boolean, isCardEnabled: boolean): BankConnectionsSetupView;
6
+ export declare function getBankConnectionsSetupViewDetails(state: RootState, companyId: ID): BankConnectionsSetupView;
7
7
  export declare function getBillingAccountsViewDetails(state: RootState, companyId: ID): BillingView;
8
8
  export declare function getMyBankConnectionsDetails(state: RootState, userId: ID): MyBankConnectionsView;
9
9
  export declare function getIntegrationsView(state: RootState, companyId: ID): IntegrationsView;
@@ -19,8 +19,6 @@ const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
19
19
  const companyPassportViewSelector_1 = require("../companyView/selector/companyPassportViewSelector");
20
20
  const userFinancialAccountSelector_1 = require("../userFinancialAccount/userFinancialAccountSelector");
21
21
  const setupViewSelector_1 = require("../../view/spendManagement/commonSetup/setupViewSelector");
22
- const depositAccountSelector_1 = require("../../entity/depositAccount/depositAccountSelector");
23
- const getCompanyView_1 = require("../companyView/selectorHelpers/getCompanyView");
24
22
  const cardPaymentViewSelector_1 = require("../cardPayment/cardPaymentViewSelector");
25
23
  function getApprovalRuleViewDetails(state) {
26
24
  const { billPaySetupApproverViewState, remiSetupApproverViewState } = state;
@@ -33,65 +31,18 @@ function getApprovalRuleViewDetails(state) {
33
31
  };
34
32
  }
35
33
  exports.getApprovalRuleViewDetails = getApprovalRuleViewDetails;
36
- function getBankConnectionsSetupViewDetails(state, companyId, isAccountEnabled, isCardEnabled) {
37
- var _a, _b, _c, _d, _e, _f;
38
- const { accountState, settingsViewState, paymentAccountState, depositAccountState, depositAccountListState, paymentAccountListState, } = state;
34
+ function getBankConnectionsSetupViewDetails(state, companyId) {
35
+ const { accountState, plaidAccountViewState, settingsViewState } = state;
39
36
  const { bankConnection } = settingsViewState;
40
- const { paymentAccountIds } = paymentAccountListState;
41
- const { accountIds: depositAccountIds } = depositAccountListState;
42
- const allBankAccounts = bankConnection.fetchState === 'Completed'
43
- ? bankConnection.bankAccountIds
44
- .map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, 'bill_pay'))
45
- .filter((account) => account != null)
46
- : [];
47
- const paymentAccounts = paymentAccountListState.hasValidState()
48
- ? (_a = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountIds).filter((account) => account != null)) !== null && _a !== void 0 ? _a : []
49
- : [];
50
- const depositAccounts = depositAccountListState.hasValidState()
51
- ? (_b = (0, depositAccountSelector_1.getDepositAccountsByDepositAccountIds)(depositAccountState, depositAccountIds).filter((account) => account != null)) !== null && _b !== void 0 ? _b : []
52
- : [];
37
+ const allBankAccounts = bankConnection.bankAccountIds
38
+ .map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, 'bill_pay'))
39
+ .filter((account) => account != null);
53
40
  const fetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
54
41
  settingsViewState.bankConnection,
55
- paymentAccountListState,
56
- depositAccountListState,
42
+ plaidAccountViewState['spend_management_setup'].accountDetails.fetchStatus,
57
43
  ]);
58
- const allFundingAccounts = fetchState.fetchState === 'Completed'
59
- ? (0, setupViewSelector_1.getAllFundingAccounts)(depositAccounts, paymentAccounts, false)
60
- : [];
61
- const primaryAccountsProductWise = [
62
- Object.assign({ productType: 'bill_pay' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', 'bill_pay_setup')),
63
- Object.assign({ productType: 'reimbursement' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'reimbursement', 'reimbursement_setup')),
64
- ];
65
- if (isAccountEnabled) {
66
- primaryAccountsProductWise.push(Object.assign({ productType: 'zeni_accounts' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'zeni_accounts', 'account_setup')));
67
- }
68
- if (isCardEnabled) {
69
- primaryAccountsProductWise.push(Object.assign({ productType: 'charge_cards' }, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'charge_cards', 'charge_card_setup')));
70
- }
71
- const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
72
- const billPayPrimaryAccount = (_c = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.primaryFundingAccount) === null || _c === void 0 ? void 0 : _c.accountId; //companyBillPayInfo
73
- const remiPrimaryAccount = (_d = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyReimbursementInfo.primaryFundingAccount) === null || _d === void 0 ? void 0 : _d.accountId;
74
- const accountsPrimaryAccount = (_e = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyZeniAccountInfo.primaryFundingAccount) === null || _e === void 0 ? void 0 : _e.accountId; //companyZeniAccountInfo
75
- const chargeCardsPrimaryAccount = (_f = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyChargeCardInfo.primaryFundingAccount) === null || _f === void 0 ? void 0 : _f.accountId; //companyChargeCardInfo
76
- const primaryAccounts = [];
77
- if (billPayPrimaryAccount) {
78
- primaryAccounts.push(billPayPrimaryAccount);
79
- }
80
- if (remiPrimaryAccount) {
81
- primaryAccounts.push(remiPrimaryAccount);
82
- }
83
- if (accountsPrimaryAccount) {
84
- primaryAccounts.push(accountsPrimaryAccount);
85
- }
86
- if (chargeCardsPrimaryAccount) {
87
- primaryAccounts.push(chargeCardsPrimaryAccount);
88
- }
89
- const nonPrimaryPaymentAccounts = paymentAccounts.filter((paymentAcc) => !primaryAccounts.includes(paymentAcc.paymentAccountId));
90
44
  return {
91
- primaryConnection: primaryAccountsProductWise,
92
- otherPaymentAccounts: nonPrimaryPaymentAccounts,
93
- allFundingAccounts,
94
- allBankAccounts,
45
+ setupView: Object.assign(Object.assign({}, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', 'spend_management_setup')), { allBankAccounts }),
95
46
  fetchState: fetchState.fetchState,
96
47
  };
97
48
  }
@@ -5,13 +5,11 @@ import { PaymentAccount } from '../../../entity/paymentAccount/paymentAccountSta
5
5
  import { User } from '../../../entity/user/userState';
6
6
  import { UserRole } from '../../../entity/userRole/userRoleState';
7
7
  import { Person } from '../../people/peopleSelectorTypes';
8
- import { FundingAccount, SetupView } from '../../spendManagement/commonSetup/setupViewSelector';
8
+ import { SetupView } from '../../spendManagement/commonSetup/setupViewSelector';
9
9
  import { UserFinancialAccountSelectorView } from '../../userFinancialAccount/userFinancialAccountSelector';
10
10
  import { IntegrationsSettings, NotificationSettings, SettingsViewUIState } from '../settingsViewState';
11
11
  import { TenantExternalConnections } from '../../../entity/tenant/tenantState';
12
12
  import { Company } from '../../../entity/company/companyStateTypes';
13
- import { EntityType as SpendManagementEntityType } from '../../../entity/entityApprovalStatus/entityApprovalStatusState';
14
- import { AccountBase } from '../../../entity/account/accountState';
15
13
  import { CardPaymentSelectorView } from '../../cardPayment/cardPaymentViewSelector';
16
14
  export interface MyProfileSelectorView extends SelectorView {
17
15
  isZeniUser: boolean;
@@ -31,19 +29,13 @@ export interface MyBankConnectionsView extends UserFinancialAccountSelectorView
31
29
  paymentAccounts: PaymentAccount[];
32
30
  }
33
31
  export interface BankConnectionsSetupView extends FetchStateAndError {
34
- primaryConnection: ProductWisePrimaryAccount[];
35
- otherPaymentAccounts: PaymentAccount[];
36
- allFundingAccounts: FundingAccount[];
37
- allBankAccounts: AccountBase[];
32
+ setupView: SetupView;
38
33
  }
39
34
  export interface BillingView extends FetchStateAndError {
40
35
  setupView: SetupView;
41
36
  cardPaymentView: CardPaymentSelectorView;
42
37
  uiState: SettingsViewUIState;
43
38
  }
44
- export interface ProductWisePrimaryAccount extends SetupView {
45
- productType: SpendManagementEntityType;
46
- }
47
39
  export interface NotificationSettingsSelectorView extends NotificationSettings {
48
40
  allUsers: User[];
49
41
  classList: Class[];
@@ -37,7 +37,7 @@ const getDuplicateBills = (state, billId) => {
37
37
  exports.getDuplicateBills = getDuplicateBills;
38
38
  const getReviewPageBillDetail = (state, billId) => {
39
39
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
40
- const { accountListState, accountState, billTransactionState, classListState, editBillDetailViewState, paymentAccountState, vendorState, contactState, billPayConfigState, recurringBillState, depositAccountState, depositAccountListState, paymentAccountListState, } = state;
40
+ const { accountListState, accountState, plaidAccountViewState, billTransactionState, classListState, editBillDetailViewState, paymentAccountState, vendorState, contactState, billPayConfigState, recurringBillState, depositAccountState, depositAccountListState, } = state;
41
41
  const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId !== null && billId !== void 0 ? billId : '');
42
42
  const sourceBillDetail = billId != null
43
43
  ? (_a = editBillDetailViewState.editBillStateById) === null || _a === void 0 ? void 0 : _a[key]
@@ -47,7 +47,8 @@ const getReviewPageBillDetail = (state, billId) => {
47
47
  let paymentDetailsSection;
48
48
  let file;
49
49
  let contactDetails = [];
50
- const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountListState.paymentAccountIds);
50
+ const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, plaidAccountViewState['spend_management_setup'].accountDetails
51
+ .paymentAccountIds);
51
52
  const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState).depositAccounts;
52
53
  const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount);
53
54
  let fetchState = 'Not-Started';
@@ -4,7 +4,7 @@ exports.getBillPayBusinessVerificationDetails = exports.getBillPaySetupViewDetai
4
4
  const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
5
5
  const helpers_1 = require("../../helpers");
6
6
  function getBillPaySetupViewDetails(state, companyId) {
7
- const billPaySetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', 'bill_pay_setup');
7
+ const billPaySetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'bill_pay', 'spend_management_setup');
8
8
  const businessVerificationDetails = getBillPayBusinessVerificationDetails(state, companyId);
9
9
  const selectedCompanyOfficer = (0, helpers_1.getSelectedCompanyOfficer)(businessVerificationDetails);
10
10
  const { billPaySetupViewState, setupViewState } = state;
@@ -13,8 +13,5 @@ import { openSnackbar } from '../../../../../../entity/snackbar/snackbarReducer'
13
13
  import { updateSetupViewLocalStoreData } from '../../../../commonSetup/setupViewReducer';
14
14
  import { fetchBillPaySetupView, fetchBillPaySetupViewSuccess, fetchBillPaySetupViewFailure } from '../../billPaySetupViewReducer';
15
15
  import { updatePlaidAccountViewAccountDetails } from '../../../../plaidAccount/plaidAccountViewReducer';
16
- import { updatePaymentAccountList } from '../../../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
17
- import { updateDepositAccounts } from '../../../../../../entity/depositAccount/depositAccountReducer';
18
- import { updateDepositAccountList } from '../../../../zeniAccounts/depositAccountList/depositAccountListReducer';
19
- export declare type ActionType = ReturnType<typeof fetchBillPaySetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePaymentAccountList> | ReturnType<typeof updateDepositAccounts> | ReturnType<typeof updateDepositAccountList> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchBillPaySetupViewSuccess> | ReturnType<typeof fetchBillPaySetupViewFailure>;
16
+ export declare type ActionType = ReturnType<typeof fetchBillPaySetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchBillPaySetupViewSuccess> | ReturnType<typeof fetchBillPaySetupViewFailure>;
20
17
  export declare const fetchBillPaySetupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -16,9 +16,6 @@ const snackbarReducer_1 = require("../../../../../../entity/snackbar/snackbarRed
16
16
  const setupViewReducer_1 = require("../../../../commonSetup/setupViewReducer");
17
17
  const billPaySetupViewReducer_1 = require("../../billPaySetupViewReducer");
18
18
  const plaidAccountViewReducer_1 = require("../../../../plaidAccount/plaidAccountViewReducer");
19
- const paymentAccountListReducer_1 = require("../../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
20
- const depositAccountReducer_1 = require("../../../../../../entity/depositAccount/depositAccountReducer");
21
- const depositAccountListReducer_1 = require("../../../../zeniAccounts/depositAccountList/depositAccountListReducer");
22
19
  const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupViewReducer_1.fetchBillPaySetupView.match), (0, operators_1.switchMap)((action) => {
23
20
  var _a;
24
21
  const { companyId, cacheOverride, refreshViewInBackground } = action.payload;
@@ -32,9 +29,9 @@ const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
32
29
  return zeniAPI
33
30
  .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}?query={"view":"bill_pay_setup"}`)
34
31
  .pipe((0, operators_1.mergeMap)((response) => {
35
- var _a, _b, _c;
36
32
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
37
33
  const allBankAccountIds = response.data.accounts.map((account) => account.account_id);
34
+ const paymentAccountIds = response.data.payment_accounts.map((paymentAccount) => paymentAccount.payment_account_id);
38
35
  const actions = [
39
36
  (0, userReducer_1.updateAllUsers)({ users: response.data.users }),
40
37
  (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
@@ -46,19 +43,10 @@ const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
46
43
  (0, fileReducer_1.updateFiles)({ files: response.data.files }),
47
44
  (0, accountReducer_1.updateAccounts)(response.data.accounts, 'bill_pay'),
48
45
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
49
- (0, paymentAccountListReducer_1.updatePaymentAccountList)({
50
- data: response.data.payment_accounts,
51
- updateType: 'replace',
52
- }),
53
- (0, depositAccountReducer_1.updateDepositAccounts)((_a = response.data.deposit_accounts) !== null && _a !== void 0 ? _a : []),
54
- (0, depositAccountListReducer_1.updateDepositAccountList)({
55
- data: (_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.deposit_accounts) !== null && _c !== void 0 ? _c : [],
56
- updateType: 'replace',
57
- }),
58
46
  (0, setupViewReducer_1.updateSetupViewLocalStoreData)({
59
47
  companyId: response.data.companies[0].company_id,
60
48
  }),
61
- (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'bill_pay_setup'),
49
+ (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'),
62
50
  (0, billPaySetupViewReducer_1.fetchBillPaySetupViewSuccess)(),
63
51
  ];
64
52
  return (0, rxjs_1.from)(actions);
@@ -74,10 +62,10 @@ const fetchBillPaySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((
74
62
  JSON.stringify(error))))));
75
63
  }
76
64
  else {
77
- const { allBankAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
65
+ const { allBankAccountIds, paymentAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
78
66
  return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
79
67
  companyId,
80
- }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'bill_pay_setup'), (0, billPaySetupViewReducer_1.fetchBillPaySetupViewSuccess)());
68
+ }), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, paymentAccountIds, 'spend_management_setup'), (0, billPaySetupViewReducer_1.fetchBillPaySetupViewSuccess)());
81
69
  }
82
70
  }));
83
71
  exports.fetchBillPaySetupViewEpic = fetchBillPaySetupViewEpic;