@zeniai/client-epic-state 5.2.69 → 5.2.70

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 (161) hide show
  1. package/lib/entity/actualMatching/actualMatchingReducer.d.ts +1 -3
  2. package/lib/entity/actualMatching/actualMatchingReducer.js +2 -11
  3. package/lib/entity/aiCfo/aiCfoState.d.ts +2 -2
  4. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  5. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  6. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  7. package/lib/entity/invoicing/plan/planPayload.d.ts +40 -0
  8. package/lib/entity/invoicing/plan/planPayload.js +51 -0
  9. package/lib/entity/invoicing/plan/planReducer.d.ts +14 -0
  10. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +21 -20
  11. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.d.ts → plan/planSelector.d.ts} +6 -5
  12. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +12 -12
  13. package/lib/entity/invoicing/plan/planState.d.ts +43 -0
  14. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.d.ts → product/productPayload.d.ts} +6 -44
  15. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +6 -50
  16. package/lib/entity/invoicing/product/productReducer.d.ts +9 -0
  17. package/lib/entity/invoicing/product/productReducer.js +50 -0
  18. package/lib/entity/invoicing/product/productSelector.d.ts +4 -0
  19. package/lib/entity/invoicing/product/productSelector.js +17 -0
  20. package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.d.ts → product/productState.d.ts} +6 -42
  21. package/lib/entity/invoicing/product/productState.js +2 -0
  22. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -1
  23. package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -1
  24. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -1
  25. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
  26. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  27. package/lib/entity/snackbar/snackbarTypes.js +0 -3
  28. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
  29. package/lib/epic.d.ts +2 -4
  30. package/lib/epic.js +1 -5
  31. package/lib/esm/entity/actualMatching/actualMatchingReducer.js +1 -9
  32. package/lib/esm/entity/invoicing/plan/planPayload.js +47 -0
  33. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +20 -19
  34. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +8 -8
  35. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +3 -46
  36. package/lib/esm/entity/invoicing/product/productReducer.js +43 -0
  37. package/lib/esm/entity/invoicing/product/productSelector.js +10 -0
  38. package/lib/esm/entity/invoicing/product/productState.js +1 -0
  39. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -1
  40. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
  41. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
  42. package/lib/esm/epic.js +1 -5
  43. package/lib/esm/index.js +11 -9
  44. package/lib/esm/reducer.js +7 -4
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +2 -4
  46. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +13 -26
  47. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +23 -2
  48. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
  49. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +38 -89
  50. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -66
  51. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -15
  52. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +1 -9
  53. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +1 -1
  54. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
  55. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  56. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  57. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  58. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
  59. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  60. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +1 -5
  61. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
  62. package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +1 -8
  63. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  64. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  65. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +4 -4
  66. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +9 -18
  67. package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
  68. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
  69. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
  70. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
  71. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +1 -21
  72. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
  73. package/lib/index.d.ts +16 -13
  74. package/lib/index.js +60 -65
  75. package/lib/reducer.d.ts +2 -1
  76. package/lib/reducer.js +7 -4
  77. package/lib/rootStateTypes.d.ts +5 -3
  78. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +2 -2
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +1 -3
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +11 -24
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +22 -1
  82. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  83. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
  84. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +1 -12
  85. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +8 -19
  86. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +39 -90
  87. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  88. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +8 -20
  89. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +4 -7
  90. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -69
  91. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +4 -20
  92. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +1 -18
  93. package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -3
  94. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +0 -8
  95. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
  96. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +2 -2
  97. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +9 -8
  98. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +2 -2
  99. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
  100. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.d.ts +2 -2
  101. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  102. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +4 -3
  103. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.d.ts +2 -2
  104. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  105. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.d.ts +3 -2
  106. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  107. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +3 -2
  108. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
  109. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  110. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +1 -3
  111. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +2 -6
  112. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +2 -2
  113. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -3
  114. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
  115. package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +1 -3
  116. package/lib/view/invoicing/invoiceList/invoiceListReducer.js +2 -9
  117. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogListPageEpic.d.ts +2 -2
  118. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.d.ts +2 -2
  119. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  120. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.d.ts +2 -2
  121. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  122. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewPayload.d.ts +3 -3
  123. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +5 -4
  124. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +4 -4
  125. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +1 -1
  126. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  127. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +1 -1
  128. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
  129. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
  130. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +3 -12
  131. package/lib/view/invoicing/settingsView/settingsViewSelector.js +8 -17
  132. package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
  133. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
  134. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -3
  135. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
  136. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -4
  137. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  138. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +5 -5
  139. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  140. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +2 -2
  141. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -1
  142. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
  143. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
  144. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +2 -22
  145. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -1
  146. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
  147. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
  148. package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +1 -2
  149. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +2 -2
  150. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +5 -5
  151. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +2 -2
  152. package/package.json +1 -1
  153. package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +0 -12
  154. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -50
  155. package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -37
  156. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +0 -10
  157. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -54
  158. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +0 -8
  159. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -41
  160. /package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
  161. /package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
@@ -16,9 +16,9 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
16
16
  localData: NewOneTimeAccrualLocalData;
17
17
  }, "expenseAutomationJESchedulesView/createOneTimeAccrual", never, never>, createOneTimeAccrualFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
18
18
  status: ZeniAPIStatus;
19
- }, "expenseAutomationJESchedulesView/createOneTimeAccrualFailure">, createOneTimeAccrualSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/createOneTimeAccrualSuccess">, ignoreOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, reason: "no_activity" | "paused" | "too_small" | "need_invoice" | "other_ignore", note?: string | undefined], {
19
+ }, "expenseAutomationJESchedulesView/createOneTimeAccrualFailure">, createOneTimeAccrualSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/createOneTimeAccrualSuccess">, ignoreOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, reason: "paused" | "no_activity" | "too_small" | "need_invoice" | "other_ignore", note?: string | undefined], {
20
20
  accrualId: string;
21
- reason: "no_activity" | "paused" | "too_small" | "need_invoice" | "other_ignore";
21
+ reason: "paused" | "no_activity" | "too_small" | "need_invoice" | "other_ignore";
22
22
  note: string | undefined;
23
23
  }, "expenseAutomationJESchedulesView/ignoreOneTimeAccrual", never, never>, oneTimeAccrualActionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
24
24
  accrualId: ID;
@@ -43,9 +43,6 @@ export interface ActualMatchingKpiSummary {
43
43
  count: number;
44
44
  estimatedMinutesToClear: number;
45
45
  };
46
- reversed: {
47
- count: number;
48
- };
49
46
  variance: {
50
47
  averagePercentPerMatch: number;
51
48
  netAmount: number;
@@ -70,30 +67,21 @@ export interface ActualMatchingMatchModalView {
70
67
  results: ActualMatchingTransactionSearchResult[];
71
68
  };
72
69
  lastBatchResults?: MatchAndReverseResult[];
73
- }
74
- export interface ActualMatchingMatchView {
75
- accruedAmount: Amount;
76
- actualAmount: Amount;
77
- kind: ActualMatchingRowKind;
78
- matchId: string;
79
- members: JEOneTimeAccrual[];
80
- transactionIntegrationId: ID;
81
- transactionType: string;
82
- leftovers?: JEOneTimeAccrual[];
83
- matchShape?: string;
84
- matchTier?: string;
85
- transactionDate?: string;
86
- vendorId?: ID;
87
- vendorName?: string;
70
+ openedFromMatchId?: string;
71
+ prefill?: {
72
+ selectedAccrualIds: ID[];
73
+ actualAmount?: number;
74
+ consumedLineIds?: ID[];
75
+ matchedLineId?: string;
76
+ matchedTransactionId?: string;
77
+ };
88
78
  }
89
79
  export interface ExpenseAutomationActualMatchingViewSelector extends SelectorView {
90
80
  hasLoadedForSelectedPeriod: boolean;
91
- ignoreStatusByMatchId: Record<string, FetchStateAndError>;
92
81
  kpiSummary: ActualMatchingKpiSummary;
93
82
  matchModal: ActualMatchingMatchModalView;
94
83
  pendingReview: ActualMatchingRow[];
95
84
  refreshStatus: FetchStateAndError;
96
85
  reversed: ActualMatchingRow[];
97
86
  uiState: ActualMatchingViewUIState;
98
- undoReversalStatusByMatchId: Record<string, FetchStateAndError>;
99
87
  }
@@ -1,12 +1,13 @@
1
1
  import { FetchStateAndError } from '../../../commonStateTypes/common';
2
2
  import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
3
3
  import { DisplayCurrencyFallback } from '../../../entity/actualMatching/actualMatchingPayload';
4
+ import { ActualMatchingMatch } from '../../../entity/actualMatching/actualMatchingState';
4
5
  import { ActualMatchingMatchId } from '../../../entity/actualMatching/actualMatchingTypes';
5
6
  import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
6
7
  import { JEOneTimeAccrualMatchSuggestion } from '../../../entity/jeSchedules/jeSchedulesState';
7
8
  import { RootState } from '../../../rootStateTypes';
8
9
  import { ZeniDate } from '../../../zeniDayJS';
9
- import { ActualMatchingKpiSummary, ActualMatchingMatchView, ActualMatchingRow, ActualMatchingRowKind, ExpenseAutomationActualMatchingViewSelector } from '../selectorTypes/actualMatchingViewSelectorTypes';
10
+ import { ActualMatchingKpiSummary, ActualMatchingRow, ActualMatchingRowKind, ExpenseAutomationActualMatchingViewSelector } from '../selectorTypes/actualMatchingViewSelectorTypes';
10
11
  import { MatchAndReverseResult, UndoReversalResult } from '../types/actualMatchingViewState';
11
12
  export declare function getSelectedMonthYearForCurrentTenant(state: RootState): MonthYearPeriod | undefined;
12
13
  export declare function getTenantDisplayCurrency(state: RootState): DisplayCurrencyFallback | undefined;
@@ -26,16 +27,12 @@ export declare function getActualMatchingReversalDate(accrual: JEOneTimeAccrual,
26
27
  export declare function buildActualMatchingKpiSummary(rows: ActualMatchingRow[], displayCurrencyCode?: string): ActualMatchingKpiSummary;
27
28
  export interface ExpenseAutomationActualMatchingMatchView {
28
29
  detailFetchState: FetchStateAndError;
29
- ignoreStatus: FetchStateAndError;
30
30
  refreshStatus: FetchStateAndError;
31
31
  undoReversalStatus: FetchStateAndError;
32
32
  lastMatchResults?: MatchAndReverseResult[];
33
33
  lastUndoResults?: UndoReversalResult[];
34
- match?: ActualMatchingMatchView;
34
+ match?: ActualMatchingMatch;
35
35
  }
36
36
  export declare function getExpenseAutomationActualMatchingMatchView(state: RootState, matchId: ActualMatchingMatchId): ExpenseAutomationActualMatchingMatchView;
37
- export declare function getCloseMatchAfterUndo(state: RootState): ActualMatchingMatchId | undefined;
38
- export declare function getCloseMatchAfterUndoMatchId(state: RootState): ActualMatchingMatchId | undefined;
39
- export declare function getCloseMatchAfterIgnoreMatchId(state: RootState): ActualMatchingMatchId | undefined;
40
- export declare function getActualMatchingMatchModalConfirmStatus(state: RootState, matchId?: ActualMatchingMatchId): FetchStateAndError;
37
+ export declare function getCloseMatchAfterUndo(state: RootState): boolean;
41
38
  export declare function getExpenseAutomationActualMatchingView(state: RootState): ExpenseAutomationActualMatchingViewSelector;
@@ -16,18 +16,15 @@ exports.getActualMatchingReversalDate = getActualMatchingReversalDate;
16
16
  exports.buildActualMatchingKpiSummary = buildActualMatchingKpiSummary;
17
17
  exports.getExpenseAutomationActualMatchingMatchView = getExpenseAutomationActualMatchingMatchView;
18
18
  exports.getCloseMatchAfterUndo = getCloseMatchAfterUndo;
19
- exports.getCloseMatchAfterUndoMatchId = getCloseMatchAfterUndoMatchId;
20
- exports.getCloseMatchAfterIgnoreMatchId = getCloseMatchAfterIgnoreMatchId;
21
- exports.getActualMatchingMatchModalConfirmStatus = getActualMatchingMatchModalConfirmStatus;
22
19
  exports.getExpenseAutomationActualMatchingView = getExpenseAutomationActualMatchingView;
23
20
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
24
- const toolkit_1 = require("@reduxjs/toolkit");
25
21
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
26
22
  const actualMatchingSelector_1 = require("../../../entity/actualMatching/actualMatchingSelector");
27
23
  const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
28
24
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
29
25
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
30
26
  const zeniDayJS_1 = require("../../../zeniDayJS");
27
+ const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
31
28
  function getSelectedMonthYearForCurrentTenant(state) {
32
29
  const tenantId = (0, tenantSelector_1.getCurrentTenant)(state)?.tenantId;
33
30
  if (tenantId == null) {
@@ -56,6 +53,27 @@ function toMatchModalAccrual(member) {
56
53
  jeOneTimeAccrualKey: (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(member.accrualId),
57
54
  };
58
55
  }
56
+ function uniqueMatchModalAccruals(pinned, searched) {
57
+ const byId = new Map();
58
+ pinned.forEach((row) => byId.set(row.accrualId, row));
59
+ searched.forEach((row) => {
60
+ if (!byId.has(row.accrualId)) {
61
+ byId.set(row.accrualId, row);
62
+ }
63
+ });
64
+ return Array.from(byId.values());
65
+ }
66
+ function uniqueTransactionSearchResults(pinned, searched) {
67
+ const byKey = new Map();
68
+ pinned.forEach((row) => byKey.set((0, actualMatchingViewState_1.actualMatchingTransactionLineKey)(row.transactionType, row.transactionIntegrationId, row.lineId), row));
69
+ searched.forEach((row) => {
70
+ const key = (0, actualMatchingViewState_1.actualMatchingTransactionLineKey)(row.transactionType, row.transactionIntegrationId, row.lineId);
71
+ if (!byKey.has(key)) {
72
+ byKey.set(key, row);
73
+ }
74
+ });
75
+ return Array.from(byKey.values());
76
+ }
59
77
  function parseActualMatchingMatchId(matchId) {
60
78
  const separator = matchId.indexOf(':');
61
79
  if (separator <= 0 || separator === matchId.length - 1) {
@@ -228,7 +246,6 @@ function emptyKpiSummary() {
228
246
  actualsReceived: { count: 0, expectedCount: 0, vendorsPending: 0 },
229
247
  autoReversed: { count: 0, percent: 0, clearedAmount: 0 },
230
248
  pendingReview: { count: 0, amount: 0, estimatedMinutesToClear: 0 },
231
- reversed: { count: 0 },
232
249
  variance: { percent: 0, averagePercentPerMatch: 0, netAmount: 0 },
233
250
  };
234
251
  }
@@ -284,7 +301,6 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
284
301
  }
285
302
  const autoReversed = kpiRows.filter((row) => row.kind === 'auto_reversed');
286
303
  const pendingReview = kpiRows.filter((row) => row.kind === 'pending_review');
287
- const reversed = kpiRows.filter((row) => isReversedMatchKind(row.kind));
288
304
  const receivedCount = kpiRows.length;
289
305
  const rowsWithActual = kpiRows.filter((row) => row.actualAmount?.amount != null);
290
306
  const accruedTotal = rowsWithActual.reduce((sum, row) => sum + (row.accruedAmount?.amount ?? row.estimatedAmount.amount), 0);
@@ -310,9 +326,6 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
310
326
  amount: sumRowAmounts(pendingReview, displayCurrencyCode),
311
327
  estimatedMinutesToClear: pendingReview.length * ESTIMATED_MINUTES_PER_PENDING_MATCH,
312
328
  },
313
- reversed: {
314
- count: reversed.length,
315
- },
316
329
  variance: {
317
330
  percent: accruedTotal === 0
318
331
  ? 0
@@ -325,61 +338,23 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
325
338
  },
326
339
  };
327
340
  }
328
- function toActualMatchingMatchView(match) {
341
+ function getExpenseAutomationActualMatchingMatchView(state, matchId) {
342
+ const view = state.expenseAutomationActualMatchingViewState;
329
343
  return {
330
- ...match,
331
- members: match.members.map(toMatchModalAccrual),
332
- leftovers: match.leftovers == null
333
- ? undefined
334
- : match.leftovers.map(toMatchModalAccrual),
344
+ match: (0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId),
345
+ detailFetchState: view.detailFetchStateByMatchId[matchId] ?? NOT_STARTED,
346
+ refreshStatus: view.detailRefreshStatusByMatchId[matchId] ?? NOT_STARTED,
347
+ undoReversalStatus: view.undoReversalStatusByMatchId[matchId] ?? NOT_STARTED,
348
+ lastMatchResults: view.lastMatchResultsByMatchId?.[matchId],
349
+ lastUndoResults: view.lastUndoResultsByMatchId?.[matchId],
335
350
  };
336
351
  }
337
- const EMPTY_ACTUAL_MATCHING_ROWS = [];
338
- const matchViewSelectorById = new Map();
339
- function getExpenseAutomationActualMatchingMatchView(state, matchId) {
340
- let selector = matchViewSelectorById.get(matchId);
341
- if (selector == null) {
342
- selector = (0, toolkit_1.createSelector)([
343
- (root) => root.expenseAutomationActualMatchingViewState.detailFetchStateByMatchId[matchId] ?? NOT_STARTED,
344
- (root) => root.expenseAutomationActualMatchingViewState.ignoreStatusByMatchId[matchId] ?? NOT_STARTED,
345
- (root) => root.expenseAutomationActualMatchingViewState.lastMatchResultsByMatchId?.[matchId],
346
- (root) => root.expenseAutomationActualMatchingViewState.lastUndoResultsByMatchId?.[matchId],
347
- (root) => root.expenseAutomationActualMatchingViewState.detailRefreshStatusByMatchId[matchId] ?? NOT_STARTED,
348
- (root) => root.expenseAutomationActualMatchingViewState.undoReversalStatusByMatchId[matchId] ?? NOT_STARTED,
349
- (root) => (0, actualMatchingSelector_1.getActualMatchingMatchById)(root.actualMatchingState, matchId),
350
- ], (detailFetchState, ignoreStatus, lastMatchResults, lastUndoResults, refreshStatus, undoReversalStatus, match) => ({
351
- detailFetchState,
352
- ignoreStatus,
353
- lastMatchResults,
354
- lastUndoResults,
355
- match: match == null ? undefined : toActualMatchingMatchView(match),
356
- refreshStatus,
357
- undoReversalStatus,
358
- }));
359
- matchViewSelectorById.set(matchId, selector);
360
- }
361
- return selector(state);
362
- }
363
352
  function getCloseMatchAfterUndo(state) {
364
- return state.expenseAutomationActualMatchingViewState
365
- .closeMatchAfterUndoMatchIds[0];
366
- }
367
- function getCloseMatchAfterUndoMatchId(state) {
368
- return getCloseMatchAfterUndo(state);
369
- }
370
- function getCloseMatchAfterIgnoreMatchId(state) {
371
- return state.expenseAutomationActualMatchingViewState
372
- .closeMatchAfterIgnoreMatchIds[0];
373
- }
374
- function getActualMatchingMatchModalConfirmStatus(state, matchId) {
375
- if (matchId != null && matchId !== '') {
376
- return (state.expenseAutomationActualMatchingViewState.confirmStatusByMatchId[matchId] ?? NOT_STARTED);
377
- }
378
- return state.expenseAutomationActualMatchingViewState.matchModal.confirmStatus;
353
+ return state.expenseAutomationActualMatchingViewState.closeMatchAfterUndo;
379
354
  }
380
355
  function getExpenseAutomationActualMatchingView(state) {
381
356
  const { expenseAutomationActualMatchingViewState } = state;
382
- const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, ignoreStatusByMatchId, undoReversalStatusByMatchId, } = expenseAutomationActualMatchingViewState;
357
+ const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, } = expenseAutomationActualMatchingViewState;
383
358
  const selectedPeriod = getSelectedMonthYearForCurrentTenant(state);
384
359
  const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : undefined;
385
360
  const matchIds = monthYearPeriodId != null ? matchIdsByPeriod[monthYearPeriodId] : undefined;
@@ -389,18 +364,38 @@ function getExpenseAutomationActualMatchingView(state) {
389
364
  .filter((match) => match.members.length > 0)
390
365
  .map(toActualMatchingRow);
391
366
  const rows = allRows.filter((row) => matchesSearch(row, uiState.searchString));
392
- const includePendingReview = uiState.statusFilter !== 'reversed';
393
- const includeReversed = uiState.statusFilter !== 'pending_review';
394
- const reversed = includeReversed
395
- ? sortActualMatchingRows(rows.filter((row) => isReversedMatchKind(row.kind)), uiState)
396
- : EMPTY_ACTUAL_MATCHING_ROWS;
397
- const pendingReview = includePendingReview
398
- ? sortActualMatchingRows(rows.filter((row) => row.kind === 'pending_review'), uiState)
399
- : EMPTY_ACTUAL_MATCHING_ROWS;
367
+ const reversed = sortActualMatchingRows(rows.filter((row) => isReversedMatchKind(row.kind)), uiState);
368
+ const pendingReview = sortActualMatchingRows(rows.filter((row) => row.kind === 'pending_review'), uiState);
400
369
  const kpiSummary = buildActualMatchingKpiSummary(allRows, getTenantDisplayCurrency(state)?.currencyCode);
401
370
  const searchedAccruals = matchModal.accrualSearch.results
402
371
  .map((key) => (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(key, state.jeSchedulesState))
403
372
  .filter((accrual) => accrual != null);
373
+ const openedMatch = matchModal.openedFromMatchId != null
374
+ ? (0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchModal.openedFromMatchId)
375
+ : undefined;
376
+ const pinnedAccruals = [
377
+ ...(openedMatch?.members ?? []),
378
+ ...(openedMatch?.leftovers ?? []),
379
+ ].map(toMatchModalAccrual);
380
+ const firstMember = openedMatch?.members[0];
381
+ const cleared = firstMember?.cleared;
382
+ const suggestion = firstMember?.matchSuggestion;
383
+ const stamp = cleared ?? suggestion;
384
+ const consumedLineIds = cleared?.consumedLineIds;
385
+ const prefill = openedMatch == null
386
+ ? undefined
387
+ : {
388
+ selectedAccrualIds: [
389
+ ...openedMatch.members.map((member) => member.accrualId),
390
+ ...(openedMatch.leftovers ?? []).map((leftover) => leftover.accrualId),
391
+ ],
392
+ actualAmount: openedMatch.actualAmount.amount,
393
+ matchedTransactionId: stamp?.matchedTransactionId,
394
+ matchedLineId: cleared == null ? suggestion?.matchedLineId : undefined,
395
+ ...(consumedLineIds != null && consumedLineIds.length > 0
396
+ ? { consumedLineIds }
397
+ : {}),
398
+ };
404
399
  // `fetchState` is a flat slice field that survives a period switch. Until this
405
400
  // month's ids land, leftover Completed/Error is the previous month. Report
406
401
  // Not-Started so chrome matches Review's "cache slot missing" skeleton, not
@@ -418,16 +413,16 @@ function getExpenseAutomationActualMatchingView(state) {
418
413
  kpiSummary,
419
414
  uiState,
420
415
  refreshStatus,
421
- ignoreStatusByMatchId,
422
- undoReversalStatusByMatchId,
423
416
  hasLoadedForSelectedPeriod: matchIds != null,
424
417
  matchModal: {
425
418
  isOpen: matchModal.isOpen,
419
+ openedFromMatchId: matchModal.openedFromMatchId,
420
+ prefill,
426
421
  confirmStatus: matchModal.confirmStatus,
427
422
  lastBatchResults: matchModal.lastBatchResults,
428
423
  transactionSearch: {
429
424
  query: matchModal.transactionSearch.query,
430
- results: matchModal.transactionSearch.results,
425
+ results: uniqueTransactionSearchResults(matchModal.pinnedTransactionResults, matchModal.transactionSearch.results),
431
426
  fetchState: {
432
427
  fetchState: matchModal.transactionSearch.fetchState,
433
428
  error: matchModal.transactionSearch.error,
@@ -437,7 +432,7 @@ function getExpenseAutomationActualMatchingView(state) {
437
432
  },
438
433
  accrualSearch: {
439
434
  query: matchModal.accrualSearch.query,
440
- results: searchedAccruals,
435
+ results: uniqueMatchModalAccruals(pinnedAccruals, searchedAccruals),
441
436
  fetchState: {
442
437
  fetchState: matchModal.accrualSearch.fetchState,
443
438
  error: matchModal.accrualSearch.error,
@@ -5,8 +5,6 @@ import { ActualMatchingMatchId } from '../../../entity/actualMatching/actualMatc
5
5
  import { JEOneTimeAccrualKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
6
  export declare const toActualMatchingSortKey: (v: string) => "type" | "date" | "vendor" | "category" | "class" | "amount" | "variance" | "lifecycle" | "service" | "accrued" | "actual";
7
7
  export type ActualMatchingSortKey = ReturnType<typeof toActualMatchingSortKey>;
8
- export declare const toActualMatchingStatusFilter: (v: string) => "pending_review" | "reversed" | "all";
9
- export type ActualMatchingStatusFilter = ReturnType<typeof toActualMatchingStatusFilter>;
10
8
  export declare const MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
11
9
  export declare const MATCH_ACCRUAL_SEARCH_LIMIT = 50;
12
10
  export declare const MATCH_SEARCH_DEBOUNCE_MS = 300;
@@ -20,12 +18,6 @@ export interface ActualMatchingViewUIState {
20
18
  searchString: string;
21
19
  sortKey: ActualMatchingSortKey;
22
20
  sortOrder: SortOrder;
23
- /**
24
- * List-only filter. `all` shows both groups; `pending_review` / `reversed`
25
- * empty the other group (`reversed` includes auto and manual). KPI summary
26
- * stays on the unfiltered period.
27
- */
28
- statusFilter: ActualMatchingStatusFilter;
29
21
  }
30
22
  /**
31
23
  * Sibling of Missing Receipts `MatchCandidate`. Confirm needs `lineId` and
@@ -77,14 +69,6 @@ export interface UndoReversalAccrualsParams {
77
69
  accrualIds: ID[];
78
70
  matchId: ActualMatchingMatchId;
79
71
  }
80
- export declare const toActualMatchingIgnoreReasonType: (v: string) => "other_ignore" | "already_handled" | "amount_off" | "wrong_period" | "wrong_bill";
81
- export type ActualMatchingIgnoreReasonType = ReturnType<typeof toActualMatchingIgnoreReasonType>;
82
- export declare const ALL_ACTUAL_MATCHING_IGNORE_REASONS: readonly ActualMatchingIgnoreReasonType[];
83
- export interface IgnoreActualMatchingSuggestionParams {
84
- matchId: ActualMatchingMatchId;
85
- reason: ActualMatchingIgnoreReasonType;
86
- note?: string;
87
- }
88
72
  export interface ActualMatchingTransactionSearchState extends FetchStateAndError {
89
73
  isLoadingMore: boolean;
90
74
  nextPageToken: string | null;
@@ -100,18 +84,18 @@ export interface ActualMatchingAccrualSearchState extends FetchStateAndError {
100
84
  export interface ActualMatchingMatchModalState {
101
85
  accrualSearch: ActualMatchingAccrualSearchState;
102
86
  confirmStatus: FetchStateAndError;
87
+ didPinPrefillTransactions: boolean;
103
88
  isOpen: boolean;
89
+ pinnedTransactionResults: ActualMatchingTransactionSearchResult[];
104
90
  transactionSearch: ActualMatchingTransactionSearchState;
105
91
  lastBatchResults?: MatchAndReverseResult[];
92
+ openedFromMatchId?: ActualMatchingMatchId;
106
93
  }
107
94
  export declare function actualMatchingTransactionLineKey(transactionType: string, transactionIntegrationId: string, lineId: string): string;
108
95
  export interface ActualMatchingViewState extends FetchedState {
109
- closeMatchAfterIgnoreMatchIds: ActualMatchingMatchId[];
110
- closeMatchAfterUndoMatchIds: ActualMatchingMatchId[];
111
- confirmStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
96
+ closeMatchAfterUndo: boolean;
112
97
  detailFetchStateByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
113
98
  detailRefreshStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
114
- ignoreStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
115
99
  lastMatchResultsByMatchId: Record<ActualMatchingMatchId, MatchAndReverseResult[]>;
116
100
  lastUndoResultsByMatchId: Record<ActualMatchingMatchId, UndoReversalResult[]>;
117
101
  matchIdsByPeriod: Record<MonthYearPeriodId, ActualMatchingMatchId[]>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ALL_ACTUAL_MATCHING_IGNORE_REASONS = exports.toActualMatchingIgnoreReasonType = exports.toUndoReversalResultStatus = exports.toMatchAndReverseResultStatus = exports.MATCH_SEARCH_DEBOUNCE_MS = exports.MATCH_ACCRUAL_SEARCH_LIMIT = exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = exports.toActualMatchingStatusFilter = exports.toActualMatchingSortKey = void 0;
3
+ exports.toUndoReversalResultStatus = exports.toMatchAndReverseResultStatus = exports.MATCH_SEARCH_DEBOUNCE_MS = exports.MATCH_ACCRUAL_SEARCH_LIMIT = exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = exports.toActualMatchingSortKey = void 0;
4
4
  exports.isMatchAndReverseCompleteStatus = isMatchAndReverseCompleteStatus;
5
5
  exports.actualMatchingTransactionLineKey = actualMatchingTransactionLineKey;
6
6
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
@@ -19,13 +19,6 @@ const ACTUAL_MATCHING_SORT_KEYS = [
19
19
  ];
20
20
  const toActualMatchingSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_SORT_KEYS);
21
21
  exports.toActualMatchingSortKey = toActualMatchingSortKey;
22
- const ACTUAL_MATCHING_STATUS_FILTERS = [
23
- 'all',
24
- 'pending_review',
25
- 'reversed',
26
- ];
27
- const toActualMatchingStatusFilter = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_STATUS_FILTERS);
28
- exports.toActualMatchingStatusFilter = toActualMatchingStatusFilter;
29
22
  exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
30
23
  exports.MATCH_ACCRUAL_SEARCH_LIMIT = 50;
31
24
  exports.MATCH_SEARCH_DEBOUNCE_MS = 300;
@@ -48,16 +41,6 @@ const UNDO_REVERSAL_RESULT_STATUSES = [
48
41
  ];
49
42
  const toUndoReversalResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, UNDO_REVERSAL_RESULT_STATUSES);
50
43
  exports.toUndoReversalResultStatus = toUndoReversalResultStatus;
51
- const ACTUAL_MATCHING_IGNORE_REASONS = [
52
- 'wrong_bill',
53
- 'wrong_period',
54
- 'amount_off',
55
- 'already_handled',
56
- 'other_ignore',
57
- ];
58
- const toActualMatchingIgnoreReasonType = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_IGNORE_REASONS);
59
- exports.toActualMatchingIgnoreReasonType = toActualMatchingIgnoreReasonType;
60
- exports.ALL_ACTUAL_MATCHING_IGNORE_REASONS = ACTUAL_MATCHING_IGNORE_REASONS;
61
44
  function actualMatchingTransactionLineKey(transactionType, transactionIntegrationId, lineId) {
62
45
  return `${transactionType}:${transactionIntegrationId}:${lineId}`;
63
46
  }
@@ -5,8 +5,7 @@ import { updateInvoices } from '../../../entity/invoicing/invoice/invoiceReducer
5
5
  import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
6
6
  import { RootState } from '../../../rootStateTypes';
7
7
  import { ZeniAPI } from '../../../zeniAPI';
8
- import { invalidateInvoicingCustomerDetail } from '../editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer';
9
- import { addInvoiceToList, invalidateInvoiceListForCustomer } from '../invoiceList/invoiceListReducer';
8
+ import { addInvoiceToList } from '../invoiceList/invoiceListReducer';
10
9
  import { createInvoice, createInvoiceFailure, createInvoiceSuccess } from './createInvoiceReducer';
11
- export type ActionType = ReturnType<typeof createInvoice> | ReturnType<typeof createInvoiceSuccess> | ReturnType<typeof createInvoiceFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoices> | ReturnType<typeof addInvoiceToList> | ReturnType<typeof invalidateInvoicingCustomerDetail> | ReturnType<typeof invalidateInvoiceListForCustomer> | ReturnType<typeof openSnackbar>;
10
+ export type ActionType = ReturnType<typeof createInvoice> | ReturnType<typeof createInvoiceSuccess> | ReturnType<typeof createInvoiceFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoices> | ReturnType<typeof addInvoiceToList> | ReturnType<typeof openSnackbar>;
12
11
  export declare const createInvoiceEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -9,7 +9,6 @@ const invoiceReducer_1 = require("../../../entity/invoicing/invoice/invoiceReduc
9
9
  const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
10
10
  const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
11
11
  const responsePayload_1 = require("../../../responsePayload");
12
- const editInvoicingCustomerDetailViewReducer_1 = require("../editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer");
13
12
  const invoiceListReducer_1 = require("../invoiceList/invoiceListReducer");
14
13
  const createInvoiceReducer_1 = require("./createInvoiceReducer");
15
14
  const createInvoiceEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(createInvoiceReducer_1.createInvoice.match), (0, operators_1.mergeMap)((action) => {
@@ -27,13 +26,6 @@ const createInvoiceEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, oper
27
26
  id: response.data.id,
28
27
  status: response.data.status,
29
28
  }),
30
- // The customer's page caches their invoices and totals.
31
- (0, editInvoicingCustomerDetailViewReducer_1.invalidateInvoicingCustomerDetail)({
32
- id: response.data.customer_id,
33
- }),
34
- (0, invoiceListReducer_1.invalidateInvoiceListForCustomer)({
35
- customerId: response.data.customer_id,
36
- }),
37
29
  (0, createInvoiceReducer_1.createInvoiceSuccess)({ invoiceId: response.data.id }),
38
30
  (0, snackbarReducer_1.openSnackbar)({
39
31
  messageSection: 'invoicing_invoice_saved',
@@ -1,8 +1,8 @@
1
1
  import { ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { Address } from '../../../entity/address/addressState';
4
- import { InvoicingCatalogPricePoint } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogState';
5
4
  import { InvoicingFieldHelpByCode, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
5
+ import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
6
6
  import { RootState } from '../../../rootStateTypes';
7
7
  import { InvoicingCreateInvoiceFormLocalData } from './createInvoiceState';
8
8
  /**
@@ -38,7 +38,7 @@ export interface CreateInvoiceFormView extends SelectorView {
38
38
  fieldHelp: InvoicingFieldHelpByCode;
39
39
  localData: InvoicingCreateInvoiceFormLocalData;
40
40
  planNames: InvoicingPlanNameOption[];
41
- products: InvoicingCatalogPricePoint[];
41
+ products: InvoicingProduct[];
42
42
  savedInvoiceId?: ID;
43
43
  settings?: InvoicingSettingsPayload;
44
44
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCreateInvoiceFormView = void 0;
4
4
  const addressSelector_1 = require("../../../entity/address/addressSelector");
5
- const invoicingCatalogSelector_1 = require("../../../entity/invoicing/invoicingCatalog/invoicingCatalogSelector");
5
+ const planSelector_1 = require("../../../entity/invoicing/plan/planSelector");
6
6
  const invoicingCatalogListViewSelector_1 = require("../invoicingCatalogListView/invoicingCatalogListViewSelector");
7
7
  const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
8
8
  const invoicingCustomerListViewSelector_1 = require("../invoicingCustomerListView/invoicingCustomerListViewSelector");
@@ -31,7 +31,7 @@ const hasPerUnitRate = (pricingModel) => pricingModel == null ||
31
31
  * `undefined` when there is no safe per-unit rate to prefill.
32
32
  */
33
33
  const planNamePrefillPrice = (pricePoint) => hasPerUnitRate(pricePoint.pricingModel)
34
- ? (0, invoicingCatalogSelector_1.invoicingPricePointDisplayAmount)(pricePoint)?.amount
34
+ ? (0, planSelector_1.invoicingPricePointDisplayAmount)(pricePoint)?.amount
35
35
  : undefined;
36
36
  /**
37
37
  * Display name for a customer option: company, else the full name, else the
@@ -1,15 +1,16 @@
1
1
  import { AccountBase } from '../../../entity/account/accountState';
2
2
  import { ClassBase } from '../../../entity/class/classState';
3
- import { InvoicingAccountingDetailPayload, InvoicingCatalogItemPayload, InvoicingCatalogPricePointPayload } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogPayload';
3
+ import { InvoicingPlanPayload } from '../../../entity/invoicing/plan/planPayload';
4
+ import { InvoicingAccountingDetailPayload, InvoicingProductPayload } from '../../../entity/invoicing/product/productPayload';
4
5
  import { ZeniAPIResponse } from '../../../responsePayload';
5
6
  import { InvoicingCatalogItemFormLocalData } from './editInvoicingCatalogItemDetailViewState';
6
- export type SaveInvoicingCatalogItemResponse = ZeniAPIResponse<InvoicingCatalogItemPayload>;
7
+ export type SaveInvoicingCatalogItemResponse = ZeniAPIResponse<InvoicingPlanPayload>;
7
8
  /**
8
- * The price-point half of a save body. `InvoicingCatalogPricePointPayload` is the shape
9
+ * The price-point half of a save body. `InvoicingProductPayload` is the shape
9
10
  * the service returns; a save differs in that a field is cleared by sending an
10
11
  * explicit `null`, since an absent key reads as "leave it alone".
11
12
  */
12
- export type InvoicingCatalogSubFamilySavePayload = Omit<Partial<InvoicingCatalogPricePointPayload>, 'accounting_detail' | 'description' | 'invoice_notes'> & {
13
+ export type InvoicingCatalogSubFamilySavePayload = Omit<Partial<InvoicingProductPayload>, 'accounting_detail' | 'description' | 'invoice_notes'> & {
13
14
  accounting_detail?: InvoicingAccountingDetailPayload | null;
14
15
  description?: string | null;
15
16
  invoice_notes?: string | null;
@@ -24,7 +25,7 @@ export type InvoicingCatalogSubFamilySavePayload = Omit<Partial<InvoicingCatalog
24
25
  * by its own request instead; see
25
26
  * `localDataToCreateInvoicingCatalogProductPayloads`.
26
27
  */
27
- export type InvoicingCatalogItemSavePayload = Omit<Partial<InvoicingCatalogItemPayload>, 'sub_families'> & {
28
+ export type InvoicingCatalogItemSavePayload = Omit<Partial<InvoicingPlanPayload>, 'sub_families'> & {
28
29
  sub_families?: InvoicingCatalogSubFamilySavePayload[];
29
30
  };
30
31
  /**
@@ -66,6 +67,6 @@ export declare const localDataToSaveInvoicingCatalogItemPayload: (localData: Inv
66
67
  * price point that does not exist yet to clear.
67
68
  */
68
69
  export declare const localDataToCreateInvoicingCatalogProductPayloads: (localData: InvoicingCatalogItemFormLocalData, itemId: string, lookup: InvoicingCatalogAccountingLookup) => InvoicingCatalogSubFamilySavePayload[];
69
- export type RunInvoicingCatalogPlanActionResponse = ZeniAPIResponse<InvoicingCatalogItemPayload>;
70
- export type RunInvoicingCatalogProductActionResponse = ZeniAPIResponse<InvoicingCatalogPricePointPayload>;
71
- export type InvoicingCatalogItemDetailResponse = ZeniAPIResponse<InvoicingCatalogItemPayload>;
70
+ export type RunInvoicingCatalogPlanActionResponse = ZeniAPIResponse<InvoicingPlanPayload>;
71
+ export type RunInvoicingCatalogProductActionResponse = ZeniAPIResponse<InvoicingProductPayload>;
72
+ export type InvoicingCatalogItemDetailResponse = ZeniAPIResponse<InvoicingPlanPayload>;
@@ -2,8 +2,8 @@ import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accou
2
2
  import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
3
3
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
4
4
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
5
- import { InvoicingCatalogItem } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogState';
6
5
  import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingFieldHelpByCode, InvoicingNamedOption, InvoicingNamedOptionsByKey } from '../../../entity/invoicing/invoicingCommonPayload';
6
+ import { InvoicingPlan } from '../../../entity/invoicing/plan/planState';
7
7
  import { RootState } from '../../../rootStateTypes';
8
8
  import { InvoicingCatalogItemFormLocalData, InvoicingCatalogItemKind } from './editInvoicingCatalogItemDetailViewState';
9
9
  export declare const getEditInvoicingCatalogItemDetailViewState: (state: RootState) => FetchStateAndError;
@@ -103,7 +103,7 @@ export interface InvoicingCatalogItemFormView extends SelectorView {
103
103
  */
104
104
  catalogTierTypeOptionsByPricingModel?: InvoicingNamedOptionsByKey;
105
105
  kind?: InvoicingCatalogItemKind;
106
- plan?: InvoicingCatalogItem;
106
+ plan?: InvoicingPlan;
107
107
  savedItemId?: ID;
108
108
  savedKind?: InvoicingCatalogItemKind;
109
109
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInvoicingCatalogItemFormView = exports.getInvoicingApplicableCatalogItemOptions = exports.getSavedInvoicingCatalogItemKind = exports.getSavedInvoicingCatalogItemId = exports.getEditInvoicingCatalogItemDetailViewState = void 0;
4
4
  const toolkit_1 = require("@reduxjs/toolkit");
5
5
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
6
- const invoicingCatalogSelector_1 = require("../../../entity/invoicing/invoicingCatalog/invoicingCatalogSelector");
6
+ const planSelector_1 = require("../../../entity/invoicing/plan/planSelector");
7
7
  const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
8
8
  const invoicingFormDraft_1 = require("../invoicingFormDraft");
9
9
  const invoicingQboViewSelector_1 = require("../invoicingQboView/invoicingQboViewSelector");
@@ -42,7 +42,7 @@ const buildApplicableCatalogItemOptions = (plans) => {
42
42
  * Kept referentially stable across unrelated dispatches; the form view filters
43
43
  * out the item being edited (see `getInvoicingCatalogItemFormView`).
44
44
  */
45
- exports.getInvoicingApplicableCatalogItemOptions = (0, toolkit_1.createSelector)((state) => state.invoicingCatalogState, (state) => state.invoicingCatalogListViewState, (catalogState, listViewState) => buildApplicableCatalogItemOptions((0, invoicingCatalogSelector_1.getInvoicingCatalogItemsByIds)(catalogState, [
45
+ exports.getInvoicingApplicableCatalogItemOptions = (0, toolkit_1.createSelector)((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (planState, listViewState) => buildApplicableCatalogItemOptions((0, planSelector_1.getInvoicingPlansByIds)(planState, [
46
46
  ...listViewState.planIds,
47
47
  ...listViewState.productIds,
48
48
  ])));
@@ -67,9 +67,7 @@ const getInvoicingCatalogIncomeAccountIds = (0, toolkit_1.createSelector)([
67
67
  : invoicingQboViewSelector_1.NO_INVOICING_ACCOUNT_IDS);
68
68
  const getInvoicingCatalogItemFormView = (state, id) => {
69
69
  const { editDraftById, error, fetchState, newItemDraft, savedItemId, savedKind, } = state.editInvoicingCatalogItemDetailViewState;
70
- const plan = id != null
71
- ? (0, invoicingCatalogSelector_1.getInvoicingCatalogItemById)(state.invoicingCatalogState, id)
72
- : undefined;
70
+ const plan = id != null ? (0, planSelector_1.getInvoicingPlanById)(state.invoicingPlanState, id) : undefined;
73
71
  const kind = plan != null ? 'plan' : undefined;
74
72
  // No entity fallback: the draft is the one source of form values, seeded from
75
73
  // the record by `seedInvoicingCatalogItemFormDraftEpic` when the detail load
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { updateInvoicingCatalogItems } from '../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer';
3
+ import { updateInvoicingPlans } from '../../../entity/invoicing/plan/planReducer';
4
4
  import { RootState } from '../../../rootStateTypes';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
6
  import { fetchInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetailFailure } from './editInvoicingCatalogItemDetailViewReducer';
7
- export type ActionType = ReturnType<typeof fetchInvoicingCatalogItemDetail> | ReturnType<typeof updateInvoicingCatalogItemDetail> | ReturnType<typeof updateInvoicingCatalogItemDetailFailure> | ReturnType<typeof updateInvoicingCatalogItems>;
7
+ export type ActionType = ReturnType<typeof fetchInvoicingCatalogItemDetail> | ReturnType<typeof updateInvoicingCatalogItemDetail> | ReturnType<typeof updateInvoicingCatalogItemDetailFailure> | ReturnType<typeof updateInvoicingPlans>;
8
8
  export declare const fetchInvoicingCatalogItemDetailEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchInvoicingCatalogItemDetailEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const invoicingCatalogReducer_1 = require("../../../entity/invoicing/invoicingCatalog/invoicingCatalogReducer");
6
+ const planReducer_1 = require("../../../entity/invoicing/plan/planReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
8
  const editInvoicingCatalogItemDetailViewReducer_1 = require("./editInvoicingCatalogItemDetailViewReducer");
9
9
  const fetchInvoicingCatalogItemDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(editInvoicingCatalogItemDetailViewReducer_1.fetchInvoicingCatalogItemDetail.match), (0, operators_1.switchMap)((action) => {
@@ -12,7 +12,7 @@ const fetchInvoicingCatalogItemDetailEpic = (actions$, _state$, zeniAPI) => acti
12
12
  return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
13
13
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
14
14
  return [
15
- (0, invoicingCatalogReducer_1.updateInvoicingCatalogItems)([response.data], 'merge'),
15
+ (0, planReducer_1.updateInvoicingPlans)([response.data], 'merge'),
16
16
  (0, editInvoicingCatalogItemDetailViewReducer_1.updateInvoicingCatalogItemDetail)({ id: response.data.id, kind }),
17
17
  ];
18
18
  }