@zeniai/client-epic-state 5.2.69-betaAK0 → 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 (157) 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 -2
  23. package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -2
  24. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -2
  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/epic.d.ts +2 -4
  29. package/lib/epic.js +1 -5
  30. package/lib/esm/entity/actualMatching/actualMatchingReducer.js +1 -9
  31. package/lib/esm/entity/invoicing/plan/planPayload.js +47 -0
  32. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogReducer.js → plan/planReducer.js} +20 -19
  33. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogSelector.js → plan/planSelector.js} +8 -8
  34. package/lib/esm/entity/invoicing/{invoicingCatalog/invoicingCatalogPayload.js → product/productPayload.js} +3 -46
  35. package/lib/esm/entity/invoicing/product/productReducer.js +43 -0
  36. package/lib/esm/entity/invoicing/product/productSelector.js +10 -0
  37. package/lib/esm/entity/invoicing/product/productState.js +1 -0
  38. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -2
  39. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
  40. package/lib/esm/epic.js +1 -5
  41. package/lib/esm/index.js +11 -9
  42. package/lib/esm/reducer.js +7 -4
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +2 -4
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +13 -26
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +23 -2
  46. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +38 -89
  47. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +62 -68
  48. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -15
  49. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +1 -9
  50. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +1 -1
  51. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
  52. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  53. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  54. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  55. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
  56. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  57. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +1 -5
  58. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
  59. package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +1 -8
  60. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  61. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  62. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +20 -56
  63. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +9 -18
  64. package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
  65. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
  66. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
  67. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
  68. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +1 -21
  69. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
  70. package/lib/index.d.ts +17 -14
  71. package/lib/index.js +60 -65
  72. package/lib/reducer.d.ts +2 -1
  73. package/lib/reducer.js +7 -4
  74. package/lib/rootStateTypes.d.ts +5 -3
  75. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +2 -2
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +1 -3
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +11 -24
  78. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +22 -1
  79. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  80. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +1 -12
  81. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +8 -19
  82. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +39 -90
  83. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  84. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +10 -24
  85. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +4 -7
  86. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +62 -71
  87. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +4 -19
  88. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +1 -18
  89. package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -3
  90. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +0 -8
  91. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
  92. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +2 -2
  93. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +9 -8
  94. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +2 -2
  95. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +3 -5
  96. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.d.ts +2 -2
  97. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  98. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +4 -3
  99. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.d.ts +2 -2
  100. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  101. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.d.ts +3 -2
  102. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  103. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +3 -2
  104. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +7 -3
  105. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  106. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +1 -3
  107. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +2 -6
  108. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +2 -2
  109. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -3
  110. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -5
  111. package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +1 -3
  112. package/lib/view/invoicing/invoiceList/invoiceListReducer.js +2 -9
  113. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogListPageEpic.d.ts +2 -2
  114. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.d.ts +2 -2
  115. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  116. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.d.ts +2 -2
  117. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  118. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewPayload.d.ts +3 -3
  119. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +5 -29
  120. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +21 -58
  121. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +1 -1
  122. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  123. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +1 -1
  124. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
  125. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
  126. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +3 -12
  127. package/lib/view/invoicing/settingsView/settingsViewSelector.js +8 -17
  128. package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +2 -11
  129. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +11 -31
  130. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -3
  131. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -2
  132. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -4
  133. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  134. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +5 -5
  135. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  136. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +2 -2
  137. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -1
  138. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +30 -4
  139. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
  140. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +2 -22
  141. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -1
  142. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
  143. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
  144. package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +1 -2
  145. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +2 -2
  146. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +5 -5
  147. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +2 -2
  148. package/package.json +1 -1
  149. package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +0 -12
  150. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -50
  151. package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -37
  152. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +0 -10
  153. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -54
  154. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +0 -8
  155. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +0 -41
  156. /package/lib/entity/invoicing/{invoicingCatalog/invoicingCatalogState.js → plan/planState.js} +0 -0
  157. /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;
@@ -5,15 +5,13 @@ import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelecto
5
5
  import { ZeniDate } from '../../../zeniDayJS';
6
6
  import { ActualMatchingTransactionSearchResult, ActualMatchingViewUIState, MatchAndReverseResult } from '../types/actualMatchingViewState';
7
7
  export type ActualMatchingRowKind = 'auto_reversed' | 'pending_review' | 'manually_reversed';
8
- export type ActualMatchingJournalEntryIds = Pick<JEOneTimeAccrual, 'reversalTransactionId' | 'reversalTransactionIntegrationId' | 'transactionId' | 'transactionIntegrationId'>;
9
- export type ActualMatchingLeftoverAccrual = {
8
+ export type ActualMatchingGroupedAccrual = {
10
9
  accrualId: ID;
11
10
  estimatedAmount?: Amount;
12
11
  jeDebitAccountName?: string;
13
12
  memo?: string;
14
13
  serviceMonth?: string;
15
14
  };
16
- export type ActualMatchingGroupedAccrual = ActualMatchingLeftoverAccrual & ActualMatchingJournalEntryIds;
17
15
  export interface ActualMatchingRow extends JEOneTimeAccrual {
18
16
  accruedAmount: Amount;
19
17
  actualAmount: Amount;
@@ -22,7 +20,7 @@ export interface ActualMatchingRow extends JEOneTimeAccrual {
22
20
  groupedAccrualIds?: ID[];
23
21
  groupedMembers?: ActualMatchingGroupedAccrual[];
24
22
  intendedAccrualIds?: ID[];
25
- leftovers?: ActualMatchingLeftoverAccrual[];
23
+ leftovers?: ActualMatchingGroupedAccrual[];
26
24
  matchShape?: string;
27
25
  matchTier?: string;
28
26
  reversalDate?: ZeniDate;
@@ -45,9 +43,6 @@ export interface ActualMatchingKpiSummary {
45
43
  count: number;
46
44
  estimatedMinutesToClear: number;
47
45
  };
48
- reversed: {
49
- count: number;
50
- };
51
46
  variance: {
52
47
  averagePercentPerMatch: number;
53
48
  netAmount: number;
@@ -72,30 +67,21 @@ export interface ActualMatchingMatchModalView {
72
67
  results: ActualMatchingTransactionSearchResult[];
73
68
  };
74
69
  lastBatchResults?: MatchAndReverseResult[];
75
- }
76
- export interface ActualMatchingMatchView {
77
- accruedAmount: Amount;
78
- actualAmount: Amount;
79
- kind: ActualMatchingRowKind;
80
- matchId: string;
81
- members: JEOneTimeAccrual[];
82
- transactionIntegrationId: ID;
83
- transactionType: string;
84
- leftovers?: JEOneTimeAccrual[];
85
- matchShape?: string;
86
- matchTier?: string;
87
- transactionDate?: string;
88
- vendorId?: ID;
89
- vendorName?: string;
70
+ openedFromMatchId?: string;
71
+ prefill?: {
72
+ selectedAccrualIds: ID[];
73
+ actualAmount?: number;
74
+ consumedLineIds?: ID[];
75
+ matchedLineId?: string;
76
+ matchedTransactionId?: string;
77
+ };
90
78
  }
91
79
  export interface ExpenseAutomationActualMatchingViewSelector extends SelectorView {
92
80
  hasLoadedForSelectedPeriod: boolean;
93
- ignoreStatusByMatchId: Record<string, FetchStateAndError>;
94
81
  kpiSummary: ActualMatchingKpiSummary;
95
82
  matchModal: ActualMatchingMatchModalView;
96
83
  pendingReview: ActualMatchingRow[];
97
84
  refreshStatus: FetchStateAndError;
98
85
  reversed: ActualMatchingRow[];
99
86
  uiState: ActualMatchingViewUIState;
100
- undoReversalStatusByMatchId: Record<string, FetchStateAndError>;
101
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,11 +16,7 @@ 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
- const toolkit_1 = require("@reduxjs/toolkit");
24
20
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
25
21
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
26
22
  const actualMatchingSelector_1 = require("../../../entity/actualMatching/actualMatchingSelector");
@@ -28,6 +24,7 @@ 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) {
@@ -116,18 +134,13 @@ function collectGroupedMembers(members) {
116
134
  estimatedAmount: member.estimatedAmount,
117
135
  jeDebitAccountName: member.jeDebitAccountName,
118
136
  memo: member.memo,
119
- reversalTransactionId: member.reversalTransactionId,
120
- reversalTransactionIntegrationId: member.reversalTransactionIntegrationId,
121
137
  serviceMonth: member.serviceMonth,
122
- transactionId: member.transactionId,
123
- transactionIntegrationId: member.transactionIntegrationId,
124
138
  }));
125
139
  }
126
140
  function collectLeftoverMembers(leftovers) {
127
141
  if (leftovers == null || leftovers.length === 0) {
128
142
  return undefined;
129
143
  }
130
- // Leftover accruals did not post, so they have no journal-entry ids to open.
131
144
  return leftovers.map((member) => ({
132
145
  accrualId: member.accrualId,
133
146
  estimatedAmount: member.estimatedAmount,
@@ -233,7 +246,6 @@ function emptyKpiSummary() {
233
246
  actualsReceived: { count: 0, expectedCount: 0, vendorsPending: 0 },
234
247
  autoReversed: { count: 0, percent: 0, clearedAmount: 0 },
235
248
  pendingReview: { count: 0, amount: 0, estimatedMinutesToClear: 0 },
236
- reversed: { count: 0 },
237
249
  variance: { percent: 0, averagePercentPerMatch: 0, netAmount: 0 },
238
250
  };
239
251
  }
@@ -289,7 +301,6 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
289
301
  }
290
302
  const autoReversed = kpiRows.filter((row) => row.kind === 'auto_reversed');
291
303
  const pendingReview = kpiRows.filter((row) => row.kind === 'pending_review');
292
- const reversed = kpiRows.filter((row) => isReversedMatchKind(row.kind));
293
304
  const receivedCount = kpiRows.length;
294
305
  const rowsWithActual = kpiRows.filter((row) => row.actualAmount?.amount != null);
295
306
  const accruedTotal = rowsWithActual.reduce((sum, row) => sum + (row.accruedAmount?.amount ?? row.estimatedAmount.amount), 0);
@@ -315,9 +326,6 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
315
326
  amount: sumRowAmounts(pendingReview, displayCurrencyCode),
316
327
  estimatedMinutesToClear: pendingReview.length * ESTIMATED_MINUTES_PER_PENDING_MATCH,
317
328
  },
318
- reversed: {
319
- count: reversed.length,
320
- },
321
329
  variance: {
322
330
  percent: accruedTotal === 0
323
331
  ? 0
@@ -330,66 +338,23 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
330
338
  },
331
339
  };
332
340
  }
333
- function toActualMatchingMatchView(match) {
341
+ function getExpenseAutomationActualMatchingMatchView(state, matchId) {
342
+ const view = state.expenseAutomationActualMatchingViewState;
334
343
  return {
335
- ...match,
336
- members: match.members.map(toMatchModalAccrual),
337
- leftovers: match.leftovers == null
338
- ? undefined
339
- : 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],
340
350
  };
341
351
  }
342
- const matchViewSelectorById = new Map();
343
- function getExpenseAutomationActualMatchingMatchView(state, matchId) {
344
- let selector = matchViewSelectorById.get(matchId);
345
- if (selector == null) {
346
- selector = (0, toolkit_1.createSelector)([
347
- (root) => root.expenseAutomationActualMatchingViewState
348
- .detailFetchStateByMatchId[matchId] ?? NOT_STARTED,
349
- (root) => root.expenseAutomationActualMatchingViewState.ignoreStatusByMatchId[matchId] ?? NOT_STARTED,
350
- (root) => root.expenseAutomationActualMatchingViewState
351
- .lastMatchResultsByMatchId?.[matchId],
352
- (root) => root.expenseAutomationActualMatchingViewState
353
- .lastUndoResultsByMatchId?.[matchId],
354
- (root) => root.expenseAutomationActualMatchingViewState
355
- .detailRefreshStatusByMatchId[matchId] ?? NOT_STARTED,
356
- (root) => root.expenseAutomationActualMatchingViewState
357
- .undoReversalStatusByMatchId[matchId] ?? NOT_STARTED,
358
- (root) => (0, actualMatchingSelector_1.getActualMatchingMatchById)(root.actualMatchingState, matchId),
359
- ], (detailFetchState, ignoreStatus, lastMatchResults, lastUndoResults, refreshStatus, undoReversalStatus, match) => ({
360
- detailFetchState,
361
- ignoreStatus,
362
- lastMatchResults,
363
- lastUndoResults,
364
- match: match == null ? undefined : toActualMatchingMatchView(match),
365
- refreshStatus,
366
- undoReversalStatus,
367
- }));
368
- matchViewSelectorById.set(matchId, selector);
369
- }
370
- return selector(state);
371
- }
372
352
  function getCloseMatchAfterUndo(state) {
373
- return state.expenseAutomationActualMatchingViewState
374
- .closeMatchAfterUndoMatchIds[0];
375
- }
376
- function getCloseMatchAfterUndoMatchId(state) {
377
- return getCloseMatchAfterUndo(state);
378
- }
379
- function getCloseMatchAfterIgnoreMatchId(state) {
380
- return state.expenseAutomationActualMatchingViewState
381
- .closeMatchAfterIgnoreMatchIds[0];
382
- }
383
- function getActualMatchingMatchModalConfirmStatus(state, matchId) {
384
- if (matchId != null && matchId !== '') {
385
- return (state.expenseAutomationActualMatchingViewState.confirmStatusByMatchId[matchId] ?? NOT_STARTED);
386
- }
387
- return state.expenseAutomationActualMatchingViewState.matchModal
388
- .confirmStatus;
353
+ return state.expenseAutomationActualMatchingViewState.closeMatchAfterUndo;
389
354
  }
390
355
  function getExpenseAutomationActualMatchingView(state) {
391
356
  const { expenseAutomationActualMatchingViewState } = state;
392
- const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, ignoreStatusByMatchId, undoReversalStatusByMatchId, } = expenseAutomationActualMatchingViewState;
357
+ const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, } = expenseAutomationActualMatchingViewState;
393
358
  const selectedPeriod = getSelectedMonthYearForCurrentTenant(state);
394
359
  const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : undefined;
395
360
  const matchIds = monthYearPeriodId != null ? matchIdsByPeriod[monthYearPeriodId] : undefined;
@@ -405,6 +370,32 @@ function getExpenseAutomationActualMatchingView(state) {
405
370
  const searchedAccruals = matchModal.accrualSearch.results
406
371
  .map((key) => (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(key, state.jeSchedulesState))
407
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
+ };
408
399
  // `fetchState` is a flat slice field that survives a period switch. Until this
409
400
  // month's ids land, leftover Completed/Error is the previous month. Report
410
401
  // Not-Started so chrome matches Review's "cache slot missing" skeleton, not
@@ -422,16 +413,16 @@ function getExpenseAutomationActualMatchingView(state) {
422
413
  kpiSummary,
423
414
  uiState,
424
415
  refreshStatus,
425
- ignoreStatusByMatchId,
426
- undoReversalStatusByMatchId,
427
416
  hasLoadedForSelectedPeriod: matchIds != null,
428
417
  matchModal: {
429
418
  isOpen: matchModal.isOpen,
419
+ openedFromMatchId: matchModal.openedFromMatchId,
420
+ prefill,
430
421
  confirmStatus: matchModal.confirmStatus,
431
422
  lastBatchResults: matchModal.lastBatchResults,
432
423
  transactionSearch: {
433
424
  query: matchModal.transactionSearch.query,
434
- results: matchModal.transactionSearch.results,
425
+ results: uniqueTransactionSearchResults(matchModal.pinnedTransactionResults, matchModal.transactionSearch.results),
435
426
  fetchState: {
436
427
  fetchState: matchModal.transactionSearch.fetchState,
437
428
  error: matchModal.transactionSearch.error,
@@ -441,7 +432,7 @@ function getExpenseAutomationActualMatchingView(state) {
441
432
  },
442
433
  accrualSearch: {
443
434
  query: matchModal.accrualSearch.query,
444
- results: searchedAccruals,
435
+ results: uniqueMatchModalAccruals(pinnedAccruals, searchedAccruals),
445
436
  fetchState: {
446
437
  fetchState: matchModal.accrualSearch.fetchState,
447
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,11 +18,6 @@ export interface ActualMatchingViewUIState {
20
18
  searchString: string;
21
19
  sortKey: ActualMatchingSortKey;
22
20
  sortOrder: SortOrder;
23
- /**
24
- * Unused by the list: Pending review and Reversed always render as separate
25
- * tables. Kept so persisted UI state and older clients still hydrate.
26
- */
27
- statusFilter: ActualMatchingStatusFilter;
28
21
  }
29
22
  /**
30
23
  * Sibling of Missing Receipts `MatchCandidate`. Confirm needs `lineId` and
@@ -76,14 +69,6 @@ export interface UndoReversalAccrualsParams {
76
69
  accrualIds: ID[];
77
70
  matchId: ActualMatchingMatchId;
78
71
  }
79
- export declare const toActualMatchingIgnoreReasonType: (v: string) => "other_ignore" | "already_handled" | "amount_off" | "wrong_period" | "wrong_bill";
80
- export type ActualMatchingIgnoreReasonType = ReturnType<typeof toActualMatchingIgnoreReasonType>;
81
- export declare const ALL_ACTUAL_MATCHING_IGNORE_REASONS: readonly ActualMatchingIgnoreReasonType[];
82
- export interface IgnoreActualMatchingSuggestionParams {
83
- matchId: ActualMatchingMatchId;
84
- reason: ActualMatchingIgnoreReasonType;
85
- note?: string;
86
- }
87
72
  export interface ActualMatchingTransactionSearchState extends FetchStateAndError {
88
73
  isLoadingMore: boolean;
89
74
  nextPageToken: string | null;
@@ -99,18 +84,18 @@ export interface ActualMatchingAccrualSearchState extends FetchStateAndError {
99
84
  export interface ActualMatchingMatchModalState {
100
85
  accrualSearch: ActualMatchingAccrualSearchState;
101
86
  confirmStatus: FetchStateAndError;
87
+ didPinPrefillTransactions: boolean;
102
88
  isOpen: boolean;
89
+ pinnedTransactionResults: ActualMatchingTransactionSearchResult[];
103
90
  transactionSearch: ActualMatchingTransactionSearchState;
104
91
  lastBatchResults?: MatchAndReverseResult[];
92
+ openedFromMatchId?: ActualMatchingMatchId;
105
93
  }
106
94
  export declare function actualMatchingTransactionLineKey(transactionType: string, transactionIntegrationId: string, lineId: string): string;
107
95
  export interface ActualMatchingViewState extends FetchedState {
108
- closeMatchAfterIgnoreMatchIds: ActualMatchingMatchId[];
109
- closeMatchAfterUndoMatchIds: ActualMatchingMatchId[];
110
- confirmStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
96
+ closeMatchAfterUndo: boolean;
111
97
  detailFetchStateByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
112
98
  detailRefreshStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
113
- ignoreStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
114
99
  lastMatchResultsByMatchId: Record<ActualMatchingMatchId, MatchAndReverseResult[]>;
115
100
  lastUndoResultsByMatchId: Record<ActualMatchingMatchId, UndoReversalResult[]>;
116
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>;