@zeniai/client-epic-state 5.2.22-betaAK1 → 5.2.22-betaAM2

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 (120) hide show
  1. package/lib/entity/invoicing/creditNote/creditNotePayload.d.ts +1 -0
  2. package/lib/entity/invoicing/creditNote/creditNotePayload.js +1 -0
  3. package/lib/entity/invoicing/creditNote/creditNoteState.d.ts +1 -0
  4. package/lib/entity/invoicing/invoice/invoicePayload.d.ts +1 -0
  5. package/lib/entity/invoicing/invoice/invoicePayload.js +1 -0
  6. package/lib/entity/invoicing/invoice/invoiceState.d.ts +1 -0
  7. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -2
  8. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.d.ts +1 -0
  9. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
  10. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerState.d.ts +1 -0
  11. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.d.ts +2 -1
  12. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
  13. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionState.d.ts +2 -1
  14. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +24 -0
  15. package/lib/entity/jeSchedules/jeSchedulesPayload.js +40 -0
  16. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +26 -0
  17. package/lib/epic.d.ts +6 -1
  18. package/lib/epic.js +10 -0
  19. package/lib/esm/entity/invoicing/creditNote/creditNotePayload.js +1 -0
  20. package/lib/esm/entity/invoicing/invoice/invoicePayload.js +1 -0
  21. package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -0
  22. package/lib/esm/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +2 -1
  23. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +40 -0
  24. package/lib/esm/epic.js +10 -0
  25. package/lib/esm/index.js +6 -2
  26. package/lib/esm/reducer.js +3 -0
  27. package/lib/esm/view/expenseAutomationView/epics/accountRecon/deleteAccountStatementEpic.js +1 -3
  28. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +46 -0
  29. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
  30. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +50 -0
  31. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +44 -0
  32. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +44 -0
  33. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +28 -11
  34. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +5 -0
  36. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  37. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +60 -0
  38. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +260 -0
  39. package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
  40. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +196 -0
  41. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -0
  42. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +22 -0
  43. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -1
  44. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
  45. package/lib/esm/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +1 -0
  46. package/lib/esm/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +1 -2
  47. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
  48. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
  49. package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
  50. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
  51. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
  52. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
  53. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
  54. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
  55. package/lib/index.d.ts +9 -5
  56. package/lib/index.js +73 -47
  57. package/lib/reducer.d.ts +1 -0
  58. package/lib/reducer.js +3 -0
  59. package/lib/rootStateTypes.d.ts +2 -0
  60. package/lib/view/expenseAutomationView/epics/accountRecon/deleteAccountStatementEpic.d.ts +1 -2
  61. package/lib/view/expenseAutomationView/epics/accountRecon/deleteAccountStatementEpic.js +1 -3
  62. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
  63. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +50 -0
  64. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
  65. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
  66. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +8 -0
  67. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +54 -0
  68. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +8 -0
  69. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +48 -0
  70. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
  71. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +48 -0
  72. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
  73. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +28 -11
  74. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
  75. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +2 -1
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +5 -0
  78. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  79. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +72 -0
  80. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +65 -0
  81. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +53 -0
  82. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +264 -0
  83. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  84. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +59 -0
  85. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
  86. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
  87. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +11 -0
  88. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +208 -0
  89. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -0
  90. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +81 -0
  91. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +27 -0
  92. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
  93. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -1
  94. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -1
  95. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
  96. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -2
  97. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -1
  98. package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.d.ts +1 -0
  99. package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +1 -0
  100. package/lib/view/invoicing/invoicingOverview/invoicingOverviewState.d.ts +1 -0
  101. package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts +1 -3
  102. package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +0 -1
  103. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +0 -2
  104. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +0 -1
  105. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +2 -2
  106. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +2 -0
  107. package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +1 -0
  108. package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.d.ts +0 -1
  109. package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +0 -5
  110. package/lib/view/invoicing/subscriptionAction/subscriptionActionRequestPayload.d.ts +0 -8
  111. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.d.ts +2 -1
  112. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
  113. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
  114. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +0 -1
  115. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
  116. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +0 -1
  117. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.d.ts +2 -1
  118. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
  119. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
  120. package/package.json +38 -71
@@ -0,0 +1,72 @@
1
+ import { ID } from '../../../commonStateTypes/common';
2
+ import { TimePeriod } from '../../../commonStateTypes/timePeriod';
3
+ import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
4
+ import { ZeniAPIResponse } from '../../../responsePayload';
5
+ import { ActualMatchingTransactionSearchResult, MatchAndReverseResult } from '../types/actualMatchingViewState';
6
+ export declare function toServiceMonthFromPeriod(period: TimePeriod): string;
7
+ export interface ActualMatchingListResponsePayload {
8
+ accruals: JEOneTimeAccrualPayload[];
9
+ total: number;
10
+ limit?: number | null;
11
+ offset?: number | null;
12
+ }
13
+ export type ActualMatchingListResponse = ZeniAPIResponse<ActualMatchingListResponsePayload>;
14
+ export interface ActualMatchingAccrualSearchResponsePayload {
15
+ accruals: JEOneTimeAccrualPayload[];
16
+ total: number;
17
+ limit?: number | null;
18
+ offset?: number | null;
19
+ }
20
+ export type ActualMatchingAccrualSearchResponse = ZeniAPIResponse<ActualMatchingAccrualSearchResponsePayload>;
21
+ export interface MatchTransactionSearchQueryPayload {
22
+ page_size: number;
23
+ search_text: string;
24
+ page_token?: string | null;
25
+ }
26
+ export interface MatchTransactionSearchResultPayload {
27
+ line_id: string;
28
+ transaction_date: string;
29
+ transaction_id: ID;
30
+ transaction_integration_id: string;
31
+ transaction_type: string;
32
+ account_description?: string | null;
33
+ account_id?: ID | null;
34
+ account_name?: string | null;
35
+ accounting_class_id?: ID | null;
36
+ accounting_class_name?: string | null;
37
+ amount?: number | null;
38
+ currency_code?: string | null;
39
+ currency_symbol?: string | null;
40
+ total_amount?: number | null;
41
+ transaction_description?: string | null;
42
+ transaction_memo?: string | null;
43
+ transaction_type_name?: string | null;
44
+ vendor_id?: ID | null;
45
+ vendor_name?: string | null;
46
+ }
47
+ export interface MatchTransactionSearchResponsePayload {
48
+ transactions: MatchTransactionSearchResultPayload[];
49
+ next_page_token?: string | null;
50
+ }
51
+ export type MatchTransactionSearchResponse = ZeniAPIResponse<MatchTransactionSearchResponsePayload>;
52
+ export declare function toActualMatchingTransactionSearchResult(payload: MatchTransactionSearchResultPayload): ActualMatchingTransactionSearchResult;
53
+ export interface MatchAndReverseRequestPayload {
54
+ accrual_ids: ID[];
55
+ line_id: string;
56
+ transaction_id: ID;
57
+ transaction_integration_id: string;
58
+ transaction_type: string;
59
+ }
60
+ export interface MatchAndReverseResultPayload {
61
+ accrual_id: ID;
62
+ status: string;
63
+ reason?: string | null;
64
+ }
65
+ export interface MatchAndReverseResponsePayload {
66
+ match_batch_id: string;
67
+ results: MatchAndReverseResultPayload[];
68
+ transaction_id: ID;
69
+ transaction_integration_id: string;
70
+ }
71
+ export type MatchAndReverseResponse = ZeniAPIResponse<MatchAndReverseResponsePayload>;
72
+ export declare function toMatchAndReverseResult(payload: MatchAndReverseResultPayload): MatchAndReverseResult;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toServiceMonthFromPeriod = toServiceMonthFromPeriod;
4
+ exports.toActualMatchingTransactionSearchResult = toActualMatchingTransactionSearchResult;
5
+ exports.toMatchAndReverseResult = toMatchAndReverseResult;
6
+ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
+ const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
8
+ function toServiceMonthFromPeriod(period) {
9
+ return (0, timePeriod_1.toString)(period.start).slice(0, 7);
10
+ }
11
+ const DEFAULT_CURRENCY_CODE = 'USD';
12
+ const DEFAULT_CURRENCY_SYMBOL = '$';
13
+ function resolveMatchSearchAmount(payload) {
14
+ const raw = payload.total_amount ?? payload.amount;
15
+ if (typeof raw === 'number' && Number.isFinite(raw)) {
16
+ return raw;
17
+ }
18
+ if (typeof raw === 'string' && raw !== '') {
19
+ const parsed = Number(raw);
20
+ if (Number.isFinite(parsed)) {
21
+ return parsed;
22
+ }
23
+ }
24
+ return 0;
25
+ }
26
+ function resolveMatchSearchCurrencySymbol(payload, currencyCode) {
27
+ if (payload.currency_symbol != null && payload.currency_symbol !== '') {
28
+ return payload.currency_symbol;
29
+ }
30
+ return currencyCode === DEFAULT_CURRENCY_CODE
31
+ ? DEFAULT_CURRENCY_SYMBOL
32
+ : currencyCode;
33
+ }
34
+ function toActualMatchingTransactionSearchResult(payload) {
35
+ const currencyCode = payload.currency_code != null && payload.currency_code !== ''
36
+ ? payload.currency_code
37
+ : DEFAULT_CURRENCY_CODE;
38
+ return {
39
+ transactionId: payload.transaction_id,
40
+ transactionIntegrationId: payload.transaction_integration_id,
41
+ transactionType: payload.transaction_type,
42
+ lineId: payload.line_id,
43
+ vendorId: payload.vendor_id ?? undefined,
44
+ vendorName: payload.vendor_name ?? '',
45
+ amount: resolveMatchSearchAmount(payload),
46
+ transactionDate: payload.transaction_date,
47
+ accountId: payload.account_id ?? undefined,
48
+ accountName: payload.account_name ?? undefined,
49
+ accountDescription: payload.account_description ?? undefined,
50
+ accountingClassId: payload.accounting_class_id ?? undefined,
51
+ accountingClassName: payload.accounting_class_name ?? undefined,
52
+ currencyCode,
53
+ currencySymbol: resolveMatchSearchCurrencySymbol(payload, currencyCode),
54
+ transactionMemo: payload.transaction_memo ?? undefined,
55
+ transactionDescription: payload.transaction_description ?? undefined,
56
+ transactionTypeName: payload.transaction_type_name ?? undefined,
57
+ };
58
+ }
59
+ function toMatchAndReverseResult(payload) {
60
+ return {
61
+ accrualId: payload.accrual_id,
62
+ status: (0, actualMatchingViewState_1.toMatchAndReverseResultStatus)(payload.status),
63
+ reason: payload.reason ?? undefined,
64
+ };
65
+ }
@@ -0,0 +1,53 @@
1
+ import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
2
+ import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
3
+ import { ZeniAPIStatus } from '../../../responsePayload';
4
+ import { ActualMatchingAccrualSearchState, ActualMatchingMatchModalState, ActualMatchingTransactionSearchResult, ActualMatchingTransactionSearchState, ActualMatchingViewState, ActualMatchingViewUIState, MatchAndReverseAccrualsParams, MatchAndReverseResult } from '../types/actualMatchingViewState';
5
+ export declare const initialTransactionSearchState: ActualMatchingTransactionSearchState;
6
+ export declare const initialAccrualSearchState: ActualMatchingAccrualSearchState;
7
+ export declare const initialMatchModalState: ActualMatchingMatchModalState;
8
+ export declare const initialState: ActualMatchingViewState;
9
+ export declare const clearActualMatchingView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearActualMatchingView">, clearMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearMatchNewModal">, closeMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/closeMatchNewModal">, fetchActualMatching: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
10
+ period: TimePeriod;
11
+ refreshViewInBackground: any;
12
+ }, "expenseAutomationActualMatchingView/fetchActualMatching", never, never>, fetchActualMatchingFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
+ refreshViewInBackground: boolean;
14
+ selectedPeriod: MonthYearPeriod;
15
+ status: ZeniAPIStatus;
16
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingFailure">, fetchActualMatchingPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
17
+ period: TimePeriod;
18
+ refreshViewInBackground: any;
19
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingPage", never, never>, fetchActualMatchingSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
20
+ accruals: JEOneTimeAccrualPayload[];
21
+ refreshViewInBackground: boolean;
22
+ selectedPeriod: MonthYearPeriod;
23
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingSuccess">, matchAndReverseAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[params: MatchAndReverseAccrualsParams], MatchAndReverseAccrualsParams, "expenseAutomationActualMatchingView/matchAndReverseAccruals", never, never>, matchAndReverseAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
24
+ status: ZeniAPIStatus;
25
+ }, "expenseAutomationActualMatchingView/matchAndReverseAccrualsFailure">, matchAndReverseAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
26
+ results: MatchAndReverseResult[];
27
+ }, "expenseAutomationActualMatchingView/matchAndReverseAccrualsSuccess">, openMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/openMatchNewModal">, searchMatchAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
28
+ query: string;
29
+ pageToken?: string | null;
30
+ }], {
31
+ query: string;
32
+ pageToken: string | undefined;
33
+ }, "expenseAutomationActualMatchingView/searchMatchAccruals", never, never>, searchMatchAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
34
+ error: ZeniAPIStatus;
35
+ }, "expenseAutomationActualMatchingView/searchMatchAccrualsFailure">, searchMatchAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
36
+ append: boolean;
37
+ nextPageToken: string | null;
38
+ results: JEOneTimeAccrualPayload[];
39
+ }, "expenseAutomationActualMatchingView/searchMatchAccrualsSuccess">, searchMatchTransactions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
40
+ query: string;
41
+ pageToken?: string | null;
42
+ }], {
43
+ query: string;
44
+ pageToken: string | undefined;
45
+ }, "expenseAutomationActualMatchingView/searchMatchTransactions", never, never>, searchMatchTransactionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
46
+ error: ZeniAPIStatus;
47
+ }, "expenseAutomationActualMatchingView/searchMatchTransactionsFailure">, searchMatchTransactionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
48
+ append: boolean;
49
+ nextPageToken: string | null;
50
+ results: ActualMatchingTransactionSearchResult[];
51
+ }, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
52
+ declare const _default: import("redux").Reducer<ActualMatchingViewState>;
53
+ export default _default;
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.updateActualMatchingUIState = exports.searchMatchTransactionsSuccess = exports.searchMatchTransactionsFailure = exports.searchMatchTransactions = exports.searchMatchAccrualsSuccess = exports.searchMatchAccrualsFailure = exports.searchMatchAccruals = exports.openMatchNewModal = exports.matchAndReverseAccrualsSuccess = exports.matchAndReverseAccrualsFailure = exports.matchAndReverseAccruals = exports.fetchActualMatchingSuccess = exports.fetchActualMatchingPage = exports.fetchActualMatchingFailure = exports.fetchActualMatching = exports.closeMatchNewModal = exports.clearMatchNewModal = exports.clearActualMatchingView = exports.initialState = exports.initialMatchModalState = exports.initialAccrualSearchState = exports.initialTransactionSearchState = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
+ const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
8
+ const rootActions_1 = require("../../../rootActions");
9
+ exports.initialTransactionSearchState = {
10
+ query: '',
11
+ results: [],
12
+ fetchState: 'Not-Started',
13
+ error: undefined,
14
+ nextPageToken: null,
15
+ isLoadingMore: false,
16
+ };
17
+ exports.initialAccrualSearchState = {
18
+ query: '',
19
+ results: [],
20
+ fetchState: 'Not-Started',
21
+ error: undefined,
22
+ nextPageToken: null,
23
+ isLoadingMore: false,
24
+ };
25
+ exports.initialMatchModalState = {
26
+ isOpen: false,
27
+ transactionSearch: exports.initialTransactionSearchState,
28
+ accrualSearch: exports.initialAccrualSearchState,
29
+ confirmStatus: { fetchState: 'Not-Started', error: undefined },
30
+ };
31
+ exports.initialState = {
32
+ accrualKeysByPeriod: {},
33
+ fetchState: 'Not-Started',
34
+ error: undefined,
35
+ refreshStatus: {
36
+ fetchState: 'Not-Started',
37
+ error: undefined,
38
+ },
39
+ uiState: {
40
+ sortKey: 'date',
41
+ sortOrder: 'descending',
42
+ searchString: '',
43
+ scrollPosition: { scrollTop: 0, scrollLeft: undefined },
44
+ },
45
+ matchModal: exports.initialMatchModalState,
46
+ hasValidState() {
47
+ return this.fetchState == 'Completed';
48
+ },
49
+ };
50
+ function resetMatchModalSearches(draft) {
51
+ draft.matchModal.transactionSearch = exports.initialTransactionSearchState;
52
+ draft.matchModal.accrualSearch = exports.initialAccrualSearchState;
53
+ draft.matchModal.confirmStatus = {
54
+ fetchState: 'Not-Started',
55
+ error: undefined,
56
+ };
57
+ draft.matchModal.lastBatchResults = undefined;
58
+ }
59
+ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
60
+ name: 'expenseAutomationActualMatchingView',
61
+ initialState: exports.initialState,
62
+ reducers: {
63
+ fetchActualMatchingPage: {
64
+ prepare(period, refreshViewInBackground = false) {
65
+ return {
66
+ payload: {
67
+ period,
68
+ refreshViewInBackground,
69
+ },
70
+ };
71
+ },
72
+ reducer() {
73
+ // Epic-only fan-out.
74
+ },
75
+ },
76
+ fetchActualMatching: {
77
+ reducer(draft, action) {
78
+ const { refreshViewInBackground } = action.payload;
79
+ if (refreshViewInBackground) {
80
+ draft.refreshStatus = { fetchState: 'In-Progress', error: undefined };
81
+ }
82
+ else {
83
+ draft.fetchState = 'In-Progress';
84
+ draft.error = undefined;
85
+ }
86
+ },
87
+ prepare(period, refreshViewInBackground = false) {
88
+ return {
89
+ payload: {
90
+ period,
91
+ refreshViewInBackground,
92
+ },
93
+ };
94
+ },
95
+ },
96
+ fetchActualMatchingSuccess(draft, action) {
97
+ const { accruals, selectedPeriod, refreshViewInBackground } = action.payload;
98
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
99
+ draft.accrualKeysByPeriod[periodId] = accruals.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
100
+ if (refreshViewInBackground) {
101
+ draft.refreshStatus = { fetchState: 'Completed', error: undefined };
102
+ }
103
+ else {
104
+ draft.fetchState = 'Completed';
105
+ draft.error = undefined;
106
+ }
107
+ },
108
+ fetchActualMatchingFailure(draft, action) {
109
+ const { status, refreshViewInBackground } = action.payload;
110
+ if (refreshViewInBackground) {
111
+ draft.refreshStatus = { fetchState: 'Error', error: status };
112
+ }
113
+ else {
114
+ draft.fetchState = 'Error';
115
+ draft.error = status;
116
+ }
117
+ },
118
+ updateActualMatchingUIState(draft, action) {
119
+ if (action.payload.sortKey != null) {
120
+ draft.uiState.sortKey = action.payload.sortKey;
121
+ }
122
+ if (action.payload.sortOrder != null) {
123
+ draft.uiState.sortOrder = action.payload.sortOrder;
124
+ }
125
+ if (action.payload.searchString != null) {
126
+ draft.uiState.searchString = action.payload.searchString;
127
+ }
128
+ if (action.payload.scrollPosition != null) {
129
+ draft.uiState.scrollPosition = action.payload.scrollPosition;
130
+ }
131
+ },
132
+ openMatchNewModal(draft) {
133
+ draft.matchModal.isOpen = true;
134
+ },
135
+ closeMatchNewModal(draft) {
136
+ draft.matchModal.isOpen = false;
137
+ resetMatchModalSearches(draft);
138
+ },
139
+ clearMatchNewModal(draft) {
140
+ draft.matchModal.isOpen = false;
141
+ resetMatchModalSearches(draft);
142
+ },
143
+ searchMatchTransactions: {
144
+ reducer(draft, action) {
145
+ const { query, pageToken } = action.payload;
146
+ const isLoadMore = pageToken != null;
147
+ draft.matchModal.transactionSearch.query = query;
148
+ if (isLoadMore) {
149
+ draft.matchModal.transactionSearch.isLoadingMore = true;
150
+ }
151
+ else {
152
+ draft.matchModal.transactionSearch.isLoadingMore = false;
153
+ draft.matchModal.transactionSearch.results = [];
154
+ draft.matchModal.transactionSearch.nextPageToken = null;
155
+ draft.matchModal.transactionSearch.fetchState = 'In-Progress';
156
+ draft.matchModal.transactionSearch.error = undefined;
157
+ }
158
+ },
159
+ prepare({ query, pageToken }) {
160
+ return { payload: { query, pageToken: pageToken ?? undefined } };
161
+ },
162
+ },
163
+ searchMatchTransactionsSuccess(draft, action) {
164
+ const { append, nextPageToken, results } = action.payload;
165
+ if (append) {
166
+ const merged = [
167
+ ...draft.matchModal.transactionSearch.results,
168
+ ...results,
169
+ ];
170
+ const byKey = new Map(merged.map((result) => [
171
+ `${result.transactionId}:${result.lineId}`,
172
+ result,
173
+ ]));
174
+ draft.matchModal.transactionSearch.results = Array.from(byKey.values());
175
+ }
176
+ else {
177
+ draft.matchModal.transactionSearch.results = results;
178
+ }
179
+ draft.matchModal.transactionSearch.nextPageToken = nextPageToken;
180
+ draft.matchModal.transactionSearch.isLoadingMore = false;
181
+ draft.matchModal.transactionSearch.fetchState = 'Completed';
182
+ draft.matchModal.transactionSearch.error = undefined;
183
+ },
184
+ searchMatchTransactionsFailure(draft, action) {
185
+ draft.matchModal.transactionSearch.isLoadingMore = false;
186
+ draft.matchModal.transactionSearch.fetchState = 'Error';
187
+ draft.matchModal.transactionSearch.error = action.payload.error;
188
+ },
189
+ searchMatchAccruals: {
190
+ reducer(draft, action) {
191
+ const { query, pageToken } = action.payload;
192
+ const isLoadMore = pageToken != null;
193
+ draft.matchModal.accrualSearch.query = query;
194
+ if (isLoadMore) {
195
+ draft.matchModal.accrualSearch.isLoadingMore = true;
196
+ }
197
+ else {
198
+ draft.matchModal.accrualSearch.isLoadingMore = false;
199
+ draft.matchModal.accrualSearch.results = [];
200
+ draft.matchModal.accrualSearch.nextPageToken = null;
201
+ draft.matchModal.accrualSearch.fetchState = 'In-Progress';
202
+ draft.matchModal.accrualSearch.error = undefined;
203
+ }
204
+ },
205
+ prepare({ query, pageToken }) {
206
+ return { payload: { query, pageToken: pageToken ?? undefined } };
207
+ },
208
+ },
209
+ searchMatchAccrualsSuccess(draft, action) {
210
+ const { append, nextPageToken, results } = action.payload;
211
+ const keys = results.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
212
+ if (append) {
213
+ const merged = [...draft.matchModal.accrualSearch.results, ...keys];
214
+ draft.matchModal.accrualSearch.results = Array.from(new Set(merged));
215
+ }
216
+ else {
217
+ draft.matchModal.accrualSearch.results = keys;
218
+ }
219
+ draft.matchModal.accrualSearch.nextPageToken = nextPageToken;
220
+ draft.matchModal.accrualSearch.isLoadingMore = false;
221
+ draft.matchModal.accrualSearch.fetchState = 'Completed';
222
+ draft.matchModal.accrualSearch.error = undefined;
223
+ },
224
+ searchMatchAccrualsFailure(draft, action) {
225
+ draft.matchModal.accrualSearch.isLoadingMore = false;
226
+ draft.matchModal.accrualSearch.fetchState = 'Error';
227
+ draft.matchModal.accrualSearch.error = action.payload.error;
228
+ },
229
+ matchAndReverseAccruals: {
230
+ reducer(draft) {
231
+ draft.matchModal.confirmStatus = {
232
+ fetchState: 'In-Progress',
233
+ error: undefined,
234
+ };
235
+ },
236
+ prepare(params) {
237
+ return { payload: params };
238
+ },
239
+ },
240
+ matchAndReverseAccrualsSuccess(draft, action) {
241
+ draft.matchModal.confirmStatus = {
242
+ fetchState: 'Completed',
243
+ error: undefined,
244
+ };
245
+ draft.matchModal.lastBatchResults = action.payload.results;
246
+ },
247
+ matchAndReverseAccrualsFailure(draft, action) {
248
+ draft.matchModal.confirmStatus = {
249
+ fetchState: 'Error',
250
+ error: action.payload.status,
251
+ };
252
+ },
253
+ clearActualMatchingView(draft) {
254
+ Object.assign(draft, exports.initialState);
255
+ },
256
+ },
257
+ extraReducers: (builder) => {
258
+ builder.addCase(rootActions_1.clearAll, (draft) => {
259
+ Object.assign(draft, exports.initialState);
260
+ });
261
+ },
262
+ });
263
+ _a = expenseAutomationActualMatchingView.actions, exports.clearActualMatchingView = _a.clearActualMatchingView, exports.clearMatchNewModal = _a.clearMatchNewModal, exports.closeMatchNewModal = _a.closeMatchNewModal, exports.fetchActualMatching = _a.fetchActualMatching, exports.fetchActualMatchingFailure = _a.fetchActualMatchingFailure, exports.fetchActualMatchingPage = _a.fetchActualMatchingPage, exports.fetchActualMatchingSuccess = _a.fetchActualMatchingSuccess, exports.matchAndReverseAccruals = _a.matchAndReverseAccruals, exports.matchAndReverseAccrualsFailure = _a.matchAndReverseAccrualsFailure, exports.matchAndReverseAccrualsSuccess = _a.matchAndReverseAccrualsSuccess, exports.openMatchNewModal = _a.openMatchNewModal, exports.searchMatchAccruals = _a.searchMatchAccruals, exports.searchMatchAccrualsFailure = _a.searchMatchAccrualsFailure, exports.searchMatchAccrualsSuccess = _a.searchMatchAccrualsSuccess, exports.searchMatchTransactions = _a.searchMatchTransactions, exports.searchMatchTransactionsFailure = _a.searchMatchTransactionsFailure, exports.searchMatchTransactionsSuccess = _a.searchMatchTransactionsSuccess, exports.updateActualMatchingUIState = _a.updateActualMatchingUIState;
264
+ exports.default = expenseAutomationActualMatchingView.reducer;
@@ -136,10 +136,10 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
136
136
  }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJEScheduleTypeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<"prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue" | null, "expenseAutomationJESchedulesView/updateJEScheduleTypeFilter">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
137
137
  localData: Partial<JEScheduleLocalData>;
138
138
  scheduledJournalEntryID: ID;
139
- }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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, selectedPageTab: "schedules" | "existing_schedules"], {
139
+ }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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, selectedPageTab: "schedules" | "actual_matching" | "existing_schedules"], {
140
140
  jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`)[];
141
141
  selectedPeriod: MonthYearPeriod;
142
- selectedPageTab: "schedules" | "existing_schedules";
142
+ selectedPageTab: "schedules" | "actual_matching" | "existing_schedules";
143
143
  }, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
144
144
  localData: Partial<NewScheduleLocalDataFixedAssets>;
145
145
  scheduleType: "fixed_assets" | "prepaid_expenses";
@@ -0,0 +1,59 @@
1
+ import { FetchStateAndError } from '../../../commonStateTypes/common';
2
+ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
+ import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
4
+ import { ZeniDate } from '../../../zeniDayJS';
5
+ import { ActualMatchingTransactionSearchResult, ActualMatchingViewUIState, MatchAndReverseResult } from '../types/actualMatchingViewState';
6
+ export type ActualMatchingRowKind = 'auto_reversed' | 'pending_review' | 'manually_reversed';
7
+ export interface ActualMatchingRow extends JEOneTimeAccrual {
8
+ kind: ActualMatchingRowKind;
9
+ reversalDate?: ZeniDate;
10
+ }
11
+ export interface ActualMatchingKpiSummary {
12
+ ai: {
13
+ count: number;
14
+ };
15
+ autoReversed: {
16
+ amount: number;
17
+ count: number;
18
+ };
19
+ manual: {
20
+ count: number;
21
+ };
22
+ pendingReview: {
23
+ amount: number;
24
+ count: number;
25
+ };
26
+ totalThisClose: {
27
+ amount: number;
28
+ count: number;
29
+ };
30
+ }
31
+ export interface ActualMatchingMatchModalView {
32
+ accrualSearch: {
33
+ fetchState: FetchStateAndError;
34
+ isLoadingMore: boolean;
35
+ nextPageToken: string | null;
36
+ query: string;
37
+ results: JEOneTimeAccrual[];
38
+ };
39
+ confirmStatus: FetchStateAndError;
40
+ isOpen: boolean;
41
+ transactionSearch: {
42
+ fetchState: FetchStateAndError;
43
+ isLoadingMore: boolean;
44
+ nextPageToken: string | null;
45
+ query: string;
46
+ results: ActualMatchingTransactionSearchResult[];
47
+ };
48
+ lastBatchResults?: MatchAndReverseResult[];
49
+ }
50
+ export interface ExpenseAutomationActualMatchingViewSelector extends SelectorView {
51
+ autoReversed: ActualMatchingRow[];
52
+ hasLoadedForSelectedPeriod: boolean;
53
+ kpiSummary: ActualMatchingKpiSummary;
54
+ manuallyReversed: ActualMatchingRow[];
55
+ matchModal: ActualMatchingMatchModalView;
56
+ pendingReview: ActualMatchingRow[];
57
+ refreshStatus: FetchStateAndError;
58
+ uiState: ActualMatchingViewUIState;
59
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,6 +6,7 @@ import { MonthEndCloseChecksView } from '../../../view/monthEndCloseChecksView/m
6
6
  import { CompanyMonthEndReportSelectorView } from '../../companyMonthEndReportView/companyMonthEndReportViewSelector';
7
7
  import { ExpenseAutomationViewType } from '../expenseAutomationViewState';
8
8
  import { TransactionsTab } from '../types/transactionsViewState';
9
+ import { ExpenseAutomationActualMatchingViewSelector } from './actualMatchingViewSelectorTypes';
9
10
  import { ExpenseAutomationFluxAnalysisViewSelector } from './fluxAnalysisViewSelectorTypes';
10
11
  import { ExpenseAutomationJESchedulesViewSelector } from './jeSchedulesSelectorTypes';
11
12
  import { ExpenseAutomationMissingReceiptsViewSelector } from './missingReceiptsSelectorTypes';
@@ -21,6 +22,7 @@ export interface ExpenseAutomationStepDetails {
21
22
  title: string;
22
23
  }
23
24
  export interface ExpenseAutomationViewSelector extends SelectorView {
25
+ actualMatching: ExpenseAutomationActualMatchingViewSelector;
24
26
  allSteps: ExpenseAutomationStepDetails[];
25
27
  completionStatus: CompletionStatusType;
26
28
  currentSelectedView: ExpenseAutomationViewType;
@@ -0,0 +1,11 @@
1
+ import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
2
+ import { RootState } from '../../../rootStateTypes';
3
+ import { ZeniDate } from '../../../zeniDayJS';
4
+ import { ExpenseAutomationActualMatchingViewSelector } from '../selectorTypes/actualMatchingViewSelectorTypes';
5
+ export declare function isAutoReversedAccrual(accrual: JEOneTimeAccrual): boolean;
6
+ export declare function isManuallyReversedAccrual(accrual: JEOneTimeAccrual): boolean;
7
+ export declare function isPendingReviewAccrual(accrual: JEOneTimeAccrual): boolean;
8
+ export declare function getClearedMatchedAmount(accrual: JEOneTimeAccrual): number | undefined;
9
+ export declare function getActualMatchingAmount(accrual: JEOneTimeAccrual): number;
10
+ export declare function getActualMatchingReversalDate(accrual: JEOneTimeAccrual): ZeniDate | undefined;
11
+ export declare function getExpenseAutomationActualMatchingView(state: RootState): ExpenseAutomationActualMatchingViewSelector;