@zeniai/client-epic-state 5.2.30 → 5.2.32-betaAK0

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 (200) hide show
  1. package/lib/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
  2. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +6 -0
  3. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +12 -1
  4. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  5. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  6. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  7. package/lib/entity/class/classReducer.d.ts +4 -4
  8. package/lib/entity/class/classState.d.ts +1 -1
  9. package/lib/entity/forecast/forecastState.d.ts +1 -1
  10. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  11. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  12. package/lib/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -1
  13. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  14. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
  15. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
  16. package/lib/epic.d.ts +10 -6
  17. package/lib/epic.js +15 -8
  18. package/lib/esm/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
  19. package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +7 -0
  20. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  21. package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -1
  22. package/lib/esm/epic.js +14 -7
  23. package/lib/esm/index.js +16 -13
  24. package/lib/esm/reducer.js +18 -12
  25. package/lib/esm/view/cashFlow/cashFlowGroupedSectionOrder.js +47 -0
  26. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewEpic.js +30 -0
  27. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewReducer.js +129 -0
  28. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewSelector.js +53 -0
  29. package/lib/esm/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +55 -0
  30. package/lib/esm/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +57 -0
  31. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewEpic.js +30 -0
  32. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewReducer.js +125 -0
  33. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewSelector.js +54 -0
  34. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
  35. package/lib/esm/view/financeStatement/financeStatementSelector.js +21 -1
  36. package/lib/esm/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.js +1 -1
  37. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +1 -1
  38. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +1 -24
  39. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +10 -36
  40. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.js +2 -21
  41. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +11 -33
  42. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +9 -1
  43. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +2 -0
  44. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +1 -1
  45. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +15 -0
  46. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +1 -1
  47. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +1 -1
  48. package/lib/esm/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewEpics.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewEpics.js} +1 -1
  49. package/lib/esm/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewReducer.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewReducer.js} +4 -4
  50. package/lib/esm/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewSelector.js} +2 -4
  51. package/lib/esm/view/invoicing/{invoicingCouponDetailView → invoicingCouponRecordView}/fetchInvoicingCouponDetailEpic.js +1 -1
  52. package/lib/esm/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewPayload.js +1 -0
  53. package/lib/esm/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewReducer.js → invoicingCouponRecordView/invoicingCouponRecordViewReducer.js} +4 -4
  54. package/lib/esm/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewSelector.js → invoicingCouponRecordView/invoicingCouponRecordViewSelector.js} +2 -2
  55. package/lib/esm/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewState.js +1 -0
  56. package/lib/esm/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailEpic.js +1 -1
  57. package/lib/esm/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailPageEpic.js +2 -2
  58. package/lib/esm/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewPayload.js +1 -0
  59. package/lib/esm/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewReducer.js → invoicingCustomerRecordView/invoicingCustomerRecordViewReducer.js} +4 -4
  60. package/lib/esm/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js → invoicingCustomerRecordView/invoicingCustomerRecordViewSelector.js} +3 -3
  61. package/lib/esm/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewState.js +1 -0
  62. package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewEpics.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewEpics.js} +1 -1
  63. package/lib/esm/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewPayload.js +1 -0
  64. package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer.js} +4 -4
  65. package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewSelector.js} +2 -2
  66. package/lib/esm/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewState.js +1 -0
  67. package/lib/esm/view/invoicing/promotionalCreditAction/promotionalCreditActionEpic.js +1 -1
  68. package/lib/index.d.ts +26 -20
  69. package/lib/index.js +88 -74
  70. package/lib/reducer.d.ts +6 -4
  71. package/lib/reducer.js +18 -12
  72. package/lib/rootStateTypes.d.ts +12 -8
  73. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  74. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  75. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  76. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  77. package/lib/view/cashFlow/cashFlowGroupedSectionOrder.d.ts +15 -0
  78. package/lib/view/cashFlow/cashFlowGroupedSectionOrder.js +50 -0
  79. package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.d.ts +6 -0
  80. package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.js +34 -0
  81. package/lib/view/cashFlowClassesView/cashFlowClassesViewPayload.d.ts +14 -0
  82. package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.d.ts +34 -0
  83. package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.js +133 -0
  84. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.d.ts +7 -0
  85. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.js +57 -0
  86. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.d.ts +15 -0
  87. package/lib/view/cashFlowClassesView/cashFlowClassesViewState.d.ts +23 -0
  88. package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.d.ts +9 -0
  89. package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +60 -0
  90. package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.d.ts +10 -0
  91. package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +62 -0
  92. package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.d.ts +6 -0
  93. package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.js +34 -0
  94. package/lib/view/cashFlowProjectView/cashFlowProjectViewPayload.d.ts +14 -0
  95. package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.d.ts +33 -0
  96. package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.js +129 -0
  97. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.d.ts +7 -0
  98. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.js +58 -0
  99. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.d.ts +19 -0
  100. package/lib/view/cashFlowProjectView/cashFlowProjectViewState.d.ts +22 -0
  101. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  102. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  103. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  104. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
  105. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  106. package/lib/view/financeStatement/financeStatementSelector.d.ts +4 -0
  107. package/lib/view/financeStatement/financeStatementSelector.js +21 -1
  108. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  109. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
  110. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.d.ts +1 -1
  111. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.js +2 -2
  112. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +1 -1
  113. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +1 -1
  114. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.d.ts +3 -19
  115. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +2 -25
  116. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +11 -11
  117. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +11 -38
  118. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +4 -27
  119. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.d.ts +2 -3
  120. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.js +2 -22
  121. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -2
  122. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +9 -31
  123. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +12 -1
  124. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +9 -1
  125. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +8 -0
  126. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +2 -0
  127. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.d.ts +1 -1
  128. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +2 -2
  129. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +11 -2
  130. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +15 -0
  131. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.d.ts +1 -1
  132. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +2 -2
  133. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.d.ts +1 -1
  134. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +2 -2
  135. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewEpics.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewEpics.d.ts} +1 -1
  136. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewEpics.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewEpics.js} +5 -5
  137. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewReducer.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewReducer.d.ts} +5 -5
  138. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewReducer.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewReducer.js} +4 -4
  139. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewSelector.d.ts} +3 -5
  140. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewSelector.js} +4 -6
  141. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewState.d.ts} +1 -1
  142. package/lib/view/invoicing/{invoicingCouponDetailView → invoicingCouponRecordView}/fetchInvoicingCouponDetailEpic.d.ts +1 -1
  143. package/lib/view/invoicing/{invoicingCouponDetailView → invoicingCouponRecordView}/fetchInvoicingCouponDetailEpic.js +5 -5
  144. package/lib/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewPayload.js +2 -0
  145. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewReducer.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewReducer.d.ts} +6 -6
  146. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewReducer.js → invoicingCouponRecordView/invoicingCouponRecordViewReducer.js} +4 -4
  147. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewSelector.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewSelector.d.ts} +2 -2
  148. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewSelector.js → invoicingCouponRecordView/invoicingCouponRecordViewSelector.js} +4 -4
  149. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewState.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewState.d.ts} +1 -1
  150. package/lib/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewState.js +2 -0
  151. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailEpic.d.ts +1 -1
  152. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailEpic.js +5 -5
  153. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailPageEpic.d.ts +1 -1
  154. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailPageEpic.js +4 -4
  155. package/lib/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewPayload.js +2 -0
  156. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewReducer.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewReducer.d.ts} +7 -7
  157. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewReducer.js → invoicingCustomerRecordView/invoicingCustomerRecordViewReducer.js} +4 -4
  158. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewSelector.d.ts} +2 -2
  159. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js → invoicingCustomerRecordView/invoicingCustomerRecordViewSelector.js} +5 -5
  160. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewState.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewState.d.ts} +1 -1
  161. package/lib/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewState.js +2 -0
  162. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewEpics.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewEpics.d.ts} +1 -1
  163. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewEpics.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewEpics.js} +5 -5
  164. package/lib/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewPayload.js +2 -0
  165. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer.d.ts} +5 -5
  166. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer.js} +4 -4
  167. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewSelector.d.ts} +2 -2
  168. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewSelector.js} +4 -4
  169. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewState.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewState.d.ts} +1 -1
  170. package/lib/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewState.js +2 -0
  171. package/lib/view/invoicing/promotionalCreditAction/promotionalCreditActionEpic.d.ts +1 -1
  172. package/lib/view/invoicing/promotionalCreditAction/promotionalCreditActionEpic.js +2 -2
  173. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  174. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  175. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  176. package/lib/view/topEx/topExSelector.d.ts +1 -1
  177. package/package.json +71 -38
  178. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +0 -191
  179. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +0 -46
  180. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +0 -198
  181. /package/lib/esm/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewPayload.js} +0 -0
  182. /package/lib/esm/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState.js → cashFlowClassesView/cashFlowClassesViewSelectorTypes.js} +0 -0
  183. /package/lib/esm/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewState.js} +0 -0
  184. /package/lib/esm/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewState.js → cashFlowProjectView/cashFlowProjectViewPayload.js} +0 -0
  185. /package/lib/esm/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewPayload.js → cashFlowProjectView/cashFlowProjectViewSelectorTypes.js} +0 -0
  186. /package/lib/esm/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewState.js → cashFlowProjectView/cashFlowProjectViewState.js} +0 -0
  187. /package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewPayload.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewPayload.js} +0 -0
  188. /package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewState.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewState.js} +0 -0
  189. /package/lib/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewPayload.js} +0 -0
  190. /package/lib/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState.js → cashFlowClassesView/cashFlowClassesViewSelectorTypes.js} +0 -0
  191. /package/lib/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewState.js} +0 -0
  192. /package/lib/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewState.js → cashFlowProjectView/cashFlowProjectViewPayload.js} +0 -0
  193. /package/lib/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewPayload.js → cashFlowProjectView/cashFlowProjectViewSelectorTypes.js} +0 -0
  194. /package/lib/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewState.js → cashFlowProjectView/cashFlowProjectViewState.js} +0 -0
  195. /package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewPayload.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewPayload.d.ts} +0 -0
  196. /package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewPayload.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewPayload.js} +0 -0
  197. /package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewState.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewState.js} +0 -0
  198. /package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewPayload.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewPayload.d.ts} +0 -0
  199. /package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewPayload.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewPayload.d.ts} +0 -0
  200. /package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewPayload.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewPayload.d.ts} +0 -0
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.archiveInvoicingCatalogSubFamilyEpic = exports.createInvoicingCatalogSubFamilyEpic = void 0;
3
+ exports.archiveInvoicingCatalogSubFamilyEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const planReducer_1 = require("../../../entity/invoicing/plan/planReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
- const invoicingQboViewSelector_1 = require("../invoicingQboView/invoicingQboViewSelector");
9
- const catalogDetailEditPayload_1 = require("./catalogDetailEditPayload");
10
8
  const editInvoicingCatalogItemDetailViewReducer_1 = require("./editInvoicingCatalogItemDetailViewReducer");
11
9
  const subFamilySuccessActions = (parentItemId, subFamilyPayload) => [
12
10
  (0, planReducer_1.mergeInvoicingPlanSubFamily)(parentItemId, subFamilyPayload),
@@ -15,24 +13,6 @@ const subFamilySuccessActions = (parentItemId, subFamilyPayload) => [
15
13
  kind: 'plan',
16
14
  }),
17
15
  ];
18
- const createInvoicingCatalogSubFamilyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(editInvoicingCatalogItemDetailViewReducer_1.createInvoicingCatalogSubFamily.match), (0, operators_1.mergeMap)((action) => {
19
- const { itemType, parentItemId, values } = action.payload;
20
- const state = state$.value;
21
- // Built here so the dialog can stay in picked ids: resolving one to the
22
- // account record the payload carries needs the shared account list.
23
- const data = (0, catalogDetailEditPayload_1.createSubFamilyFormToPayload)(parentItemId, itemType, values, (0, invoicingQboViewSelector_1.getInvoicingCatalogAccountingLookup)(state));
24
- const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
25
- return zeniAPI
26
- .postAndGetJSON(`${baseUrl}/catalog/products`, data)
27
- .pipe((0, operators_1.mergeMap)((response) => {
28
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
29
- return subFamilySuccessActions(parentItemId, response.data);
30
- }
31
- return (0, rxjs_1.of)((0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)(response.status));
32
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Create sub-family REST API call errored out ' +
33
- JSON.stringify(error))))));
34
- }));
35
- exports.createInvoicingCatalogSubFamilyEpic = createInvoicingCatalogSubFamilyEpic;
36
16
  const archiveInvoicingCatalogSubFamilyEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(editInvoicingCatalogItemDetailViewReducer_1.archiveInvoicingCatalogSubFamily.match), (0, operators_1.mergeMap)((action) => {
37
17
  const { parentItemId, subFamilyId } = action.payload;
38
18
  const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
@@ -44,7 +24,7 @@ const archiveInvoicingCatalogSubFamilyEpic = (actions$, _state$, zeniAPI) => act
44
24
  return subFamilySuccessActions(parentItemId, response.data);
45
25
  }
46
26
  return (0, rxjs_1.of)((0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)(response.status));
47
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Archive sub-family REST API call errored out ' +
27
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Archive price point REST API call errored out ' +
48
28
  JSON.stringify(error))))));
49
29
  }));
50
30
  exports.archiveInvoicingCatalogSubFamilyEpic = archiveInvoicingCatalogSubFamilyEpic;
@@ -6,6 +6,6 @@ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
6
6
  import { RootState } from '../../../rootStateTypes';
7
7
  import { ZeniAPI } from '../../../zeniAPI';
8
8
  import { addInvoicingCatalogItem } from '../invoicingCatalogListView/invoicingCatalogListViewReducer';
9
- import { saveInvoicingCatalogItem, submitInvoicingCatalogItemForm, submitInvoicingCatalogItemFormFailure, submitInvoicingCatalogItemFormSuccess } from './editInvoicingCatalogItemDetailViewReducer';
10
- export type ActionType = ReturnType<typeof submitInvoicingCatalogItemForm> | ReturnType<typeof saveInvoicingCatalogItem> | ReturnType<typeof submitInvoicingCatalogItemFormSuccess> | ReturnType<typeof submitInvoicingCatalogItemFormFailure> | ReturnType<typeof updateInvoicingPlans> | ReturnType<typeof updateInvoicingProducts> | ReturnType<typeof mergeInvoicingPlanSubFamily> | ReturnType<typeof addInvoicingCatalogItem> | ReturnType<typeof openSnackbar>;
9
+ import { submitInvoicingCatalogItemForm, submitInvoicingCatalogItemFormFailure, submitInvoicingCatalogItemFormSuccess } from './editInvoicingCatalogItemDetailViewReducer';
10
+ export type ActionType = ReturnType<typeof submitInvoicingCatalogItemForm> | ReturnType<typeof submitInvoicingCatalogItemFormSuccess> | ReturnType<typeof submitInvoicingCatalogItemFormFailure> | ReturnType<typeof updateInvoicingPlans> | ReturnType<typeof updateInvoicingProducts> | ReturnType<typeof mergeInvoicingPlanSubFamily> | ReturnType<typeof addInvoicingCatalogItem> | ReturnType<typeof openSnackbar>;
11
11
  export declare const saveInvoicingCatalogItemEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.saveInvoicingCatalogItemEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const planSelector_1 = require("../../../entity/invoicing/plan/planSelector");
7
6
  const planReducer_1 = require("../../../entity/invoicing/plan/planReducer");
8
7
  const productReducer_1 = require("../../../entity/invoicing/product/productReducer");
9
8
  const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
@@ -11,34 +10,19 @@ const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
11
10
  const responsePayload_1 = require("../../../responsePayload");
12
11
  const invoicingCatalogListViewReducer_1 = require("../invoicingCatalogListView/invoicingCatalogListViewReducer");
13
12
  const invoicingQboViewSelector_1 = require("../invoicingQboView/invoicingQboViewSelector");
14
- const catalogDetailEditPayload_1 = require("./catalogDetailEditPayload");
15
13
  const editInvoicingCatalogItemDetailViewPayload_1 = require("./editInvoicingCatalogItemDetailViewPayload");
16
- const editInvoicingCatalogItemDetailViewSelector_1 = require("./editInvoicingCatalogItemDetailViewSelector");
17
14
  const editInvoicingCatalogItemDetailViewReducer_1 = require("./editInvoicingCatalogItemDetailViewReducer");
18
- const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)((action) => editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemForm.match(action) ||
19
- editInvoicingCatalogItemDetailViewReducer_1.saveInvoicingCatalogItem.match(action)), (0, operators_1.mergeMap)((action) => {
15
+ const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)((action) => editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemForm.match(action)), (0, operators_1.mergeMap)((action) => {
20
16
  const { id } = action.payload;
21
17
  const state = state$.value;
22
18
  const accountingLookup = (0, invoicingQboViewSelector_1.getInvoicingCatalogAccountingLookup)(state);
23
- // Both sources are form values, turned into request bodies here so the
24
- // picked account and class become the records the service stores: the
25
- // detail page's edit form, or the create/edit form's draft.
26
- let data;
27
- let editProductUpdates;
28
- if (editInvoicingCatalogItemDetailViewReducer_1.saveInvoicingCatalogItem.match(action)) {
29
- const plan = id != null
30
- ? (0, planSelector_1.getInvoicingPlanById)(state.invoicingPlanState, id)
31
- : undefined;
32
- const savePayload = (0, catalogDetailEditPayload_1.catalogDetailEditValuesToSavePayload)((0, editInvoicingCatalogItemDetailViewSelector_1.getInvoicingCatalogItemDetailEditLocalData)(state, id), accountingLookup, plan?.type ?? plan?.itemType, plan?.subFamilies);
33
- data = savePayload.planData;
34
- editProductUpdates = savePayload.productUpdates;
35
- }
36
- else {
37
- const viewState = state.editInvoicingCatalogItemDetailViewState;
38
- const localData = (id != null ? viewState.editDraftById[id] : viewState.newItemDraft) ??
39
- viewState.newItemDraft;
40
- data = (0, editInvoicingCatalogItemDetailViewPayload_1.localDataToSaveInvoicingCatalogItemPayload)(localData, id == null, accountingLookup);
41
- }
19
+ // Form values, turned into a request body here so the picked account and
20
+ // class become the records the service stores. Price points ride along
21
+ // nested, so the detail page and the create/edit form share one request.
22
+ const viewState = state.editInvoicingCatalogItemDetailViewState;
23
+ const localData = (id != null ? viewState.editDraftById[id] : viewState.newItemDraft) ??
24
+ viewState.newItemDraft;
25
+ const data = (0, editInvoicingCatalogItemDetailViewPayload_1.localDataToSaveInvoicingCatalogItemPayload)(localData, id == null, accountingLookup);
42
26
  const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
43
27
  const path = id != null
44
28
  ? `${baseUrl}/catalog/plans/${encodeURIComponent(id)}`
@@ -99,13 +83,7 @@ const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pip
99
83
  }));
100
84
  return resultActions;
101
85
  };
102
- const productUpdates = editInvoicingCatalogItemDetailViewReducer_1.saveInvoicingCatalogItem.match(action)
103
- ? (editProductUpdates ?? [])
104
- : [];
105
- if (productUpdates.length === 0) {
106
- return completeSave([]);
107
- }
108
- return (0, rxjs_1.forkJoin)(productUpdates.map((productUpdate) => zeniAPI.putAndGetJSON(`${baseUrl}/catalog/products/${encodeURIComponent(productUpdate.id)}`, productUpdate.data))).pipe((0, operators_1.mergeMap)(completeSave));
86
+ return completeSave([]);
109
87
  }
110
88
  return (0, rxjs_1.from)([
111
89
  (0, editInvoicingCatalogItemDetailViewReducer_1.submitInvoicingCatalogItemFormFailure)(response.status),
@@ -1,4 +1,4 @@
1
- import { FetchState, ID } from '../../../commonStateTypes/common';
1
+ import { FetchState, FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { InvoicingCoupon } from '../../../entity/invoicing/coupon/couponState';
4
4
  import { InvoicingDiscountLifecycleActionOption, InvoicingFieldHelpByCode, InvoicingFormOption } from '../../../entity/invoicing/invoicingCommonPayload';
@@ -8,6 +8,17 @@ export interface EditInvoicingCouponDetailView extends SelectorView {
8
8
  /** Config-owned; folded in so the screen reads one selector. */
9
9
  configFetchState: FetchState;
10
10
  discountLifecycleActionOptions: InvoicingDiscountLifecycleActionOption[];
11
+ /**
12
+ * Backend help copy for this screen's field group, keyed by field code.
13
+ * Folded in here so the screen never reaches for the config view itself.
14
+ */
15
+ fieldHelp: InvoicingFieldHelpByCode;
16
+ /**
17
+ * Loading the coupon, as distinct from this view's own `fetchState`, which
18
+ * tracks the save. Folded in from the read view so a screen reads one
19
+ * selector rather than pairing this one with it.
20
+ */
21
+ recordState: FetchStateAndError;
11
22
  coupon?: InvoicingCoupon;
12
23
  savedCouponId?: ID;
13
24
  }
@@ -4,6 +4,7 @@ exports.getInvoicingCouponFormView = exports.getEditInvoicingCouponDetailViewSta
4
4
  const couponSelector_1 = require("../../../entity/invoicing/coupon/couponSelector");
5
5
  const invoicingCommonPayload_1 = require("../../../entity/invoicing/invoicingCommonPayload");
6
6
  const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
7
+ const invoicingCouponRecordViewSelector_1 = require("../invoicingCouponRecordView/invoicingCouponRecordViewSelector");
7
8
  const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetailViewState");
8
9
  /**
9
10
  * Bundled view for the discount create/edit form: the save fetch state/error,
@@ -13,9 +14,17 @@ const editInvoicingCouponDetailViewState_1 = require("./editInvoicingCouponDetai
13
14
  const getEditInvoicingCouponDetailViewState = (state, couponId) => {
14
15
  const { error, fetchState, savedCouponId } = state.editInvoicingCouponDetailViewState;
15
16
  const { discountLifecycleActionOptions, fetchState: configFetchState } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
17
+ // In create mode there is no record to load, so the read view is only
18
+ // consulted when editing an existing coupon.
19
+ const readView = couponId != null ? (0, invoicingCouponRecordViewSelector_1.getInvoicingCouponRecord)(state, couponId) : undefined;
16
20
  return {
17
21
  configFetchState,
18
22
  discountLifecycleActionOptions,
23
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'discount'),
24
+ recordState: {
25
+ error: readView?.error,
26
+ fetchState: readView?.fetchState ?? 'Not-Started',
27
+ },
19
28
  coupon: couponId != null
20
29
  ? (0, couponSelector_1.getInvoicingCouponById)(state.invoicingCouponState, couponId)
21
30
  : undefined,
@@ -41,7 +50,6 @@ const getInvoicingCouponFormView = (state, couponId) => {
41
50
  : newCouponDraft;
42
51
  const { billingPeriodUnitOptions, discountApplyOnOptions, discountDurationTypeOptions, discountTypeOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
43
52
  return {
44
- fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'discount'),
45
53
  ...base,
46
54
  applyOnOptions: discountApplyOnOptions.map(invoicingCommonPayload_1.toInvoicingFormOption),
47
55
  discountTypeOptions: discountTypeOptions.map(invoicingCommonPayload_1.toInvoicingFormOption),
@@ -2,6 +2,7 @@ import { ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { InvoicingFieldHelpByCode, InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
4
4
  import { RootState } from '../../../rootStateTypes';
5
+ import { type InvoicingCustomerRecordView } from '../invoicingCustomerRecordView/invoicingCustomerRecordViewSelector';
5
6
  import { InvoicingCustomerFormLocalData } from './editInvoicingCustomerDetailViewState';
6
7
  export interface InvoicingCustomerFormView extends SelectorView {
7
8
  customerTypeOptions: InvoicingNamedOption[];
@@ -13,6 +14,13 @@ export interface InvoicingCustomerFormView extends SelectorView {
13
14
  localData: InvoicingCustomerFormLocalData;
14
15
  mode: 'create' | 'edit';
15
16
  netTermDayOptions: InvoicingNamedOption[];
17
+ /**
18
+ * The record and everything the detail page renders alongside it — invoices,
19
+ * payment methods, branding, Stripe state. Nested rather than flattened: it
20
+ * is a page's worth of state, and spreading it here would bury this view's
21
+ * own form fields. Screens read one selector and reach through this.
22
+ */
23
+ record: InvoicingCustomerRecordView;
16
24
  taxabilityOptions: InvoicingNamedOption[];
17
25
  billingAddressId?: ID;
18
26
  billingAddressLabel?: string;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInvoicingCustomerFormView = void 0;
4
4
  const invoicingCustomerSelector_1 = require("../../../entity/invoicing/invoicingCustomer/invoicingCustomerSelector");
5
5
  const addressViewSelector_1 = require("../../addressView/addressViewSelector");
6
+ const invoicingCustomerRecordViewSelector_1 = require("../invoicingCustomerRecordView/invoicingCustomerRecordViewSelector");
6
7
  const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
7
8
  const invoicingCustomerFormConfig_1 = require("./invoicingCustomerFormConfig");
8
9
  /**
@@ -32,6 +33,7 @@ const getInvoicingCustomerFormView = (state, invoicingCustomerID) => {
32
33
  : undefined;
33
34
  const { customerTypeOptions, netTermDayOptions, taxabilityOptions } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
34
35
  return {
36
+ record: (0, invoicingCustomerRecordViewSelector_1.getInvoicingCustomerRecord)(state, invoicingCustomerID ?? ''),
35
37
  fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'customer'),
36
38
  customerTypeOptions,
37
39
  localData,
@@ -2,7 +2,7 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { RootState } from '../../../rootStateTypes';
4
4
  import { newAddressInLocalStore } from '../../addressView/addressViewReducer';
5
- import { updateInvoicingCustomerDetail } from '../invoicingCustomerDetailView/invoicingCustomerDetailViewReducer';
5
+ import { updateInvoicingCustomerDetail } from '../invoicingCustomerRecordView/invoicingCustomerRecordViewReducer';
6
6
  import { initializeInvoicingCustomerAddress } from './editInvoicingCustomerDetailViewReducer';
7
7
  export type ActionType = ReturnType<typeof initializeInvoicingCustomerAddress> | ReturnType<typeof updateInvoicingCustomerDetail> | ReturnType<typeof newAddressInLocalStore>;
8
8
  /**
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
6
6
  const addressSelector_1 = require("../../../entity/address/addressSelector");
7
7
  const invoicingCustomerSelector_1 = require("../../../entity/invoicing/invoicingCustomer/invoicingCustomerSelector");
8
8
  const addressViewReducer_1 = require("../../addressView/addressViewReducer");
9
- const invoicingCustomerDetailViewReducer_1 = require("../invoicingCustomerDetailView/invoicingCustomerDetailViewReducer");
9
+ const invoicingCustomerRecordViewReducer_1 = require("../invoicingCustomerRecordView/invoicingCustomerRecordViewReducer");
10
10
  const editInvoicingCustomerDetailViewReducer_1 = require("./editInvoicingCustomerDetailViewReducer");
11
11
  const invoicingCustomerFormConfig_1 = require("./invoicingCustomerFormConfig");
12
12
  /**
@@ -18,7 +18,7 @@ const invoicingCustomerFormConfig_1 = require("./invoicingCustomerFormConfig");
18
18
  * `initializeVendorAddressEpic`.
19
19
  */
20
20
  const initializeInvoicingCustomerAddressEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)((action) => editInvoicingCustomerDetailViewReducer_1.initializeInvoicingCustomerAddress.match(action) ||
21
- invoicingCustomerDetailViewReducer_1.updateInvoicingCustomerDetail.match(action)), (0, operators_1.mergeMap)((action) => {
21
+ invoicingCustomerRecordViewReducer_1.updateInvoicingCustomerDetail.match(action)), (0, operators_1.mergeMap)((action) => {
22
22
  const { id } = action.payload;
23
23
  const rootState = state$.value;
24
24
  const existingDraft = rootState.addressViewState.newAddressState?.[invoicingCustomerFormConfig_1.INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE]?.addressToCreate;
@@ -1,7 +1,7 @@
1
- import { ID } from '../../../commonStateTypes/common';
1
+ import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { InvoicingCoupon } from '../../../entity/invoicing/coupon/couponState';
4
- import { InvoicingFieldHelpByCode, InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
4
+ import { InvoicingFieldHelpByCode, InvoicingNamedOption, InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
5
5
  import { InvoicingCustomer } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerState';
6
6
  import { InvoicingSubscription } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionState';
7
7
  import { InvoicingProduct } from '../../../entity/invoicing/product/productState';
@@ -30,6 +30,10 @@ export interface EditInvoicingSubscriptionDetailView extends SelectorView {
30
30
  * to its own option shapes, so this stays free of any web-components dependency.
31
31
  */
32
32
  export interface InvoicingSubscriptionFormView extends SelectorView {
33
+ /** Lifecycle action in flight, folded in from the record view. */
34
+ actionState: FetchStateAndError;
35
+ /** Cancel reasons from `/1.0/config`, so the dialog hardcodes nothing. */
36
+ cancelReasonCodeOptions: InvoicingNamedOption[];
33
37
  coupons: InvoicingCoupon[];
34
38
  customers: InvoicingCustomer[];
35
39
  /**
@@ -41,6 +45,11 @@ export interface InvoicingSubscriptionFormView extends SelectorView {
41
45
  mode: 'create' | 'edit';
42
46
  plans: InvoicingProduct[];
43
47
  products: InvoicingProduct[];
48
+ /**
49
+ * Loading the subscription, as distinct from this view's own `fetchState`,
50
+ * which tracks the save. Folded in so a screen reads one selector.
51
+ */
52
+ recordState: FetchStateAndError;
44
53
  savedSubscriptionId?: ID;
45
54
  shippingAddressLabel?: string;
46
55
  subscription?: InvoicingSubscription;
@@ -5,6 +5,7 @@ const invoicingSubscriptionSelector_1 = require("../../../entity/invoicing/invoi
5
5
  const addressViewSelector_1 = require("../../addressView/addressViewSelector");
6
6
  const couponViewSelector_1 = require("../couponView/couponViewSelector");
7
7
  const invoicingCatalogListViewSelector_1 = require("../invoicingCatalogListView/invoicingCatalogListViewSelector");
8
+ const invoicingSubscriptionRecordViewSelector_1 = require("../invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewSelector");
8
9
  const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
9
10
  const invoicingCustomerListViewSelector_1 = require("../invoicingCustomerListView/invoicingCustomerListViewSelector");
10
11
  const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
@@ -45,7 +46,21 @@ const getInvoicingSubscriptionFormView = (state, invoicingSubscriptionID) => {
45
46
  const catalogListView = (0, invoicingCatalogListViewSelector_1.getInvoicingCatalogListView)(state);
46
47
  const planPrices = (0, invoicingCatalogListViewSelector_1.getInvoicingCatalogPrices)(catalogListView.plans);
47
48
  const addonAndChargePrices = (0, invoicingCatalogListViewSelector_1.getInvoicingCatalogPrices)(catalogListView.products);
49
+ // In create mode there is no record to load, so the record view is only
50
+ // consulted when editing an existing subscription.
51
+ const recordView = invoicingSubscriptionID != null
52
+ ? (0, invoicingSubscriptionRecordViewSelector_1.getInvoicingSubscriptionRecord)(state, invoicingSubscriptionID)
53
+ : undefined;
48
54
  return {
55
+ actionState: recordView?.actionState ?? {
56
+ error: undefined,
57
+ fetchState: 'Not-Started',
58
+ },
59
+ cancelReasonCodeOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).subscriptionCancelReasonCodeOptions,
60
+ recordState: {
61
+ error: recordView?.error,
62
+ fetchState: recordView?.fetchState ?? 'Not-Started',
63
+ },
49
64
  fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'subscription'),
50
65
  coupons: (0, couponViewSelector_1.getInvoicingCouponListItems)(state),
51
66
  customers: (0, invoicingCustomerListViewSelector_1.getInvoicingCustomerListView)(state).customers,
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
3
3
  import { fetchInvoicingCouponList } from '../couponView/couponViewReducer';
4
4
  import { fetchInvoicingCatalogPlanList } from '../invoicingCatalogListView/invoicingCatalogListViewReducer';
5
5
  import { fetchInvoicingCustomerList } from '../invoicingCustomerListView/invoicingCustomerListViewReducer';
6
- import { fetchInvoicingSubscriptionDetail } from '../invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer';
6
+ import { fetchInvoicingSubscriptionDetail } from '../invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer';
7
7
  import { fetchInvoicingSubscriptionFormPage } from './editInvoicingSubscriptionDetailViewReducer';
8
8
  /**
9
9
  * Every action this epic can emit, plus the trigger it listens for. Wired into
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
6
6
  const couponViewReducer_1 = require("../couponView/couponViewReducer");
7
7
  const invoicingCatalogListViewReducer_1 = require("../invoicingCatalogListView/invoicingCatalogListViewReducer");
8
8
  const invoicingCustomerListViewReducer_1 = require("../invoicingCustomerListView/invoicingCustomerListViewReducer");
9
- const invoicingSubscriptionDetailViewReducer_1 = require("../invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer");
9
+ const invoicingSubscriptionRecordViewReducer_1 = require("../invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer");
10
10
  const editInvoicingSubscriptionDetailViewReducer_1 = require("./editInvoicingSubscriptionDetailViewReducer");
11
11
  /**
12
12
  * Orchestrates the subscription create/edit form: on
@@ -26,7 +26,7 @@ const fetchInvoicingSubscriptionFormPageEpic = (actions$) => actions$.pipe((0, o
26
26
  (0, couponViewReducer_1.fetchInvoicingCouponList)({ filters: {}, keepExistingListItems: false }),
27
27
  ];
28
28
  if (subscriptionId != null) {
29
- pageActions.push((0, invoicingSubscriptionDetailViewReducer_1.fetchInvoicingSubscriptionDetail)({ id: subscriptionId }));
29
+ pageActions.push((0, invoicingSubscriptionRecordViewReducer_1.fetchInvoicingSubscriptionDetail)({ id: subscriptionId }));
30
30
  }
31
31
  return (0, rxjs_1.concat)((0, rxjs_1.from)(pageActions));
32
32
  }));
@@ -2,7 +2,7 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { RootState } from '../../../rootStateTypes';
4
4
  import { newAddressInLocalStore } from '../../addressView/addressViewReducer';
5
- import { updateInvoicingSubscriptionDetail } from '../invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer';
5
+ import { updateInvoicingSubscriptionDetail } from '../invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer';
6
6
  import { initializeInvoicingSubscriptionAddress } from './editInvoicingSubscriptionDetailViewReducer';
7
7
  export type ActionType = ReturnType<typeof initializeInvoicingSubscriptionAddress> | ReturnType<typeof updateInvoicingSubscriptionDetail> | ReturnType<typeof newAddressInLocalStore>;
8
8
  /**
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
6
6
  const addressSelector_1 = require("../../../entity/address/addressSelector");
7
7
  const invoicingSubscriptionSelector_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionSelector");
8
8
  const addressViewReducer_1 = require("../../addressView/addressViewReducer");
9
- const invoicingSubscriptionDetailViewReducer_1 = require("../invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer");
9
+ const invoicingSubscriptionRecordViewReducer_1 = require("../invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer");
10
10
  const editInvoicingSubscriptionDetailViewReducer_1 = require("./editInvoicingSubscriptionDetailViewReducer");
11
11
  const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormConfig");
12
12
  /**
@@ -19,7 +19,7 @@ const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormCo
19
19
  * Mirrors `initializeInvoicingCustomerAddressEpic`.
20
20
  */
21
21
  const initializeInvoicingSubscriptionAddressEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)((action) => editInvoicingSubscriptionDetailViewReducer_1.initializeInvoicingSubscriptionAddress.match(action) ||
22
- invoicingSubscriptionDetailViewReducer_1.updateInvoicingSubscriptionDetail.match(action)), (0, operators_1.mergeMap)((action) => {
22
+ invoicingSubscriptionRecordViewReducer_1.updateInvoicingSubscriptionDetail.match(action)), (0, operators_1.mergeMap)((action) => {
23
23
  const { id } = action.payload;
24
24
  const rootState = state$.value;
25
25
  const existingDraft = rootState.addressViewState.newAddressState?.[invoicingSubscriptionFormConfig_1.INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE]?.addressToCreate;
@@ -3,6 +3,6 @@ import { Observable } from 'rxjs';
3
3
  import { updateInvoicingPlans } from '../../../entity/invoicing/plan/planReducer';
4
4
  import { RootState } from '../../../rootStateTypes';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
- import { fetchInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetailFailure } from './invoicingCatalogItemDetailViewReducer';
6
+ import { fetchInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetail, updateInvoicingCatalogItemDetailFailure } from './invoicingCatalogItemRecordViewReducer';
7
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>;
@@ -5,19 +5,19 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const planReducer_1 = require("../../../entity/invoicing/plan/planReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
- const invoicingCatalogItemDetailViewReducer_1 = require("./invoicingCatalogItemDetailViewReducer");
9
- const fetchInvoicingCatalogItemDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingCatalogItemDetailViewReducer_1.fetchInvoicingCatalogItemDetail.match), (0, operators_1.switchMap)((action) => {
8
+ const invoicingCatalogItemRecordViewReducer_1 = require("./invoicingCatalogItemRecordViewReducer");
9
+ const fetchInvoicingCatalogItemDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingCatalogItemRecordViewReducer_1.fetchInvoicingCatalogItemDetail.match), (0, operators_1.switchMap)((action) => {
10
10
  const { id, kind } = action.payload;
11
11
  const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/catalog/plans/${encodeURIComponent(id)}`;
12
12
  return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
13
13
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
14
14
  return [
15
15
  (0, planReducer_1.updateInvoicingPlans)([response.data], 'merge'),
16
- (0, invoicingCatalogItemDetailViewReducer_1.updateInvoicingCatalogItemDetail)({ id: response.data.id, kind }),
16
+ (0, invoicingCatalogItemRecordViewReducer_1.updateInvoicingCatalogItemDetail)({ id: response.data.id, kind }),
17
17
  ];
18
18
  }
19
- return (0, rxjs_1.of)((0, invoicingCatalogItemDetailViewReducer_1.updateInvoicingCatalogItemDetailFailure)(response.status));
20
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingCatalogItemDetailViewReducer_1.updateInvoicingCatalogItemDetailFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch catalog item detail REST API call errored out ' +
19
+ return (0, rxjs_1.of)((0, invoicingCatalogItemRecordViewReducer_1.updateInvoicingCatalogItemDetailFailure)(response.status));
20
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingCatalogItemRecordViewReducer_1.updateInvoicingCatalogItemDetailFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch catalog item detail REST API call errored out ' +
21
21
  JSON.stringify(error))))));
22
22
  }));
23
23
  exports.fetchInvoicingCatalogItemDetailEpic = fetchInvoicingCatalogItemDetailEpic;
@@ -1,13 +1,13 @@
1
1
  import { ID } from '../../../commonStateTypes/common';
2
2
  import { ZeniAPIStatus } from '../../../responsePayload';
3
- import { InvoicingCatalogItemDetailViewState, InvoicingCatalogItemKind } from './invoicingCatalogItemDetailViewState';
4
- export declare const initialState: InvoicingCatalogItemDetailViewState;
3
+ import { InvoicingCatalogItemRecordViewState, InvoicingCatalogItemKind } from './invoicingCatalogItemRecordViewState';
4
+ export declare const initialState: InvoicingCatalogItemRecordViewState;
5
5
  export declare const fetchInvoicingCatalogItemDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
6
6
  id: ID;
7
7
  kind: InvoicingCatalogItemKind;
8
- }, "invoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetail">, updateInvoicingCatalogItemDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
+ }, "invoicingCatalogItemRecordView/fetchInvoicingCatalogItemDetail">, updateInvoicingCatalogItemDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
9
  id: ID;
10
10
  kind: InvoicingCatalogItemKind;
11
- }, "invoicingCatalogItemDetailView/updateInvoicingCatalogItemDetail">, updateInvoicingCatalogItemDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingCatalogItemDetailView/updateInvoicingCatalogItemDetailFailure">;
12
- declare const _default: import("redux").Reducer<InvoicingCatalogItemDetailViewState>;
11
+ }, "invoicingCatalogItemRecordView/updateInvoicingCatalogItemDetail">, updateInvoicingCatalogItemDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingCatalogItemRecordView/updateInvoicingCatalogItemDetailFailure">;
12
+ declare const _default: import("redux").Reducer<InvoicingCatalogItemRecordViewState>;
13
13
  export default _default;
@@ -10,8 +10,8 @@ exports.initialState = {
10
10
  id: undefined,
11
11
  kind: undefined,
12
12
  };
13
- const invoicingCatalogItemDetailView = (0, toolkit_1.createSlice)({
14
- name: 'invoicingCatalogItemDetailView',
13
+ const invoicingCatalogItemRecordView = (0, toolkit_1.createSlice)({
14
+ name: 'invoicingCatalogItemRecordView',
15
15
  initialState: exports.initialState,
16
16
  reducers: {
17
17
  fetchInvoicingCatalogItemDetail(draft, action) {
@@ -37,5 +37,5 @@ const invoicingCatalogItemDetailView = (0, toolkit_1.createSlice)({
37
37
  });
38
38
  },
39
39
  });
40
- _a = invoicingCatalogItemDetailView.actions, exports.fetchInvoicingCatalogItemDetail = _a.fetchInvoicingCatalogItemDetail, exports.updateInvoicingCatalogItemDetail = _a.updateInvoicingCatalogItemDetail, exports.updateInvoicingCatalogItemDetailFailure = _a.updateInvoicingCatalogItemDetailFailure;
41
- exports.default = invoicingCatalogItemDetailView.reducer;
40
+ _a = invoicingCatalogItemRecordView.actions, exports.fetchInvoicingCatalogItemDetail = _a.fetchInvoicingCatalogItemDetail, exports.updateInvoicingCatalogItemDetail = _a.updateInvoicingCatalogItemDetail, exports.updateInvoicingCatalogItemDetailFailure = _a.updateInvoicingCatalogItemDetailFailure;
41
+ exports.default = invoicingCatalogItemRecordView.reducer;
@@ -3,8 +3,7 @@ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndRep
3
3
  import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingFieldHelpByCode, InvoicingNamedOption, InvoicingNamedOptionsByKey } from '../../../entity/invoicing/invoicingCommonPayload';
4
4
  import { InvoicingPlan } from '../../../entity/invoicing/plan/planState';
5
5
  import { RootState } from '../../../rootStateTypes';
6
- import type { CatalogDetailEditValues } from '../editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState';
7
- import { InvoicingCatalogItemKind } from './invoicingCatalogItemDetailViewState';
6
+ import { InvoicingCatalogItemKind } from './invoicingCatalogItemRecordViewState';
8
7
  /**
9
8
  * Read-only view for the catalog item (plan or product) detail page. One screen
10
9
  * serves both kinds, so the bundled view carries the resolved `plan` or
@@ -17,7 +16,7 @@ import { InvoicingCatalogItemKind } from './invoicingCatalogItemDetailViewState'
17
16
  * `fetchState` because they track different requests — the screen gates a config
18
17
  * refetch on the former while rendering off the latter.
19
18
  */
20
- export interface InvoicingCatalogItemDetailView extends SelectorView {
19
+ export interface InvoicingCatalogItemRecordView extends SelectorView {
21
20
  catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogItemLifecycleAction>[];
22
21
  catalogProductLifecycleActionOptions: InvoicingCatalogLifecycleActionOption<InvoicingCatalogProductLifecycleAction>[];
23
22
  configFetchState: FetchState;
@@ -25,7 +24,6 @@ export interface InvoicingCatalogItemDetailView extends SelectorView {
25
24
  * The inline editor's form data, seeded from the loaded record and updated on
26
25
  * every change, so the page renders from CES rather than from its own reset.
27
26
  */
28
- editLocalData: CatalogDetailEditValues;
29
27
  /**
30
28
  * Backend help copy for this screen's field group, keyed by field code.
31
29
  * Folded in here so the screen never reaches for the config view itself.
@@ -42,4 +40,4 @@ export interface InvoicingCatalogItemDetailView extends SelectorView {
42
40
  catalogTierTypeOptionsByPricingModel?: InvoicingNamedOptionsByKey;
43
41
  plan?: InvoicingPlan;
44
42
  }
45
- export declare const getInvoicingCatalogItemDetail: (state: RootState, _kind: InvoicingCatalogItemKind, id: ID) => InvoicingCatalogItemDetailView;
43
+ export declare const getInvoicingCatalogItemRecord: (state: RootState, _kind: InvoicingCatalogItemKind, id: ID) => InvoicingCatalogItemRecordView;
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getInvoicingCatalogItemDetail = void 0;
3
+ exports.getInvoicingCatalogItemRecord = void 0;
4
4
  const planSelector_1 = require("../../../entity/invoicing/plan/planSelector");
5
5
  const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
6
- const editInvoicingCatalogItemDetailViewSelector_1 = require("../editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector");
7
- const getInvoicingCatalogItemDetail = (state, _kind, id) => {
8
- const { error, fetchState } = state.invoicingCatalogItemDetailViewState;
6
+ const getInvoicingCatalogItemRecord = (state, _kind, id) => {
7
+ const { error, fetchState } = state.invoicingCatalogItemRecordViewState;
9
8
  const { billingPeriodUnitOptions, catalogItemLifecycleActionOptions, catalogItemTypeOptions, catalogProductLifecycleActionOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, fetchState: configFetchState, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
10
9
  return {
11
10
  fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'catalog'),
@@ -14,7 +13,6 @@ const getInvoicingCatalogItemDetail = (state, _kind, id) => {
14
13
  catalogTierTypeOptionsByPricingModel,
15
14
  configFetchState,
16
15
  periodUnitOptions: billingPeriodUnitOptions,
17
- editLocalData: (0, editInvoicingCatalogItemDetailViewSelector_1.getInvoicingCatalogItemDetailEditLocalData)(state, id),
18
16
  plan: (0, planSelector_1.getInvoicingPlanById)(state.invoicingPlanState, id),
19
17
  trialEndActionOptions: catalogTrialEndActionOptions,
20
18
  trialUnitOptions: catalogTrialUnitOptions,
@@ -24,4 +22,4 @@ const getInvoicingCatalogItemDetail = (state, _kind, id) => {
24
22
  version: 1.0,
25
23
  };
26
24
  };
27
- exports.getInvoicingCatalogItemDetail = getInvoicingCatalogItemDetail;
25
+ exports.getInvoicingCatalogItemRecord = getInvoicingCatalogItemRecord;
@@ -1,6 +1,6 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  export type InvoicingCatalogItemKind = 'plan';
3
- export interface InvoicingCatalogItemDetailViewState extends FetchStateAndError {
3
+ export interface InvoicingCatalogItemRecordViewState extends FetchStateAndError {
4
4
  id?: ID;
5
5
  kind?: InvoicingCatalogItemKind;
6
6
  }
@@ -3,6 +3,6 @@ import { Observable } from 'rxjs';
3
3
  import { updateInvoicingCoupons } from '../../../entity/invoicing/coupon/couponReducer';
4
4
  import { RootState } from '../../../rootStateTypes';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
- import { fetchInvoicingCouponDetail, updateInvoicingCouponDetail, updateInvoicingCouponDetailFailure } from './invoicingCouponDetailViewReducer';
6
+ import { fetchInvoicingCouponDetail, updateInvoicingCouponDetail, updateInvoicingCouponDetailFailure } from './invoicingCouponRecordViewReducer';
7
7
  export type ActionType = ReturnType<typeof fetchInvoicingCouponDetail> | ReturnType<typeof updateInvoicingCouponDetail> | ReturnType<typeof updateInvoicingCouponDetailFailure> | ReturnType<typeof updateInvoicingCoupons>;
8
8
  export declare const fetchInvoicingCouponDetailEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -5,19 +5,19 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const couponReducer_1 = require("../../../entity/invoicing/coupon/couponReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
- const invoicingCouponDetailViewReducer_1 = require("./invoicingCouponDetailViewReducer");
9
- const fetchInvoicingCouponDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingCouponDetailViewReducer_1.fetchInvoicingCouponDetail.match), (0, operators_1.switchMap)((action) => {
8
+ const invoicingCouponRecordViewReducer_1 = require("./invoicingCouponRecordViewReducer");
9
+ const fetchInvoicingCouponDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(invoicingCouponRecordViewReducer_1.fetchInvoicingCouponDetail.match), (0, operators_1.switchMap)((action) => {
10
10
  const { id } = action.payload;
11
11
  const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/discounts/${id}`;
12
12
  return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
13
13
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
14
14
  return [
15
15
  (0, couponReducer_1.updateInvoicingCoupons)([response.data], 'merge'),
16
- (0, invoicingCouponDetailViewReducer_1.updateInvoicingCouponDetail)({ id: response.data.id }),
16
+ (0, invoicingCouponRecordViewReducer_1.updateInvoicingCouponDetail)({ id: response.data.id }),
17
17
  ];
18
18
  }
19
- return (0, rxjs_1.of)((0, invoicingCouponDetailViewReducer_1.updateInvoicingCouponDetailFailure)({ id, status: response.status }));
20
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingCouponDetailViewReducer_1.updateInvoicingCouponDetailFailure)({
19
+ return (0, rxjs_1.of)((0, invoicingCouponRecordViewReducer_1.updateInvoicingCouponDetailFailure)({ id, status: response.status }));
20
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, invoicingCouponRecordViewReducer_1.updateInvoicingCouponDetailFailure)({
21
21
  id,
22
22
  status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch discount detail REST API call errored out ' +
23
23
  JSON.stringify(error)),
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +1,16 @@
1
1
  import { FetchState, ID } from '../../../commonStateTypes/common';
2
2
  import { ZeniAPIStatus } from '../../../responsePayload';
3
- import { InvoicingCouponDetail, InvoicingCouponDetailViewState } from './invoicingCouponDetailViewState';
4
- export declare const initialState: InvoicingCouponDetailViewState;
3
+ import { InvoicingCouponDetail, InvoicingCouponRecordViewState } from './invoicingCouponRecordViewState';
4
+ export declare const initialState: InvoicingCouponRecordViewState;
5
5
  /** Build a per-coupon detail fetch-state entry. */
6
6
  export declare function buildInvoicingCouponDetail(id: ID, fetchState: FetchState, error?: ZeniAPIStatus): InvoicingCouponDetail;
7
7
  export declare const fetchInvoicingCouponDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
8
  id: ID;
9
- }, "invoicingCouponDetailView/fetchInvoicingCouponDetail">, updateInvoicingCouponDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
+ }, "invoicingCouponRecordView/fetchInvoicingCouponDetail">, updateInvoicingCouponDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
10
  id: ID;
11
- }, "invoicingCouponDetailView/updateInvoicingCouponDetail">, updateInvoicingCouponDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
+ }, "invoicingCouponRecordView/updateInvoicingCouponDetail">, updateInvoicingCouponDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
12
12
  id: ID;
13
13
  status: ZeniAPIStatus;
14
- }, "invoicingCouponDetailView/updateInvoicingCouponDetailFailure">;
15
- declare const _default: import("redux").Reducer<InvoicingCouponDetailViewState>;
14
+ }, "invoicingCouponRecordView/updateInvoicingCouponDetailFailure">;
15
+ declare const _default: import("redux").Reducer<InvoicingCouponRecordViewState>;
16
16
  export default _default;