@zeniai/client-epic-state 5.2.41-beta5MM → 5.2.41-beta7MM

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 (196) hide show
  1. package/lib/entity/billPay/billTransaction/billTransactionReducer.d.ts +5 -1
  2. package/lib/entity/billPay/billTransaction/billTransactionReducer.js +17 -2
  3. package/lib/entity/invoicing/coupon/couponPayload.d.ts +8 -0
  4. package/lib/entity/invoicing/coupon/couponPayload.js +8 -0
  5. package/lib/entity/invoicing/coupon/couponState.d.ts +6 -0
  6. package/lib/entity/invoicing/dunningCase/dunningCaseTypes.d.ts +1 -1
  7. package/lib/entity/invoicing/plan/planSelector.d.ts +20 -0
  8. package/lib/entity/invoicing/plan/planSelector.js +42 -0
  9. package/lib/entity/invoicing/product/productPayload.d.ts +8 -1
  10. package/lib/entity/invoicing/product/productPayload.js +4 -1
  11. package/lib/entity/invoicing/product/productState.d.ts +16 -0
  12. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -1
  13. package/lib/entity/jeSchedules/jeSchedulesReducer.js +79 -5
  14. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  15. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  16. package/lib/entity/task/taskState.d.ts +1 -1
  17. package/lib/epic.d.ts +4 -1
  18. package/lib/epic.js +10 -4
  19. package/lib/esm/entity/billPay/billTransaction/billTransactionReducer.js +16 -1
  20. package/lib/esm/entity/invoicing/coupon/couponPayload.js +8 -0
  21. package/lib/esm/entity/invoicing/plan/planSelector.js +39 -0
  22. package/lib/esm/entity/invoicing/product/productPayload.js +4 -1
  23. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +78 -4
  24. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  25. package/lib/esm/epic.js +10 -4
  26. package/lib/esm/index.js +8 -7
  27. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +3 -2
  28. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +39 -0
  29. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +14 -1
  30. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +10 -13
  31. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
  32. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
  33. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +15 -4
  34. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +6 -0
  35. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +74 -1
  36. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +80 -53
  37. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +10 -0
  38. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +11 -2
  39. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
  40. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +28 -11
  41. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +28 -1
  42. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +67 -35
  43. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +22 -11
  44. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +23 -4
  45. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.js +1 -7
  46. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +19 -5
  47. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +30 -7
  48. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +16 -1
  49. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +22 -11
  50. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +69 -6
  51. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +22 -0
  52. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.js +22 -4
  53. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +18 -4
  54. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +29 -6
  55. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +28 -12
  56. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +37 -2
  57. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +43 -17
  58. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
  59. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +29 -6
  60. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +30 -14
  61. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +143 -8
  62. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
  63. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +44 -18
  64. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
  65. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +29 -8
  66. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +12 -0
  67. package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
  68. package/lib/esm/view/invoicing/invoicingFormDraft.js +78 -0
  69. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +57 -9
  70. package/lib/esm/view/recommendation/recommendationPayload.js +3 -1
  71. package/lib/esm/view/recommendation/recommendationReducer.js +27 -7
  72. package/lib/esm/view/recommendation/recommendationSelector.js +1 -0
  73. package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +20 -8
  74. package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +87 -1
  75. package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +1 -0
  76. package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewState.js +4 -0
  77. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.js +97 -0
  78. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.js +85 -0
  79. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewReducer.js +18 -1
  80. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
  81. package/lib/esm/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.js +95 -0
  82. package/lib/index.d.ts +9 -8
  83. package/lib/index.js +54 -48
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +3 -2
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.d.ts +20 -0
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +43 -0
  87. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
  88. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -0
  89. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +8 -11
  90. package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
  91. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
  92. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
  93. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +15 -4
  94. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  95. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +18 -0
  96. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +18 -7
  97. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +6 -0
  98. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +10 -3
  99. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +76 -3
  100. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +80 -53
  101. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +10 -0
  102. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +3 -0
  103. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +3 -0
  104. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +8 -4
  105. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +1 -0
  106. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +12 -2
  107. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
  108. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +27 -10
  109. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +16 -0
  110. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +8 -5
  111. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +7 -2
  112. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +28 -1
  113. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +46 -5
  114. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +69 -36
  115. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.d.ts +3 -1
  116. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +22 -11
  117. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +17 -0
  118. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +22 -3
  119. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +2 -1
  120. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +2 -2
  121. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.js +1 -7
  122. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +17 -3
  123. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.d.ts +10 -6
  124. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +29 -6
  125. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.d.ts +5 -1
  126. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +16 -1
  127. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.d.ts +3 -1
  128. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +22 -11
  129. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +46 -0
  130. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +68 -5
  131. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.d.ts +21 -1
  132. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +24 -1
  133. package/lib/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.d.ts +9 -5
  134. package/lib/view/invoicing/editInvoicingCouponDetailView/fetchInvoicingCouponDetailPageEpic.js +22 -4
  135. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +18 -4
  136. package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.d.ts +10 -6
  137. package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +28 -5
  138. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +5 -1
  139. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +29 -13
  140. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +16 -7
  141. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +37 -2
  142. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewState.d.ts +8 -1
  143. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.d.ts +15 -10
  144. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +42 -16
  145. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +1 -1
  146. package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.d.ts +10 -6
  147. package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +28 -5
  148. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.d.ts +5 -1
  149. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +31 -15
  150. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +79 -12
  151. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +145 -9
  152. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +8 -1
  153. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +4 -1
  154. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.d.ts +15 -11
  155. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +42 -16
  156. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +1 -1
  157. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.d.ts +10 -6
  158. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/seedInvoicingSubscriptionFormDraftEpic.js +28 -7
  159. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +10 -0
  160. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +12 -0
  161. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  162. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
  163. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
  164. package/lib/view/invoicing/invoicingFormDraft.d.ts +63 -0
  165. package/lib/view/invoicing/invoicingFormDraft.js +86 -0
  166. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +49 -0
  167. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +59 -10
  168. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
  169. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
  170. package/lib/view/recommendation/recommendationPayload.d.ts +1 -0
  171. package/lib/view/recommendation/recommendationPayload.js +5 -0
  172. package/lib/view/recommendation/recommendationReducer.d.ts +7 -1
  173. package/lib/view/recommendation/recommendationReducer.js +28 -8
  174. package/lib/view/recommendation/recommendationSelector.d.ts +2 -0
  175. package/lib/view/recommendation/recommendationSelector.js +3 -1
  176. package/lib/view/recommendation/recommendationState.d.ts +2 -1
  177. package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +2 -2
  178. package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +18 -6
  179. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewPayload.d.ts +19 -0
  180. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.d.ts +10 -1
  181. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +88 -2
  182. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +1 -0
  183. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +1 -0
  184. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.d.ts +7 -0
  185. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.js +4 -0
  186. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.d.ts +37 -0
  187. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillRecommendationsEpic.js +104 -0
  188. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.d.ts +24 -0
  189. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchRecommendationsForBill.js +92 -0
  190. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +4 -1
  191. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +19 -2
  192. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -0
  193. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
  194. package/lib/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.d.ts +18 -0
  195. package/lib/view/spendManagement/billPay/editBillView/epics/applyBillRecommendationsToLocalStoreEpic.js +102 -0
  196. package/package.json +2 -2
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchRecommendationsForBill = fetchRecommendationsForBill;
7
+ exports.getBillTransaction = getBillTransaction;
8
+ const get_1 = __importDefault(require("lodash/get"));
9
+ const rxjs_1 = require("rxjs");
10
+ const operators_1 = require("rxjs/operators");
11
+ const recommendationPayload_1 = require("../../../../../commonPayloadTypes/recommendationPayload");
12
+ const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
13
+ const responsePayload_1 = require("../../../../../responsePayload");
14
+ const billDetailViewReducer_1 = require("../billDetailViewReducer");
15
+ /**
16
+ * Requests the recommendations for one bill and maps them onto the transaction
17
+ * entity, or resolves without a request for a bill that does not need them.
18
+ *
19
+ * Only `recommendations` is read from the response — per line, and what drives
20
+ * the "Update to X" checkbox and the Recommended group in the category/class
21
+ * dropdowns. The endpoint returns no entity-level recommendation and the edit
22
+ * form does not render one.
23
+ */
24
+ function fetchRecommendationsForBill(state, billId, zeniAPI, cacheOverride = false) {
25
+ const transaction = getBillTransaction(state, billId);
26
+ const lineIds = transaction?.lines?.map((line) => line.id) ?? [];
27
+ if (transaction == null ||
28
+ shouldSkipRecommendations(transaction, cacheOverride)) {
29
+ return (0, rxjs_1.of)((0, billDetailViewReducer_1.fetchBillRecommendationsSuccess)(billId));
30
+ }
31
+ // The bill is scoped by the path, so this endpoint takes no query — there is
32
+ // no `is_include_*` flag to turn off the way the bill detail request has.
33
+ return zeniAPI
34
+ .getJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bills/transactions/${billId}/recommendations`)
35
+ .pipe((0, operators_1.mergeMap)((response) => {
36
+ if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
37
+ return (0, rxjs_1.of)((0, billDetailViewReducer_1.fetchBillRecommendationsFailure)(billId, response.status));
38
+ }
39
+ const actions = [];
40
+ // Positional line <-> recommendation mapping, matching
41
+ // `getRecommendationsPerLine` — the mapping the recommendations went
42
+ // through while the bill detail response still carried them. This
43
+ // endpoint returns them flat, not nested under `transaction`.
44
+ const recommendationPayloads = response.data.recommendations ?? [];
45
+ // The pairing is a convention shared with the platform, not
46
+ // something the payload enforces, so a mismatch would otherwise
47
+ // mis-assign or silently drop recommendations. Degrade safely —
48
+ // extra entries are ignored and unmatched lines get none — but say
49
+ // so, because it means the two sides have diverged.
50
+ if (recommendationPayloads.length !== lineIds.length) {
51
+ console.warn(`Bill ${billId}: ${recommendationPayloads.length} recommendation entries for ${lineIds.length} lines. ` +
52
+ 'They are paired by position, so this bill may be scored incorrectly.');
53
+ }
54
+ const recommendationByLineId = {};
55
+ lineIds.forEach((lineId, index) => {
56
+ const recommendationPayload = recommendationPayloads[index];
57
+ if (recommendationPayload != null) {
58
+ recommendationByLineId[lineId] = (0, recommendationPayload_1.transformRecommendation)(recommendationPayload);
59
+ }
60
+ });
61
+ actions.push((0, billTransactionReducer_1.updateBillTransactionRecommendations)(billId, recommendationByLineId));
62
+ // Entity writes first, then the view status, so consumers reading on
63
+ // the status flip already see the recommendations.
64
+ actions.push((0, billDetailViewReducer_1.fetchBillRecommendationsSuccess)(billId, true));
65
+ return (0, rxjs_1.from)(actions);
66
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, billDetailViewReducer_1.fetchBillRecommendationsFailure)(billId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Fetch bill recommendations REST API call errored out ${error}`)))));
67
+ }
68
+ function getBillTransaction(state, billId) {
69
+ return (0, get_1.default)(state.billTransactionState.transactionById, billId, undefined);
70
+ }
71
+ /**
72
+ * Helper functions
73
+ */
74
+ // Awaiting-approval bills are the only ones this request exists for. A draft
75
+ // opens the edit form directly, so its recommendations ride along on the bill
76
+ // detail response; `paid` bills cannot reach the form at all. The platform
77
+ // decides which of those two it is from the bill's status, which is why the
78
+ // request carries no flag asking for either.
79
+ function shouldSkipRecommendations(transaction, cacheOverride) {
80
+ return (transaction.billPayInfo.stage.code !== 'pending_approval' ||
81
+ transaction.isDeleted === true ||
82
+ // No vendor (a draft carrying only a candidate vendor name) means no
83
+ // entity to recommend against — the vendor-selection flow covers that.
84
+ Boolean(transaction.vendor?.id) === false ||
85
+ // The bill detail response already carried them. `toVendorTransaction`
86
+ // maps them straight onto the entity, so requesting again would only
87
+ // re-fetch what is here — this is what lets the platform move the line
88
+ // between embedded and on-demand without a client change. A forced
89
+ // refresh is the one case that still goes to the endpoint.
90
+ (cacheOverride === false &&
91
+ Object.keys(transaction.recommendations ?? {}).length > 0));
92
+ }
@@ -26,7 +26,10 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
26
26
  }, "editBillView/initializeBillToLocalStore", never, never>, saveBillUpdatesToLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
27
27
  billDetailLocalData: BillDetailLocalData;
28
28
  billId?: ID;
29
- }, "editBillView/saveBillUpdatesToLocalStore">, discardBillUpdatesInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
29
+ }, "editBillView/saveBillUpdatesToLocalStore">, updateBillLineRecommendationsInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, updatesByLineId: Record<string, import("./editBillViewState").LineItemRecommendationsLocalData>], {
30
+ billId: string;
31
+ updatesByLineId: Record<string, import("./editBillViewState").LineItemRecommendationsLocalData>;
32
+ }, "editBillView/updateBillLineRecommendationsInLocalStore", never, never>, discardBillUpdatesInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
30
33
  billId?: ID;
31
34
  }, "editBillView/discardBillUpdatesInLocalStore">, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isForMarkAsPaid: boolean, isApproverMarkingAsPaid: boolean, billId?: string | undefined], {
32
35
  billStageCode: "paid" | "pending_approval" | "scheduled" | "draft";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateShouldReplaceBillData = exports.replaceBillFileInLocalStore = exports.removeBillFileFromLocalStore = exports.updateWithdrawFromAccountId = exports.updateNewAddedBillPaymentAccount = exports.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
4
+ exports.updateShouldReplaceBillData = exports.replaceBillFileInLocalStore = exports.removeBillFileFromLocalStore = exports.updateWithdrawFromAccountId = exports.updateNewAddedBillPaymentAccount = exports.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.updateBillLineRecommendationsInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const amount_1 = require("../../../../commonStateTypes/amount");
7
7
  const attachmentPayload_1 = require("../../../../entity/transaction/payloadTypes/attachmentPayload");
@@ -153,6 +153,23 @@ const editBillView = (0, toolkit_1.createSlice)({
153
153
  }
154
154
  }
155
155
  },
156
+ // Applied when the standalone recommendations fetch resolves after the
157
+ // edit local store was already initialized. `initializeBillToLocalStore`
158
+ // is guarded to run once, so without this the late recommendations would
159
+ // never reach the category/class autofill or the "update to" checkbox.
160
+ updateBillLineRecommendationsInLocalStore: {
161
+ reducer(draft, action) {
162
+ const { billId, updatesByLineId } = action.payload;
163
+ const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
164
+ const editBill = draft.editBillStateById[key];
165
+ if (editBill != null) {
166
+ editBill.billDetailLocalData.updatesByLineId = Object.assign({}, editBill.billDetailLocalData.updatesByLineId, updatesByLineId);
167
+ }
168
+ },
169
+ prepare(billId, updatesByLineId) {
170
+ return { payload: { billId, updatesByLineId } };
171
+ },
172
+ },
156
173
  discardBillUpdatesInLocalStore(draft, action) {
157
174
  if (action.payload.billId != null) {
158
175
  const { billId } = action.payload;
@@ -498,7 +515,7 @@ const editBillView = (0, toolkit_1.createSlice)({
498
515
  });
499
516
  },
500
517
  });
501
- _a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData, exports.updateNewAddedBillPaymentAccount = _a.updateNewAddedBillPaymentAccount, exports.updateWithdrawFromAccountId = _a.updateWithdrawFromAccountId, exports.removeBillFileFromLocalStore = _a.removeBillFileFromLocalStore, exports.replaceBillFileInLocalStore = _a.replaceBillFileInLocalStore, exports.updateShouldReplaceBillData = _a.updateShouldReplaceBillData;
518
+ _a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.updateBillLineRecommendationsInLocalStore = _a.updateBillLineRecommendationsInLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData, exports.updateNewAddedBillPaymentAccount = _a.updateNewAddedBillPaymentAccount, exports.updateWithdrawFromAccountId = _a.updateWithdrawFromAccountId, exports.removeBillFileFromLocalStore = _a.removeBillFileFromLocalStore, exports.replaceBillFileInLocalStore = _a.replaceBillFileInLocalStore, exports.updateShouldReplaceBillData = _a.updateShouldReplaceBillData;
502
519
  exports.default = editBillView.reducer;
503
520
  function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
504
521
  const recurringBillDetail = (0, helpers_1.updateRecurringBillDetails)(currentConfig, prevConfig, billDetail.recurringBillInstances, billDetail.recipientTotalAmount?.amount);
@@ -99,6 +99,7 @@ export interface EditBillDetailSelectorView extends SelectorView {
99
99
  payNowCutOffTime?: ZeniDate;
100
100
  qboId?: ID;
101
101
  recommendationByLineID?: RecommendationByLineId;
102
+ recommendationsFetchStatus?: FetchStateAndError;
102
103
  recommendedVendor?: Vendor;
103
104
  recurringBillInstances?: RecurringBillInstance[];
104
105
  recurringConfig?: RecurringBillConfigLocalData;
@@ -389,6 +389,9 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
389
389
  classHierarchyList,
390
390
  latestApprovedDate: (0, helpers_1.getLatestApprovalDate)(billActivities),
391
391
  recommendationByLineID: recommendations,
392
+ recommendationsFetchStatus: billId != null
393
+ ? billDetailViewState.billDetailById[(0, billDetailViewState_1.getBillTransactionDetailKey)(billId)]?.recommendationsFetchStatus
394
+ : undefined,
392
395
  isRecurring,
393
396
  recurringBillInstances,
394
397
  recurringConfig,
@@ -0,0 +1,18 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../../reducer';
4
+ import { fetchBillRecommendationsSuccess } from '../../billDetailView/billDetailViewReducer';
5
+ import { updateBillLineRecommendationsInLocalStore } from '../editBillViewReducer';
6
+ export type ActionType = ReturnType<typeof fetchBillRecommendationsSuccess> | ReturnType<typeof updateBillLineRecommendationsInLocalStore>;
7
+ /**
8
+ * Back-fills the edit local store once the standalone recommendations fetch
9
+ * resolves. `initializeBillToLocalStore` reads `transaction.recommendations`
10
+ * exactly once and is guarded against re-running, so the recommendation-derived
11
+ * line data (category/class autofill, `recommendedCategory` / `recommendedClass`
12
+ * behind the "update to" checkbox) has to be recomputed here instead.
13
+ *
14
+ * Recomputes from the entity lines with the same helper the initializer uses, so
15
+ * an untouched line ends up exactly as it would have had the recommendations
16
+ * been present at init time.
17
+ */
18
+ export declare const applyBillRecommendationsToLocalStoreEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.applyBillRecommendationsToLocalStoreEpic = void 0;
7
+ const get_1 = __importDefault(require("lodash/get"));
8
+ const rxjs_1 = require("rxjs");
9
+ const operators_1 = require("rxjs/operators");
10
+ const accountListSelector_1 = require("../../../../accountList/accountListSelector");
11
+ const classListSelector_1 = require("../../../../classList/classListSelector");
12
+ const billDetailViewReducer_1 = require("../../billDetailView/billDetailViewReducer");
13
+ const billDetailViewState_1 = require("../../billDetailView/billDetailViewState");
14
+ const editBillViewReducer_1 = require("../editBillViewReducer");
15
+ const initializeBillToLocalStoreEpic_1 = require("./initializeBillToLocalStoreEpic");
16
+ /**
17
+ * Back-fills the edit local store once the standalone recommendations fetch
18
+ * resolves. `initializeBillToLocalStore` reads `transaction.recommendations`
19
+ * exactly once and is guarded against re-running, so the recommendation-derived
20
+ * line data (category/class autofill, `recommendedCategory` / `recommendedClass`
21
+ * behind the "update to" checkbox) has to be recomputed here instead.
22
+ *
23
+ * Recomputes from the entity lines with the same helper the initializer uses, so
24
+ * an untouched line ends up exactly as it would have had the recommendations
25
+ * been present at init time.
26
+ */
27
+ const applyBillRecommendationsToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.fetchBillRecommendationsSuccess.match),
28
+ // The skip paths resolve the status without fetching — a draft whose
29
+ // recommendations came on the bill detail response, or a stage that is not
30
+ // served any. `initializeBillToLocalStore` has already read those, so
31
+ // recomputing here would only reset the line's "update to" selections.
32
+ (0, operators_1.filter)((action) => action.payload.didWriteRecommendations), (0, operators_1.mergeMap)((action) => {
33
+ const { billId } = action.payload;
34
+ const state = state$.value;
35
+ const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
36
+ const editBillState = (0, get_1.default)(state.editBillDetailViewState.editBillStateById, key, undefined);
37
+ const transaction = (0, get_1.default)(state.billTransactionState.transactionById, billId, undefined);
38
+ const recommendations = transaction?.recommendations;
39
+ if (editBillState == null ||
40
+ transaction == null ||
41
+ transaction.lines == null ||
42
+ recommendations == null ||
43
+ Object.keys(recommendations).length === 0) {
44
+ return rxjs_1.EMPTY;
45
+ }
46
+ const localData = editBillState.billDetailLocalData;
47
+ // The recommendations were requested for the vendor on the bill. If the
48
+ // user has since switched vendors, `fetchVendorAndUpdateBillLocalData`
49
+ // owns the line data and these are stale — leave it alone.
50
+ //
51
+ // Both sides are QBO ids despite the field names suggesting otherwise.
52
+ // `transaction.vendor` is built by `mapVendorBasePayloadToVendorBase`,
53
+ // whose id is `getVendorPayloadIdentifier` = `vendor_id ?? qbo_id`, and
54
+ // on a bill transaction payload `vendor_id` IS the QBO id — the Zeni id
55
+ // rides separately as `zeni_vendor_id`. Verified against live DEV and QA
56
+ // responses, both of which have `vendor_id === qbo_vendor_id`.
57
+ if (localData.vendor?.qboId !== transaction.vendor?.id) {
58
+ return rxjs_1.EMPTY;
59
+ }
60
+ const accountList = (0, accountListSelector_1.getAccountList)(state.accountState, state.accountListState, 'billPayAccountList');
61
+ const classList = (0, classListSelector_1.getClassList)(state.classState, state.classListState);
62
+ const updatesByLineId = {};
63
+ transaction.lines.forEach((line) => {
64
+ // A line whose category/class the user already set keeps their input.
65
+ const localLine = localData.updatesByLineId[line.id];
66
+ if (localLine?.isCategoryOrClassUpdated) {
67
+ return;
68
+ }
69
+ // The helper spreads whatever line it is given into its result, and
70
+ // the reducer replaces the entry wholesale, so the local line has to
71
+ // go in or edits that leave `isCategoryOrClassUpdated` untouched — an
72
+ // amount or description changed while this fetch was in flight — get
73
+ // reverted.
74
+ //
75
+ // Category and class are the exception and come from the ENTITY line,
76
+ // exactly as at init. By now the local line may hold a category the
77
+ // vendor default autofilled when no recommendation was available yet,
78
+ // and the helper reads whatever it is given as the line's original
79
+ // value and will not replace one. Passing that back would leave an
80
+ // untouched line on the vendor default instead of the per-line
81
+ // recommendation, so the back-fill would not match what init would
82
+ // have produced had the recommendations been there all along.
83
+ const localLineWithEntityCategory = localLine == null || hasAccountAndClass(line) === false
84
+ ? line
85
+ : {
86
+ ...localLine,
87
+ account: line.account,
88
+ class: line.class,
89
+ };
90
+ updatesByLineId[line.id] = (0, initializeBillToLocalStoreEpic_1.getLineRecommendationsLocalData)(line.id, localLineWithEntityCategory, recommendations, accountList, classList, localData.vendor);
91
+ });
92
+ if (Object.keys(updatesByLineId).length === 0) {
93
+ return rxjs_1.EMPTY;
94
+ }
95
+ return (0, rxjs_1.of)((0, editBillViewReducer_1.updateBillLineRecommendationsInLocalStore)(billId, updatesByLineId));
96
+ }));
97
+ exports.applyBillRecommendationsToLocalStoreEpic = applyBillRecommendationsToLocalStoreEpic;
98
+ // Only some `Line` members carry a category and class. A guard rather than a
99
+ // cast so a shape change is a compile error, not a silent `undefined`.
100
+ function hasAccountAndClass(line) {
101
+ return 'account' in line;
102
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.41-beta5MM",
3
+ "version": "5.2.41-beta7MM",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -76,7 +76,7 @@
76
76
  "semver": "^7.7.1",
77
77
  "typescript": "^5.7.3",
78
78
  "vite": "^7.3.5",
79
- "vitest": "^4.1.8"
79
+ "vitest": "^4.1.11"
80
80
  },
81
81
  "dependencies": {
82
82
  "@redux-devtools/extension": "^3.3.0",