@zeniai/client-epic-state 4.19.96-betaJK21 → 4.19.96-betaJK4

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 (123) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/entity/accountRecon/accountReconState.d.ts +1 -1
  3. package/lib/entity/accountRecon/accountReconState.js +0 -1
  4. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  5. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +35 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
  9. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  10. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +13 -0
  11. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  12. package/lib/entity/tenant/tenantReducer.js +1 -0
  13. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  14. package/lib/entity/tenant/tenantSelector.js +9 -1
  15. package/lib/entity/tenant/tenantState.d.ts +1 -0
  16. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
  17. package/lib/entity/transaction/payloadTypes/transactionPayload.js +11 -0
  18. package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
  19. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  20. package/lib/epic.d.ts +3 -1
  21. package/lib/epic.js +3 -1
  22. package/lib/esm/entity/accountRecon/accountReconState.js +0 -1
  23. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  24. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  25. package/lib/esm/entity/tenant/tenantReducer.js +1 -0
  26. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  27. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +11 -0
  28. package/lib/esm/epic.js +3 -1
  29. package/lib/esm/index.js +9 -7
  30. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  31. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  32. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  33. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  34. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +15 -5
  35. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  36. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconExcludedAccountsEpic.js +27 -0
  37. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -2
  38. package/lib/esm/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -1
  39. package/lib/esm/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +2 -29
  40. package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +1 -2
  41. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  42. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  43. package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +18 -0
  44. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
  45. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +39 -1
  46. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
  47. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
  48. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +152 -0
  49. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +17 -1
  50. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  51. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  52. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  53. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  54. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  55. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  56. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  57. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  58. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  59. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  60. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  61. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  62. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  63. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  64. package/lib/index.d.ts +14 -10
  65. package/lib/index.js +44 -32
  66. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  67. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  68. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  69. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  70. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  71. package/lib/view/aiCfoView/aiCfoViewState.d.ts +18 -1
  72. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  73. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  74. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  75. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  76. package/lib/view/classList/fetchClassListEpic.js +8 -1
  77. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  78. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +15 -5
  79. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  80. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  81. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconExcludedAccountsEpic.d.ts +7 -0
  82. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconExcludedAccountsEpic.js +31 -0
  83. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -2
  84. package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -1
  85. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +2 -29
  86. package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.d.ts +1 -1
  87. package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +1 -2
  88. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  89. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  90. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +23 -1
  91. package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +20 -0
  92. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  93. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
  94. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +9 -2
  95. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +40 -2
  96. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  97. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +1 -0
  98. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
  99. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
  100. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +152 -0
  101. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
  102. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +19 -0
  103. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +20 -4
  104. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  105. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  106. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  107. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  108. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  109. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  110. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  111. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  112. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  113. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  114. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  115. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  116. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  117. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  118. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  119. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  120. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  121. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  122. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  123. package/package.json +1 -1
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAiCfoView = void 0;
4
+ exports.getSuggestedQuestionsForPageContext = getSuggestedQuestionsForPageContext;
5
+ const aiCfoReducer_1 = require("../../entity/aiCfo/aiCfoReducer");
4
6
  const aiCfoSelector_1 = require("../../entity/aiCfo/aiCfoSelector");
7
+ const aiCfoViewReducer_1 = require("./aiCfoViewReducer");
5
8
  const getAiCfoView = (state) => {
6
- const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, } = state.aiCfoViewState;
9
+ const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, suggestedQuestionsByPageContext, } = state.aiCfoViewState ?? aiCfoViewReducer_1.initialAiCfoViewState;
7
10
  return {
8
11
  fetchState,
9
12
  error,
@@ -15,8 +18,12 @@ const getAiCfoView = (state) => {
15
18
  uiState,
16
19
  fetchChatSessionHistoryByChatSessionId,
17
20
  masterTOSAcceptanceState,
18
- ...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState),
21
+ suggestedQuestionsByPageContext,
22
+ ...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState ?? aiCfoReducer_1.initialAiCfoState),
19
23
  version: 1,
20
24
  };
21
25
  };
22
26
  exports.getAiCfoView = getAiCfoView;
27
+ function getSuggestedQuestionsForPageContext(state, pageContext) {
28
+ return state.aiCfoViewState?.suggestedQuestionsByPageContext?.[pageContext];
29
+ }
@@ -9,6 +9,8 @@ export interface AiCfoViewUIState {
9
9
  chatHistoryNextPageToken: {
10
10
  [chatSessionId: ID]: PageTokenState;
11
11
  };
12
+ /** Last focused chat session id per side-panel host page key (e.g. `dashboard`, `reports:profit_loss`). */
13
+ chatSessionIdByPageKey: Partial<Record<string, ID>>;
12
14
  chatSessionsFirstPageFetched: boolean;
13
15
  chatSessionsNextPageToken: PageTokenState;
14
16
  cotCollapsedByQuestionAnswerId: {
@@ -20,11 +22,24 @@ export interface AiCfoViewUIState {
20
22
  scrollTop: number;
21
23
  };
22
24
  };
23
- agentId?: ID;
25
+ agentId?: ID; /**
26
+ * When set, the side panel on host routes (e.g. dashboard/reports) is scoped to this **page key**;
27
+ * session ids are mirrored into {@link chatSessionIdByPageKey}. Full `/ai-cfo/...` should clear this.
28
+ */
29
+ aiCfoSidePanelHostPageKey?: string;
24
30
  currentChatSessionId?: ID;
25
31
  lastContextMessage?: string;
26
32
  lastContextStatus?: ContextStatus;
27
33
  }
34
+ /**
35
+ * Supported `page_context` values for GET .../suggested-questions and related UI state.
36
+ */
37
+ export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details';
38
+ export interface SuggestedQuestionsForPageContext extends FetchStateAndError {
39
+ pageContext: AiCfoSuggestedQuestionsPageContext;
40
+ suggestedQuestions: string[];
41
+ generatedAt?: string;
42
+ }
28
43
  export interface AiCfoViewState extends FetchStateAndError {
29
44
  allChatSessionIds: ID[];
30
45
  createSessionAndSubmitState: FetchStateAndError;
@@ -39,5 +54,7 @@ export interface AiCfoViewState extends FetchStateAndError {
39
54
  thought: FetchStateAndError;
40
55
  }>;
41
56
  stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
57
+ /** Keyed by `page_context` query value (e.g. balance_sheet). */
58
+ suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
42
59
  uiState: AiCfoViewUIState;
43
60
  }
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../reducer';
4
+ import { ZeniAPI } from '../../../zeniAPI';
5
+ import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
6
+ export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
7
+ /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
8
+ export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchSuggestedQuestionsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../responsePayload");
7
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
8
+ /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
9
+ const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match),
10
+ // mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
11
+ // would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
12
+ (0, operators_1.mergeMap)((action) => {
13
+ const { pageContext } = action.payload;
14
+ const query = new URLSearchParams({ page_context: pageContext });
15
+ const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
16
+ return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
17
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsSuccess)({
19
+ pageContext: response.data.page_context,
20
+ generatedAt: response.data.generated_at,
21
+ suggestedQuestions: response.data.suggested_questions,
22
+ }));
23
+ }
24
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
25
+ pageContext,
26
+ error: response.status,
27
+ }));
28
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
29
+ pageContext,
30
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
31
+ }))));
32
+ }));
33
+ exports.fetchSuggestedQuestionsEpic = fetchSuggestedQuestionsEpic;
@@ -3,7 +3,7 @@ import { Status } from '../../commonStateTypes/status';
3
3
  import { View } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { ZeniDate } from '../../zeniDayJS';
5
5
  import { AuditSummary } from '../reviewCompanyView/reviewCompanyViewState';
6
- export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "reports" | "transactions";
6
+ export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "transactions" | "reports";
7
7
  export type AuditRuleEntityType = ReturnType<typeof toAuditRuleEntityType>;
8
8
  declare const toAuditRuleEntityIdType: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "uncategorized-expense" | "uncategorized-income";
9
9
  export type AuditRuleEntityIdType = ReturnType<typeof toAuditRuleEntityIdType>;
@@ -5,4 +5,4 @@ import { RootState } from '../../reducer';
5
5
  import { ZeniAPI } from '../../zeniAPI';
6
6
  import { fetchClassList, updateClassList, updateClassListFailure } from './classListReducer';
7
7
  export type ActionType = ReturnType<typeof fetchClassList> | ReturnType<typeof updateClasses> | ReturnType<typeof updateClassList> | ReturnType<typeof updateClassListFailure>;
8
- export declare const fetchClassListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
8
+ export declare const fetchClassListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -4,9 +4,16 @@ exports.fetchClassListEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const classReducer_1 = require("../../entity/class/classReducer");
7
+ const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
7
8
  const responsePayload_1 = require("../../responsePayload");
8
9
  const classListReducer_1 = require("./classListReducer");
9
- const fetchClassListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(classListReducer_1.fetchClassList.match), (0, operators_1.switchMap)((action) => {
10
+ const fetchClassListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(classListReducer_1.fetchClassList.match), (0, operators_1.withLatestFrom)(state$), (0, operators_1.switchMap)(([action, state]) => {
11
+ if (!(0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
12
+ return (0, rxjs_1.of)((0, classListReducer_1.updateClassList)({
13
+ status: (0, responsePayload_1.createZeniAPIStatus)('Success', ''),
14
+ data: { accounting_classes: [] },
15
+ }));
16
+ }
10
17
  const { isIncludeDeleted } = action.payload;
11
18
  const queryParams = isIncludeDeleted === true
12
19
  ? `?query=${encodeURIComponent(JSON.stringify({ is_include_deleted: true }))}`
@@ -57,6 +57,7 @@ export interface VendorViewSelectorView extends BankAccountSelectorView, Selecto
57
57
  deleteFileStatusById: Record<ID, FetchStateAndError | undefined>;
58
58
  hasInternationalWireTransfer: boolean;
59
59
  hasWireTransfer: boolean;
60
+ isAccountingClassesEnabled: boolean;
60
61
  loggedInUserVerification: UserVerificationState;
61
62
  ownerList: User[];
62
63
  updateFileStatusById: Record<ID, FetchStateAndError | undefined>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getVendorDetailPageView = exports.getVendorView = void 0;
4
4
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
5
+ const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
5
6
  const accountSelector_1 = require("../../../entity/account/accountSelector");
6
7
  const addressSelector_1 = require("../../../entity/address/addressSelector");
7
8
  const bankAccountSelector_1 = require("../../../entity/bankAccount/bankAccountSelector");
@@ -63,13 +64,17 @@ const getVendorView = (state, vendorIdFromUrl) => {
63
64
  ?.vendorDetailLocalData,
64
65
  supportedCountries: billPayConfigState.vendor.supportedCountries,
65
66
  };
66
- fetchState = (0, reduceFetchState_1.reduceFetchState)([
67
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
68
+ const editFetchStateList = [
67
69
  accountList,
68
- classList,
69
70
  vendorTypeListState,
70
71
  vendorViewState.editVendorStateById[vendorIdFromUrl]?.fetchStatus ??
71
72
  vendorViewReducer_1.initialState.newVendorState.fetchStatus,
72
- ]);
73
+ ];
74
+ if (isAccountingClassesEnabled) {
75
+ editFetchStateList.push(classList);
76
+ }
77
+ fetchState = (0, reduceFetchState_1.reduceFetchState)(editFetchStateList);
73
78
  }
74
79
  else {
75
80
  const basicVendorDetails = getBasicVendorDetailsForNewVendor(state, vendorViewState.newVendorState);
@@ -98,11 +103,14 @@ const getVendorView = (state, vendorIdFromUrl) => {
98
103
  if (tentativeName != null) {
99
104
  entityRecommendations = (0, recommendationSelector_1.getRecommendationsForEntity)(state, tentativeName, 'vendor');
100
105
  }
106
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
101
107
  const fetchStateList = [
102
108
  { fetchState: accountList.fetchState, error: accountList.error },
103
- { fetchState: classList.fetchState, error: classList.error },
104
109
  vendorTypeListState,
105
110
  ];
111
+ if (isAccountingClassesEnabled) {
112
+ fetchStateList.push({ fetchState: classList.fetchState, error: classList.error });
113
+ }
106
114
  if (entityRecommendations != null &&
107
115
  entityRecommendations.recommendations != null &&
108
116
  entityRecommendations.recommendations.length > 0) {
@@ -147,6 +155,7 @@ const getVendorView = (state, vendorIdFromUrl) => {
147
155
  fetchState: fetchState.fetchState,
148
156
  hasWireTransfer,
149
157
  hasInternationalWireTransfer,
158
+ isAccountingClassesEnabled: (0, tenantSelector_1.getIsAccountingClassesEnabled)(state),
150
159
  deleteFileStatusById,
151
160
  updateFileStatusById,
152
161
  loggedInUserVerification,
@@ -223,9 +232,10 @@ const getBasicVendorDetailsForNewVendor = (state, newVendor) => {
223
232
  };
224
233
  const getVendorDetailPageView = (state, vendorId, entity) => {
225
234
  const trendWithTransactions = (0, trendWithTransactionsSelector_1.getTrendWithTransactions)(state, entity, 'EntityDetail');
235
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
226
236
  const reducedFetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
227
237
  state.accountListState.byReportId.accountList,
228
- state.classListState,
238
+ ...(isAccountingClassesEnabled ? [state.classListState] : []),
229
239
  state.vendorTypeListState,
230
240
  state.ownerListState,
231
241
  state.vendorViewState.editVendorStateById[vendorId]?.fetchStatus ?? {
@@ -50,6 +50,7 @@ export interface VendorsTabVendorViewSelectorView extends SelectorView {
50
50
  accountsHierarchyList: NestedAccountHierarchyForReport[];
51
51
  classHierarchyList: NestedClassHierarchyForReport[];
52
52
  classList: ClassListSelectorView;
53
+ isAccountingClassesEnabled: boolean;
53
54
  ownerList: User[];
54
55
  vendorTypeList: VendorType[];
55
56
  vendorView?: VendorsTabVendorDetails;
@@ -6,6 +6,7 @@ const getStartOfAndEndOfTimeframeFY_1 = require("../../../commonStateTypes/fisca
6
6
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
7
7
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
8
8
  const accountSelector_1 = require("../../../entity/account/accountSelector");
9
+ const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
9
10
  const addressSelector_1 = require("../../../entity/address/addressSelector");
10
11
  const contactSelector_1 = require("../../../entity/billPay/contact/contactSelector");
11
12
  const classSelector_1 = require("../../../entity/class/classSelector");
@@ -24,6 +25,7 @@ const toVendorDetailTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_
24
25
  exports.toVendorDetailTabsType = toVendorDetailTabsType;
25
26
  const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
26
27
  const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, vendorTypeListState, addressState, addressViewState, contactState, } = state;
28
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
27
29
  const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
28
30
  const classList = (0, classListSelector_1.getClassList)(classState, classListState);
29
31
  const ownerList = (0, userSelector_1.getUsersByUserIds)(state.userState, state.ownerListState.ownerIds);
@@ -55,7 +57,7 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
55
57
  }
56
58
  fetchState = (0, reduceFetchState_1.reduceFetchState)([
57
59
  accountList,
58
- classList,
60
+ ...(isAccountingClassesEnabled ? [classList] : []),
59
61
  vendorTypeListState,
60
62
  vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]?.fetchStatus ?? {
61
63
  fetchState: 'Not-Started',
@@ -66,6 +68,7 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
66
68
  return {
67
69
  accountList: accountList,
68
70
  classList: classList,
71
+ isAccountingClassesEnabled,
69
72
  vendorTypeList: vendorTypeList,
70
73
  accountsHierarchyList,
71
74
  classHierarchyList,
@@ -107,9 +110,10 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
107
110
  ? (0, transactionListByEntitySelector_1.getTransactionListByEntityForSinglePeriod)(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
108
111
  .numberOfQuartersFetched)
109
112
  : undefined;
113
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
110
114
  const reducedFetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
111
115
  state.accountListState.byReportId.accountList,
112
- state.classListState,
116
+ ...(isAccountingClassesEnabled ? [state.classListState] : []),
113
117
  state.ownerListState,
114
118
  state.vendorTypeListState,
115
119
  state.vendorsTabVendorViewState.vendorStateById[vendorId]?.fetchStatus ?? {
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { ZeniAPI } from '../../../../zeniAPI';
5
+ import { fetchReconExcludedAccounts, fetchReconExcludedAccountsFailure, fetchReconExcludedAccountsSuccess } from '../../reducers/reconciliationViewReducer';
6
+ export type ActionType = ReturnType<typeof fetchReconExcludedAccounts> | ReturnType<typeof fetchReconExcludedAccountsSuccess> | ReturnType<typeof fetchReconExcludedAccountsFailure>;
7
+ export declare const fetchReconExcludedAccountsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchReconExcludedAccountsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
8
+ const fetchReconExcludedAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.fetchReconExcludedAccounts.match), (0, operators_1.mergeMap)((action) => {
9
+ const { accountId, exclusionReason } = action.payload;
10
+ const requestPayload = {
11
+ account_id: accountId,
12
+ exclusion_reason: exclusionReason,
13
+ };
14
+ return zeniAPI
15
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`, requestPayload)
16
+ .pipe((0, operators_1.mergeMap)((response) => {
17
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
+ return (0, rxjs_1.of)((0, reconciliationViewReducer_1.fetchReconExcludedAccountsSuccess)({
19
+ excludedAccounts: response.data.excluded_account,
20
+ }));
21
+ }
22
+ else {
23
+ return (0, rxjs_1.of)((0, reconciliationViewReducer_1.fetchReconExcludedAccountsFailure)({
24
+ error: response.status,
25
+ }));
26
+ }
27
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.fetchReconExcludedAccountsFailure)({
28
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `fetch excluded accounts REST API call errored out ${JSON.stringify(error)}`),
29
+ }))));
30
+ }));
31
+ exports.fetchReconExcludedAccountsEpic = fetchReconExcludedAccountsEpic;
@@ -5,7 +5,6 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const accountReducer_1 = require("../../../../entity/account/accountReducer");
8
- const accountReconState_1 = require("../../../../entity/accountRecon/accountReconState");
9
8
  const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
10
9
  const accountReconSelector_1 = require("../../../../entity/accountRecon/accountReconSelector");
11
10
  const fileReducer_1 = require("../../../../entity/file/fileReducer");
@@ -126,7 +125,6 @@ const prepareReviewTabLocalData = (transactionsToReview) => {
126
125
  .recommended_transactions[0].merchant_name,
127
126
  }
128
127
  : undefined,
129
- recommendedActionType: (0, accountReconState_1.toRecommendedActionCodeType)(currentTransaction.recommended_action.recommended_actions),
130
128
  };
131
129
  return {
132
130
  ...prev,
@@ -49,7 +49,6 @@ const prepareReviewTabLocalData = (transactionsToReview) => {
49
49
  .recommendedTransactions[0].merchantName,
50
50
  }
51
51
  : undefined,
52
- recommendedActionType: currentTransaction.recommendedAction.action,
53
52
  };
54
53
  return {
55
54
  ...prev,
@@ -33,10 +33,8 @@ const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pip
33
33
  reconciliationId = reconciliationData?.reconciliationId;
34
34
  updatedTransaction = reconciliationData?.transactionsToReview.find((transaction) => transaction.transactionId === transactionId);
35
35
  }
36
- const reviewAction = localData?.recommendedActionType ??
37
- updatedTransaction?.recommendedAction.action;
38
36
  const queryParam = {
39
- review_action: reviewAction,
37
+ review_action: updatedTransaction?.recommendedAction.action,
40
38
  reconciliation_id: reconciliationId ?? '',
41
39
  ref_account_id: selectedAccountId,
42
40
  ref_account_name: reconciliationData?.account.accountName,
@@ -46,7 +44,7 @@ const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pip
46
44
  if (reconciliationData != null &&
47
45
  updatedTransaction != null &&
48
46
  localData != null) {
49
- switch (reviewAction) {
47
+ switch (updatedTransaction.recommendedAction.action) {
50
48
  case 'record_expense':
51
49
  payload = getPayloadForExpenseRecord(updatedTransaction, localData);
52
50
  break;
@@ -68,9 +66,6 @@ const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pip
68
66
  case 'record_deposit':
69
67
  payload = getPayloadForDeposit(updatedTransaction, localData, entityState);
70
68
  break;
71
- case 'record_journal_entry':
72
- payload = getPayloadForJournalEntry(updatedTransaction, localData);
73
- break;
74
69
  }
75
70
  }
76
71
  payload = {
@@ -229,28 +224,6 @@ const getPayloadForBillPayment = (updatedTransaction, linkedTransaction, localDa
229
224
  vendor_name: linkedTransaction?.merchantName,
230
225
  };
231
226
  };
232
- function getPayloadForJournalEntry(updatedTransaction, localData) {
233
- return {
234
- transaction_id: updatedTransaction.transactionId,
235
- transaction_date: updatedTransaction.transactionDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
236
- transaction_memo: updatedTransaction.memo,
237
- amount: updatedTransaction.amount.amount,
238
- currency_code: updatedTransaction.amount.currencyCode,
239
- transaction_direction: updatedTransaction.transactionDirection,
240
- lines: [
241
- {
242
- class_id: localData.jeDebitClassId,
243
- posting_type: 'Debit',
244
- amount: updatedTransaction.amount.amount,
245
- },
246
- {
247
- class_id: localData.jeCreditClassId,
248
- posting_type: 'Credit',
249
- amount: updatedTransaction.amount.amount,
250
- },
251
- ],
252
- };
253
- }
254
227
  const getToastMessageSection = (updatedTransaction) => {
255
228
  if (updatedTransaction?.recommendedAction.action === 'record_bill_payment') {
256
229
  return 'recon_transaction_match';
@@ -10,4 +10,4 @@ export interface AuthParamsPayload {
10
10
  zeni_tenant_id: string;
11
11
  zeni_user_id: string;
12
12
  }
13
- export default function uploadAccountStatementIntoDocumentAI(accountType: AccountType, fileBlob: Blob, authParams: AuthParams, accountName?: string): Promise<UploadStatementDocumentAIPayload | undefined>;
13
+ export default function uploadAccountStatementIntoDocumentAI(accountType: AccountType, fileBlob: Blob, authParams: AuthParams): Promise<UploadStatementDocumentAIPayload | undefined>;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = uploadAccountStatementIntoDocumentAI;
7
7
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
8
8
  const init_1 = require("../../../../init");
9
- async function uploadAccountStatementIntoDocumentAI(accountType, fileBlob, authParams, accountName) {
9
+ async function uploadAccountStatementIntoDocumentAI(accountType, fileBlob, authParams) {
10
10
  let statementUpload;
11
11
  const urlEndPoint = `${init_1.zeniAPI.apiEndPoints.documentAIMicroServiceBaseUrl}/1.0/processors/statement`;
12
12
  const data = new FormData();
@@ -16,7 +16,6 @@ async function uploadAccountStatementIntoDocumentAI(accountType, fileBlob, authP
16
16
  ? 'reconciliation_card_statement_upload'
17
17
  : 'reconciliation_bank_statement_upload',
18
18
  purpose_id: 'reconciliation',
19
- ...(accountName != null && { account_name: accountName }),
20
19
  });
21
20
  data.append('attachment_json_0', attachment_json);
22
21
  try {
@@ -67,8 +67,8 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
67
67
  lineItem.account?.qboId !== accountLine.account.qboId &&
68
68
  Boolean(lineItem.account?.qboId);
69
69
  hasClassChanged =
70
- Boolean(lineItem.class?.qboId) &&
71
- lineItem.class?.qboId !== accountLine.class.qboId;
70
+ (lineItem.class?.qboId != null || accountLine.class?.qboId != null) &&
71
+ lineItem.class?.qboId !== accountLine.class?.qboId;
72
72
  const recommendedAccountBase = (0, saveTransactionHelper_1.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
73
73
  const recommendedClassBase = (0, saveTransactionHelper_1.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
74
74
  if (entityDetails != null &&
@@ -241,7 +241,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
241
241
  isPreFilled: true,
242
242
  };
243
243
  }
244
- if (accountLine.class.classId === '' &&
244
+ if (Boolean(accountLine.class?.classId) === false &&
245
245
  higherPreferenceRecommendation?.class != null) {
246
246
  record.class = {
247
247
  ...higherPreferenceRecommendation.class,
@@ -472,7 +472,7 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
472
472
  }
473
473
  : accountLine.account;
474
474
  record.class =
475
- accountLine.class.classId !== ''
475
+ Boolean(accountLine.class?.classId) !== false
476
476
  ? accountLine.class
477
477
  : recommendations?.[0]?.class
478
478
  ? {
@@ -1,4 +1,5 @@
1
1
  import { StatusCodeWithLabelPayload } from '../../../commonPayloadTypes/statusPayload';
2
+ import { ID } from '../../../commonStateTypes/common';
2
3
  import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
3
4
  import { AccountPayload } from '../../../entity/account/accountPayload';
4
5
  import { ReconciliationDataPayload, StatementMetaDataPayload, TransactionsToReviewPayload } from '../../../entity/accountRecon/accountReconPayload';
@@ -8,7 +9,7 @@ import { MatchedTransactionPayload } from '../../../entity/transaction/payloadTy
8
9
  import { UserPayload } from '../../../entity/user/userPayload';
9
10
  import { RootState } from '../../../reducer';
10
11
  import { ZeniAPIResponse } from '../../../responsePayload';
11
- import { BalancesLocalData, SaveReconcileDetailActionPayload } from '../types/reconciliationViewState';
12
+ import { BalancesLocalData, ExcludedAccount, SaveReconcileDetailActionPayload } from '../types/reconciliationViewState';
12
13
  export interface AccountAndPaymentAccountPayload extends AccountPayload {
13
14
  payment_account_id: string | null;
14
15
  }
@@ -54,3 +55,24 @@ export interface UploadStatementResponsePayload {
54
55
  };
55
56
  }
56
57
  export type UploadStatementResponse = ZeniAPIResponse<UploadStatementResponsePayload>;
58
+ export interface ExclusionHistoryEntry {
59
+ action: string;
60
+ at: string;
61
+ by: string;
62
+ reason: string;
63
+ }
64
+ export interface ExcludedAccountPayload {
65
+ account_id: ID;
66
+ create_time: string;
67
+ detection_signals: string[];
68
+ excluded_account_id: string;
69
+ excluded_by_user_id: string;
70
+ exclusion_history: ExclusionHistoryEntry[];
71
+ is_deleted: boolean;
72
+ update_time: string;
73
+ }
74
+ export interface ExcludedAccountsResponsePayload {
75
+ excluded_account: ExcludedAccountPayload[];
76
+ }
77
+ export type ExcludedAccountsResponse = ZeniAPIResponse<ExcludedAccountsResponsePayload>;
78
+ export declare const toExcludedAccount: (payload: ExcludedAccountPayload) => ExcludedAccount;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toExcludedAccount = void 0;
3
4
  exports.createSaveReconciliationPayloadBasedOnActionAndMethod = createSaveReconciliationPayloadBasedOnActionAndMethod;
4
5
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
6
  const accountReconPayload_1 = require("../../../entity/accountRecon/accountReconPayload");
6
7
  const reconciliationTransactionPayloads_1 = require("../../../entity/transaction/payloadTypes/reconciliationTransactionPayloads");
8
+ const zeniDayJS_1 = require("../../../zeniDayJS");
7
9
  function createSaveReconciliationPayloadBasedOnActionAndMethod(state, selectedPeriod, localData, accountReconciliationEntity, action, method) {
8
10
  const { balance, initialClearedBalance } = accountReconciliationEntity;
9
11
  const { expenseAutomationReconciliationViewState: { selectedAccountId, reconTabsState: { reconcile: { localData: { selectedTransactionIds }, }, }, }, } = state;
@@ -70,3 +72,21 @@ function createReviewTransactionPayload(accountReconciliationEntity) {
70
72
  });
71
73
  return reviewTransactionsPayload;
72
74
  }
75
+ const toExcludedAccount = (payload) => {
76
+ return {
77
+ accountId: payload.account_id,
78
+ createTime: (0, zeniDayJS_1.date)(payload.create_time),
79
+ detectionSignals: payload.detection_signals,
80
+ excludedAccountId: payload.excluded_account_id,
81
+ excludedByUserId: payload.excluded_by_user_id,
82
+ exclusionHistory: payload.exclusion_history.map((entry) => ({
83
+ action: entry.action,
84
+ at: entry.at,
85
+ by: entry.by,
86
+ reason: entry.reason,
87
+ })),
88
+ isDeleted: payload.is_deleted,
89
+ updateTime: (0, zeniDayJS_1.date)(payload.update_time),
90
+ };
91
+ };
92
+ exports.toExcludedAccount = toExcludedAccount;
@@ -5,7 +5,7 @@ import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSch
5
5
  import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
6
  import { ZeniAPIStatus } from '../../../responsePayload';
7
7
  import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
8
- import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState } from '../types/jeSchedulesViewState';
8
+ import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
9
9
  export declare const accountSettingsInitialState: AccountSettingsState;
10
10
  export declare const initialState: JESchedulesViewState;
11
11
  export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
@@ -56,7 +56,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
56
56
  accountPayload: AccountMetadataPayload[];
57
57
  }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
58
58
  status: ZeniAPIStatus;
59
- }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
59
+ }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
60
60
  localData: Partial<JEScheduleLocalData>;
61
61
  scheduledJournalEntryID: ID;
62
62
  }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod], {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
4
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
7
7
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
@@ -48,6 +48,8 @@ exports.initialState = {
48
48
  uiState: {
49
49
  searchString: '',
50
50
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
51
+ sortKey: 'startMonth',
52
+ sortOrder: 'descending',
51
53
  totalCount: 0,
52
54
  limit: 10,
53
55
  },
@@ -369,12 +371,26 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
369
371
  clearJeAccountSettingsLocalData(draft) {
370
372
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
371
373
  },
374
+ updateJESchedulesUIState(draft, action) {
375
+ if (action.payload.sortKey != null) {
376
+ draft.uiState.sortKey = action.payload.sortKey;
377
+ }
378
+ if (action.payload.sortOrder != null) {
379
+ draft.uiState.sortOrder = action.payload.sortOrder;
380
+ }
381
+ if (action.payload.searchString != null) {
382
+ draft.uiState.searchString = action.payload.searchString;
383
+ }
384
+ if (action.payload.scrollPosition != null) {
385
+ draft.uiState.scrollPosition = action.payload.scrollPosition;
386
+ }
387
+ },
372
388
  clearExpenseAutomationJESchedulesView(draft) {
373
389
  Object.assign(draft, exports.initialState);
374
390
  },
375
391
  },
376
392
  });
377
- _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
393
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
378
394
  exports.default = expenseAutomationJESchedulesView.reducer;
379
395
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
380
396
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);