@zeniai/client-epic-state 5.0.4 → 5.0.7-betaAD01

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.
@@ -1,2 +1,2 @@
1
- export declare const toAnimationsFileName: (v: string) => "Success" | "AiAgent" | "AiIconEntry" | "AiIconExit" | "AiIconLoop" | "AiStar" | "AiStarIcon" | "AiStarPlain" | "AIPoweredInvoiceDark" | "AIPoweredInvoiceLight" | "Angry" | "AutoTransfer" | "CloseCard" | "Confetti" | "ConfettiSuccess" | "DashboardChristmasSnow" | "DashboardNewYearShow" | "DashboardSidebarBottomChristmas" | "DashboardSidebarBottomHalloween" | "DashboardSidebarBottomNewYear" | "DashboardSidebarBottomThanksgiving" | "DashboardSidebarTopChristmas" | "DashboardSidebarTopHalloween" | "DashboardSidebarTopNewYear" | "DashboardSidebarTopThanksgiving" | "Distribution" | "EarnYield" | "FastestWayDark" | "FastestWayLight" | "FinanceTeamDark" | "FinanceTeamLight" | "Happy" | "Liquidity" | "LockCard" | "MoneyTransferSuccess" | "MultiLevelApprovalDark" | "MultiLevelApprovalLight" | "NotHappy" | "Protection" | "ReceiptDark" | "ReceiptLight" | "Recurring" | "ReimburseDark" | "ReimburseLight" | "RewardsDark" | "RewardsDarkHover" | "RewardsLight" | "RewardsLightHover" | "Secure" | "Target" | "UnlockCard" | "VeryHappy" | "ZeniAssist";
1
+ export declare const toAnimationsFileName: (v: string) => "Success" | "AiAgent" | "AiIconEntry" | "AiIconExit" | "AiIconLoop" | "AiStar" | "AiStarIcon" | "AiStarPlain" | "AIPoweredInvoiceDark" | "AIPoweredInvoiceLight" | "Angry" | "AutoTransfer" | "CloseCard" | "Confetti" | "ConfettiSuccess" | "DashboardChristmasSnow" | "DashboardNewYearShow" | "DashboardSidebarBottomChristmas" | "DashboardSidebarBottomHalloween" | "DashboardSidebarBottomNewYear" | "DashboardSidebarBottomThanksgiving" | "DashboardSidebarTopChristmas" | "DashboardSidebarTopHalloween" | "DashboardSidebarTopNewYear" | "DashboardSidebarTopThanksgiving" | "Distribution" | "EarnYield" | "FastestWayDark" | "FastestWayLight" | "FinanceTeamDark" | "FinanceTeamLight" | "Happy" | "Liquidity" | "LockCard" | "MoneyTransferSuccess" | "MultiLevelApprovalDark" | "MultiLevelApprovalLight" | "NotHappy" | "Protection" | "ReceiptDark" | "ReceiptLight" | "Recurring" | "ReimburseDark" | "ReimburseLight" | "Ripple" | "RewardsDark" | "RewardsDarkHover" | "RewardsLight" | "RewardsLightHover" | "Secure" | "Target" | "UnlockCard" | "VeryHappy" | "ZeniAssist";
2
2
  export type AnimationFileName = ReturnType<typeof toAnimationsFileName>;
@@ -46,6 +46,7 @@ const ALL_ANIMATIONS_FILE_NAMES = [
46
46
  'Recurring',
47
47
  'ReimburseDark',
48
48
  'ReimburseLight',
49
+ 'Ripple',
49
50
  'RewardsDark',
50
51
  'RewardsDarkHover',
51
52
  'RewardsLight',
@@ -1,4 +1,4 @@
1
- export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_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_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" | "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" | "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" | "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";
1
+ export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_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_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" | "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" | "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" | "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" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation";
2
2
  export type SnackbarMessageSections = ReturnType<typeof toSnackbarMessageSection>;
3
3
  export declare const toSnackbarMessageSectionTexts: (v: string) => "notification" | "failed" | "success";
4
4
  export type SnackbarMessageSectionTexts = ReturnType<typeof toSnackbarMessageSectionTexts>;
@@ -205,6 +205,8 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
205
205
  'transactionCategorized_transactionUpdated_transactionsFailed',
206
206
  'transactionCategorized_transactionUpdated_transactionFailed',
207
207
  'accounting_classes_enabled_update',
208
+ 'account_excluded_from_reconciliation',
209
+ 'account_included_in_reconciliation',
208
210
  ];
209
211
  const toSnackbarMessageSection = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_SNACKBAR_MESSAGE_SECTIONS);
210
212
  exports.toSnackbarMessageSection = toSnackbarMessageSection;
@@ -21,6 +21,8 @@ export interface TransactionPayload extends TransactionIDPayload, AccountBasePay
21
21
  category_id?: string | null;
22
22
  category_integration_id?: string | null;
23
23
  category_name?: string | null;
24
+ class_id?: string | null;
25
+ class_name?: string | null;
24
26
  customer_id?: string | null;
25
27
  customer_name?: string | null;
26
28
  document_id?: string;
@@ -38,8 +38,6 @@ const toTransaction = (payload) => {
38
38
  const amount = (0, exports.getTransactionPayloadAmount)(payload);
39
39
  const recipientAmount = getTransactionPayloadRecipientAmount(payload);
40
40
  const lines = payload?.lines?.map((linePayload) => (0, transactionLinePayload_1.toLine)(linePayload, amount, recipientAmount));
41
- const firstLineWithClass = lines?.find((line) => 'class' in line &&
42
- line.class?.classId != null);
43
41
  return {
44
42
  ...(0, transactionIDPayload_1.toTransactionID)(payload),
45
43
  typeOfTransaction: 'supported',
@@ -97,6 +95,12 @@ const toTransaction = (payload) => {
97
95
  payload.category_integration_id !== ''
98
96
  ? { categoryIntegrationId: payload.category_integration_id }
99
97
  : {}),
98
+ ...(payload.class_id != null && payload.class_id !== ''
99
+ ? { classId: payload.class_id }
100
+ : {}),
101
+ ...(payload.class_name != null && payload.class_name !== ''
102
+ ? { className: payload.class_name }
103
+ : {}),
100
104
  ...(payload.category_name != null && payload.category_name !== ''
101
105
  ? { categoryName: payload.category_name }
102
106
  : {}),
@@ -105,8 +109,6 @@ const toTransaction = (payload) => {
105
109
  account: payloadHasAccountInfo(payload)
106
110
  ? (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(payload)
107
111
  : undefined,
108
- classId: firstLineWithClass?.class?.classId,
109
- className: firstLineWithClass?.class?.className,
110
112
  syncToken: payload.sync_token?.toString(),
111
113
  paymentType: payload.payment_type ?? undefined,
112
114
  paymentTypeName: payload.payment_type_name ?? undefined,
@@ -176,6 +178,18 @@ const toTransactionPayload = (transaction) => {
176
178
  target_account_name: transaction.targetAccountName,
177
179
  };
178
180
  }
181
+ if (transaction.classId != null && transaction.classId !== '') {
182
+ transactionPayload = {
183
+ ...transactionPayload,
184
+ class_id: transaction.classId,
185
+ };
186
+ }
187
+ if (transaction.className != null && transaction.className !== '') {
188
+ transactionPayload = {
189
+ ...transactionPayload,
190
+ class_name: transaction.className,
191
+ };
192
+ }
179
193
  if (transaction.toFromAccountId != null &&
180
194
  transaction.toFromAccountId !== '') {
181
195
  transactionPayload = {
@@ -43,6 +43,7 @@ const ALL_ANIMATIONS_FILE_NAMES = [
43
43
  'Recurring',
44
44
  'ReimburseDark',
45
45
  'ReimburseLight',
46
+ 'Ripple',
46
47
  'RewardsDark',
47
48
  'RewardsDarkHover',
48
49
  'RewardsLight',
@@ -202,6 +202,8 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
202
202
  'transactionCategorized_transactionUpdated_transactionsFailed',
203
203
  'transactionCategorized_transactionUpdated_transactionFailed',
204
204
  'accounting_classes_enabled_update',
205
+ 'account_excluded_from_reconciliation',
206
+ 'account_included_in_reconciliation',
205
207
  ];
206
208
  export const toSnackbarMessageSection = (v) => stringToUnion(v, ALL_SNACKBAR_MESSAGE_SECTIONS);
207
209
  // Keeping this different from the message type, since we may not have messages in all instances
@@ -34,8 +34,6 @@ export const toTransaction = (payload) => {
34
34
  const amount = getTransactionPayloadAmount(payload);
35
35
  const recipientAmount = getTransactionPayloadRecipientAmount(payload);
36
36
  const lines = payload?.lines?.map((linePayload) => toLine(linePayload, amount, recipientAmount));
37
- const firstLineWithClass = lines?.find((line) => 'class' in line &&
38
- line.class?.classId != null);
39
37
  return {
40
38
  ...toTransactionID(payload),
41
39
  typeOfTransaction: 'supported',
@@ -93,6 +91,12 @@ export const toTransaction = (payload) => {
93
91
  payload.category_integration_id !== ''
94
92
  ? { categoryIntegrationId: payload.category_integration_id }
95
93
  : {}),
94
+ ...(payload.class_id != null && payload.class_id !== ''
95
+ ? { classId: payload.class_id }
96
+ : {}),
97
+ ...(payload.class_name != null && payload.class_name !== ''
98
+ ? { className: payload.class_name }
99
+ : {}),
96
100
  ...(payload.category_name != null && payload.category_name !== ''
97
101
  ? { categoryName: payload.category_name }
98
102
  : {}),
@@ -101,8 +105,6 @@ export const toTransaction = (payload) => {
101
105
  account: payloadHasAccountInfo(payload)
102
106
  ? mapAccountBasePayloadToAccountBase(payload)
103
107
  : undefined,
104
- classId: firstLineWithClass?.class?.classId,
105
- className: firstLineWithClass?.class?.className,
106
108
  syncToken: payload.sync_token?.toString(),
107
109
  paymentType: payload.payment_type ?? undefined,
108
110
  paymentTypeName: payload.payment_type_name ?? undefined,
@@ -171,6 +173,18 @@ export const toTransactionPayload = (transaction) => {
171
173
  target_account_name: transaction.targetAccountName,
172
174
  };
173
175
  }
176
+ if (transaction.classId != null && transaction.classId !== '') {
177
+ transactionPayload = {
178
+ ...transactionPayload,
179
+ class_id: transaction.classId,
180
+ };
181
+ }
182
+ if (transaction.className != null && transaction.className !== '') {
183
+ transactionPayload = {
184
+ ...transactionPayload,
185
+ class_name: transaction.className,
186
+ };
187
+ }
174
188
  if (transaction.toFromAccountId != null &&
175
189
  transaction.toFromAccountId !== '') {
176
190
  transactionPayload = {
@@ -3,6 +3,7 @@ import { catchError, filter, mergeMap } from 'rxjs/operators';
3
3
  import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
4
  import { getAccountKey } from '../../../../entity/account/accountState';
5
5
  import { getAccountReconByAccountIdAndSelectedPeriod } from '../../../../entity/accountRecon/accountReconSelector';
6
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
6
7
  import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
7
8
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
8
9
  import { excludeAccountFromReconciliation, excludeAccountFromReconciliationFailure, excludeAccountFromReconciliationSuccess, } from '../../reducers/reconciliationViewReducer';
@@ -31,14 +32,32 @@ export const excludeAccountFromReconciliationEpic = (actions$, state$, zeniAPI)
31
32
  }), changeAccountKey({
32
33
  oldKey: oldAccountKey,
33
34
  newKey: newAccountKey,
35
+ }), openSnackbar({
36
+ messageSection: 'account_excluded_from_reconciliation',
37
+ messageText: 'success',
38
+ type: 'success',
39
+ variables: [
40
+ {
41
+ variableName: '_account-name_',
42
+ variableValue: reconciliationData?.account.accountName ?? '',
43
+ },
44
+ ],
34
45
  }));
35
46
  }
36
47
  else {
37
48
  return of(excludeAccountFromReconciliationFailure({
38
49
  error: response.status,
50
+ }), openSnackbar({
51
+ messageSection: 'account_excluded_from_reconciliation',
52
+ messageText: 'failed',
53
+ type: 'error',
39
54
  }));
40
55
  }
41
56
  }), catchError((error) => of(excludeAccountFromReconciliationFailure({
42
57
  error: createZeniAPIStatus('Unexpected Error', `Exclude account from reconciliation REST API call errored out ${JSON.stringify(error)}`),
58
+ }), openSnackbar({
59
+ messageSection: 'account_excluded_from_reconciliation',
60
+ messageText: 'failed',
61
+ type: 'error',
43
62
  }))));
44
63
  }));
@@ -2,8 +2,10 @@ import { of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
3
  import { convertToPeriod } from '../../../../commonStateTypes/timePeriod';
4
4
  import { changeAccountKey } from '../../../../entity/account/accountReducer';
5
+ import { getAccountBase } from '../../../../entity/account/accountSelector';
5
6
  import { getAccountKey } from '../../../../entity/account/accountState';
6
7
  import { updateAccountRecon } from '../../../../entity/accountRecon/accountReconReducer';
8
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
7
9
  import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
8
10
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
9
11
  import { includeAccountInReconciliation, includeAccountInReconciliationFailure, includeAccountInReconciliationSuccess, } from '../../reducers/reconciliationViewReducer';
@@ -12,6 +14,7 @@ export const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) =>
12
14
  const state = state$.value;
13
15
  const currentTenant = getCurrentTenant(state);
14
16
  const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
17
+ const account = getAccountBase(state.accountState, accountId, 'excluded_account_reconciliation');
15
18
  const period = convertToPeriod(selectedPeriod, true);
16
19
  const query = JSON.stringify({
17
20
  start_date: period.start,
@@ -31,14 +34,32 @@ export const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) =>
31
34
  }), changeAccountKey({
32
35
  oldKey: oldAccountKey,
33
36
  newKey: newAccountKey,
37
+ }), openSnackbar({
38
+ messageSection: 'account_included_in_reconciliation',
39
+ messageText: 'success',
40
+ type: 'success',
41
+ variables: [
42
+ {
43
+ variableName: '_account-name_',
44
+ variableValue: account?.accountName ?? '',
45
+ },
46
+ ],
34
47
  }));
35
48
  }
36
49
  else {
37
50
  return of(includeAccountInReconciliationFailure({
38
51
  error: response.status,
52
+ }), openSnackbar({
53
+ messageSection: 'account_included_in_reconciliation',
54
+ messageText: 'failed',
55
+ type: 'error',
39
56
  }));
40
57
  }
41
58
  }), catchError((error) => of(includeAccountInReconciliationFailure({
42
59
  error: createZeniAPIStatus('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
60
+ }), openSnackbar({
61
+ messageSection: 'account_included_in_reconciliation',
62
+ messageText: 'failed',
63
+ type: 'error',
43
64
  }))));
44
65
  }));