@zeniai/client-epic-state 5.1.18-betaAA0 → 5.1.18-betaDI10

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 (386) hide show
  1. package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  3. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  4. package/lib/entity/task/taskPayload.d.ts +1 -0
  5. package/lib/entity/task/taskPayload.js +1 -0
  6. package/lib/entity/task/taskReducer.d.ts +5 -1
  7. package/lib/entity/task/taskReducer.js +8 -2
  8. package/lib/entity/task/taskState.d.ts +2 -1
  9. package/lib/entity/tenant/clearAllEpic.d.ts +2 -39
  10. package/lib/entity/tenant/clearAllEpic.js +8 -82
  11. package/lib/entity/tenant/tenantReducer.js +3 -3
  12. package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +3 -1
  13. package/lib/epic.d.ts +4 -31
  14. package/lib/epic.js +4 -32
  15. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  16. package/lib/esm/entity/task/taskPayload.js +1 -0
  17. package/lib/esm/entity/task/taskReducer.js +7 -1
  18. package/lib/esm/entity/tenant/clearAllEpic.js +0 -74
  19. package/lib/esm/entity/tenant/tenantReducer.js +3 -3
  20. package/lib/esm/entity/transaction/payloadTypes/customerTransactionPayload.js +3 -1
  21. package/lib/esm/epic.js +4 -32
  22. package/lib/esm/index.js +3 -80
  23. package/lib/esm/reducer.js +0 -114
  24. package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +2 -0
  25. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +8 -1
  26. package/lib/esm/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +80 -0
  27. package/lib/esm/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +36 -0
  28. package/lib/esm/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
  29. package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
  30. package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +24 -4
  31. package/lib/esm/view/taskManager/taskDetailView/epics/sendCommentMentionNotificationEpic.js +37 -0
  32. package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +56 -2
  33. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +21 -9
  34. package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -1
  35. package/lib/esm/view/taskManager/taskListView/taskList.js +1 -0
  36. package/lib/esm/view/taskManager/taskListView/taskListReducer.js +189 -10
  37. package/lib/esm/view/taskManager/taskListView/taskListSelector.js +1 -0
  38. package/lib/index.d.ts +4 -100
  39. package/lib/index.js +13 -372
  40. package/lib/reducer.d.ts +0 -114
  41. package/lib/reducer.js +12 -126
  42. package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +2 -0
  43. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +8 -1
  44. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -0
  45. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  46. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  47. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  48. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  49. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  50. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
  51. package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.d.ts +9 -0
  52. package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +84 -0
  53. package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.d.ts +8 -0
  54. package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +40 -0
  55. package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.d.ts +2 -1
  56. package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
  57. package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
  58. package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +24 -4
  59. package/lib/view/taskManager/taskDetailView/epics/sendCommentMentionNotificationEpic.d.ts +20 -0
  60. package/lib/view/taskManager/taskDetailView/epics/sendCommentMentionNotificationEpic.js +41 -0
  61. package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +14 -0
  62. package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +14 -2
  63. package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +57 -3
  64. package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +2 -1
  65. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +19 -7
  66. package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -1
  67. package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
  68. package/lib/view/taskManager/taskListView/taskList.js +1 -0
  69. package/lib/view/taskManager/taskListView/taskListPayload.d.ts +4 -0
  70. package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -1
  71. package/lib/view/taskManager/taskListView/taskListReducer.js +189 -10
  72. package/lib/view/taskManager/taskListView/taskListSelector.js +1 -0
  73. package/lib/zeniAPI.d.ts +0 -1
  74. package/package.json +1 -1
  75. package/lib/entity/invoicing/coupon/couponReducer.d.ts +0 -12
  76. package/lib/entity/invoicing/coupon/couponReducer.js +0 -33
  77. package/lib/entity/invoicing/creditNote/creditNoteReducer.d.ts +0 -12
  78. package/lib/entity/invoicing/creditNote/creditNoteReducer.js +0 -35
  79. package/lib/entity/invoicing/customer/customerReducer.d.ts +0 -12
  80. package/lib/entity/invoicing/customer/customerReducer.js +0 -33
  81. package/lib/entity/invoicing/dunningCase/dunningCaseReducer.d.ts +0 -12
  82. package/lib/entity/invoicing/dunningCase/dunningCaseReducer.js +0 -35
  83. package/lib/entity/invoicing/invoice/invoiceReducer.d.ts +0 -10
  84. package/lib/entity/invoicing/invoice/invoiceReducer.js +0 -36
  85. package/lib/entity/invoicing/invoice/invoiceSelector.d.ts +0 -5
  86. package/lib/entity/invoicing/invoice/invoiceSelector.js +0 -9
  87. package/lib/entity/invoicing/invoice/invoiceState.d.ts +0 -5
  88. package/lib/entity/invoicing/invoice/invoiceState.js +0 -2
  89. package/lib/entity/invoicing/invoicingTypes.d.ts +0 -766
  90. package/lib/entity/invoicing/invoicingTypes.js +0 -15
  91. package/lib/entity/invoicing/plan/planReducer.d.ts +0 -12
  92. package/lib/entity/invoicing/plan/planReducer.js +0 -33
  93. package/lib/entity/invoicing/product/productReducer.d.ts +0 -12
  94. package/lib/entity/invoicing/product/productReducer.js +0 -33
  95. package/lib/entity/invoicing/subscription/subscriptionReducer.d.ts +0 -12
  96. package/lib/entity/invoicing/subscription/subscriptionReducer.js +0 -35
  97. package/lib/entity/invoicing/transaction/transactionReducer.d.ts +0 -12
  98. package/lib/entity/invoicing/transaction/transactionReducer.js +0 -35
  99. package/lib/esm/entity/invoicing/coupon/couponReducer.js +0 -29
  100. package/lib/esm/entity/invoicing/creditNote/creditNoteReducer.js +0 -31
  101. package/lib/esm/entity/invoicing/customer/customerReducer.js +0 -29
  102. package/lib/esm/entity/invoicing/dunningCase/dunningCaseReducer.js +0 -31
  103. package/lib/esm/entity/invoicing/invoice/invoiceReducer.js +0 -32
  104. package/lib/esm/entity/invoicing/invoice/invoiceSelector.js +0 -4
  105. package/lib/esm/entity/invoicing/invoice/invoiceState.js +0 -1
  106. package/lib/esm/entity/invoicing/invoicingTypes.js +0 -14
  107. package/lib/esm/entity/invoicing/plan/planReducer.js +0 -29
  108. package/lib/esm/entity/invoicing/product/productReducer.js +0 -29
  109. package/lib/esm/entity/invoicing/subscription/subscriptionReducer.js +0 -31
  110. package/lib/esm/entity/invoicing/transaction/transactionReducer.js +0 -31
  111. package/lib/esm/view/invoicing/analyticsView/analyticsViewEpics.js +0 -42
  112. package/lib/esm/view/invoicing/analyticsView/analyticsViewReducer.js +0 -45
  113. package/lib/esm/view/invoicing/analyticsView/analyticsViewSelector.js +0 -10
  114. package/lib/esm/view/invoicing/approvalAction/approvalActionEpic.js +0 -28
  115. package/lib/esm/view/invoicing/approvalAction/approvalActionReducer.js +0 -36
  116. package/lib/esm/view/invoicing/approvalAction/approvalActionSelector.js +0 -5
  117. package/lib/esm/view/invoicing/approvalsView/approvalsViewEpics.js +0 -37
  118. package/lib/esm/view/invoicing/approvalsView/approvalsViewReducer.js +0 -62
  119. package/lib/esm/view/invoicing/approvalsView/approvalsViewSelector.js +0 -8
  120. package/lib/esm/view/invoicing/auditView/auditViewEpics.js +0 -46
  121. package/lib/esm/view/invoicing/auditView/auditViewReducer.js +0 -56
  122. package/lib/esm/view/invoicing/auditView/auditViewSelector.js +0 -8
  123. package/lib/esm/view/invoicing/catalogView/catalogViewEpics.js +0 -143
  124. package/lib/esm/view/invoicing/catalogView/catalogViewReducer.js +0 -162
  125. package/lib/esm/view/invoicing/catalogView/catalogViewSelector.js +0 -31
  126. package/lib/esm/view/invoicing/catalogWrite/catalogWriteEpic.js +0 -34
  127. package/lib/esm/view/invoicing/catalogWrite/catalogWriteReducer.js +0 -39
  128. package/lib/esm/view/invoicing/catalogWrite/catalogWriteSelector.js +0 -6
  129. package/lib/esm/view/invoicing/couponView/couponViewEpics.js +0 -83
  130. package/lib/esm/view/invoicing/couponView/couponViewReducer.js +0 -105
  131. package/lib/esm/view/invoicing/couponView/couponViewSelector.js +0 -18
  132. package/lib/esm/view/invoicing/couponWrite/couponWriteEpic.js +0 -29
  133. package/lib/esm/view/invoicing/couponWrite/couponWriteReducer.js +0 -36
  134. package/lib/esm/view/invoicing/couponWrite/couponWriteSelector.js +0 -5
  135. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +0 -23
  136. package/lib/esm/view/invoicing/createInvoice/createInvoiceReducer.js +0 -36
  137. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +0 -5
  138. package/lib/esm/view/invoicing/creditNoteView/creditNoteViewEpics.js +0 -87
  139. package/lib/esm/view/invoicing/creditNoteView/creditNoteViewReducer.js +0 -105
  140. package/lib/esm/view/invoicing/creditNoteView/creditNoteViewSelector.js +0 -20
  141. package/lib/esm/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.js +0 -63
  142. package/lib/esm/view/invoicing/customerPaymentMethod/customerPaymentMethodReducer.js +0 -84
  143. package/lib/esm/view/invoicing/customerPaymentMethod/customerPaymentMethodSelector.js +0 -7
  144. package/lib/esm/view/invoicing/customerView/customerViewEpics.js +0 -71
  145. package/lib/esm/view/invoicing/customerView/customerViewReducer.js +0 -90
  146. package/lib/esm/view/invoicing/customerView/customerViewSelector.js +0 -17
  147. package/lib/esm/view/invoicing/customerWrite/customerWriteEpic.js +0 -23
  148. package/lib/esm/view/invoicing/customerWrite/customerWriteReducer.js +0 -36
  149. package/lib/esm/view/invoicing/customerWrite/customerWriteSelector.js +0 -5
  150. package/lib/esm/view/invoicing/dataImportAction/dataImportActionEpic.js +0 -41
  151. package/lib/esm/view/invoicing/dataImportAction/dataImportActionReducer.js +0 -73
  152. package/lib/esm/view/invoicing/dataImportAction/dataImportActionSelector.js +0 -5
  153. package/lib/esm/view/invoicing/dataImportView/dataImportViewEpics.js +0 -41
  154. package/lib/esm/view/invoicing/dataImportView/dataImportViewReducer.js +0 -66
  155. package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +0 -6
  156. package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +0 -28
  157. package/lib/esm/view/invoicing/dunningAction/dunningActionReducer.js +0 -36
  158. package/lib/esm/view/invoicing/dunningAction/dunningActionSelector.js +0 -5
  159. package/lib/esm/view/invoicing/dunningCaseView/dunningCaseViewEpics.js +0 -85
  160. package/lib/esm/view/invoicing/dunningCaseView/dunningCaseViewReducer.js +0 -105
  161. package/lib/esm/view/invoicing/dunningCaseView/dunningCaseViewSelector.js +0 -20
  162. package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +0 -50
  163. package/lib/esm/view/invoicing/invoiceAction/invoiceActionReducer.js +0 -42
  164. package/lib/esm/view/invoicing/invoiceAction/invoiceActionSelector.js +0 -5
  165. package/lib/esm/view/invoicing/invoiceDetail/fetchInvoiceDetailEpic.js +0 -20
  166. package/lib/esm/view/invoicing/invoiceDetail/invoiceDetailReducer.js +0 -34
  167. package/lib/esm/view/invoicing/invoiceDetail/invoiceDetailSelector.js +0 -9
  168. package/lib/esm/view/invoicing/invoiceDetail/invoiceDetailState.js +0 -1
  169. package/lib/esm/view/invoicing/invoiceList/fetchInvoiceCountsEpic.js +0 -32
  170. package/lib/esm/view/invoicing/invoiceList/fetchInvoiceKPIsEpic.js +0 -17
  171. package/lib/esm/view/invoicing/invoiceList/fetchInvoiceListEpic.js +0 -55
  172. package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +0 -90
  173. package/lib/esm/view/invoicing/invoiceList/invoiceListSelector.js +0 -11
  174. package/lib/esm/view/invoicing/invoiceList/invoiceListState.js +0 -1
  175. package/lib/esm/view/invoicing/invoicePdf/invoicePdfEpic.js +0 -37
  176. package/lib/esm/view/invoicing/invoicePdf/invoicePdfReducer.js +0 -33
  177. package/lib/esm/view/invoicing/invoicePdf/invoicePdfSelector.js +0 -5
  178. package/lib/esm/view/invoicing/invoicingApiHelper.js +0 -38
  179. package/lib/esm/view/invoicing/paymentAction/paymentActionEpic.js +0 -28
  180. package/lib/esm/view/invoicing/paymentAction/paymentActionReducer.js +0 -36
  181. package/lib/esm/view/invoicing/paymentAction/paymentActionSelector.js +0 -5
  182. package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +0 -23
  183. package/lib/esm/view/invoicing/recordPayment/recordPaymentReducer.js +0 -36
  184. package/lib/esm/view/invoicing/recordPayment/recordPaymentSelector.js +0 -5
  185. package/lib/esm/view/invoicing/reportsView/reportsViewEpics.js +0 -28
  186. package/lib/esm/view/invoicing/reportsView/reportsViewReducer.js +0 -54
  187. package/lib/esm/view/invoicing/reportsView/reportsViewSelector.js +0 -13
  188. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +0 -53
  189. package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +0 -69
  190. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +0 -7
  191. package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +0 -28
  192. package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionReducer.js +0 -36
  193. package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionSelector.js +0 -5
  194. package/lib/esm/view/invoicing/subscriptionView/subscriptionViewEpics.js +0 -85
  195. package/lib/esm/view/invoicing/subscriptionView/subscriptionViewReducer.js +0 -90
  196. package/lib/esm/view/invoicing/subscriptionView/subscriptionViewSelector.js +0 -19
  197. package/lib/esm/view/invoicing/subscriptionWrite/subscriptionWriteEpic.js +0 -25
  198. package/lib/esm/view/invoicing/subscriptionWrite/subscriptionWriteReducer.js +0 -36
  199. package/lib/esm/view/invoicing/subscriptionWrite/subscriptionWriteSelector.js +0 -5
  200. package/lib/esm/view/invoicing/transactionView/transactionViewEpics.js +0 -76
  201. package/lib/esm/view/invoicing/transactionView/transactionViewReducer.js +0 -90
  202. package/lib/esm/view/invoicing/transactionView/transactionViewSelector.js +0 -19
  203. package/lib/view/invoicing/analyticsView/analyticsViewEpics.d.ts +0 -7
  204. package/lib/view/invoicing/analyticsView/analyticsViewEpics.js +0 -46
  205. package/lib/view/invoicing/analyticsView/analyticsViewReducer.d.ts +0 -22
  206. package/lib/view/invoicing/analyticsView/analyticsViewReducer.js +0 -49
  207. package/lib/view/invoicing/analyticsView/analyticsViewSelector.d.ts +0 -10
  208. package/lib/view/invoicing/analyticsView/analyticsViewSelector.js +0 -20
  209. package/lib/view/invoicing/approvalAction/approvalActionEpic.d.ts +0 -8
  210. package/lib/view/invoicing/approvalAction/approvalActionEpic.js +0 -32
  211. package/lib/view/invoicing/approvalAction/approvalActionReducer.d.ts +0 -20
  212. package/lib/view/invoicing/approvalAction/approvalActionReducer.js +0 -40
  213. package/lib/view/invoicing/approvalAction/approvalActionSelector.d.ts +0 -3
  214. package/lib/view/invoicing/approvalAction/approvalActionSelector.js +0 -9
  215. package/lib/view/invoicing/approvalsView/approvalsViewEpics.d.ts +0 -7
  216. package/lib/view/invoicing/approvalsView/approvalsViewEpics.js +0 -41
  217. package/lib/view/invoicing/approvalsView/approvalsViewReducer.d.ts +0 -33
  218. package/lib/view/invoicing/approvalsView/approvalsViewReducer.js +0 -66
  219. package/lib/view/invoicing/approvalsView/approvalsViewSelector.d.ts +0 -9
  220. package/lib/view/invoicing/approvalsView/approvalsViewSelector.js +0 -16
  221. package/lib/view/invoicing/auditView/auditViewEpics.d.ts +0 -7
  222. package/lib/view/invoicing/auditView/auditViewEpics.js +0 -50
  223. package/lib/view/invoicing/auditView/auditViewReducer.d.ts +0 -36
  224. package/lib/view/invoicing/auditView/auditViewReducer.js +0 -60
  225. package/lib/view/invoicing/auditView/auditViewSelector.d.ts +0 -9
  226. package/lib/view/invoicing/auditView/auditViewSelector.js +0 -16
  227. package/lib/view/invoicing/catalogView/catalogViewEpics.d.ts +0 -14
  228. package/lib/view/invoicing/catalogView/catalogViewEpics.js +0 -152
  229. package/lib/view/invoicing/catalogView/catalogViewReducer.d.ts +0 -76
  230. package/lib/view/invoicing/catalogView/catalogViewReducer.js +0 -166
  231. package/lib/view/invoicing/catalogView/catalogViewSelector.d.ts +0 -22
  232. package/lib/view/invoicing/catalogView/catalogViewSelector.js +0 -52
  233. package/lib/view/invoicing/catalogWrite/catalogWriteEpic.d.ts +0 -9
  234. package/lib/view/invoicing/catalogWrite/catalogWriteEpic.js +0 -38
  235. package/lib/view/invoicing/catalogWrite/catalogWriteReducer.d.ts +0 -21
  236. package/lib/view/invoicing/catalogWrite/catalogWriteReducer.js +0 -43
  237. package/lib/view/invoicing/catalogWrite/catalogWriteSelector.d.ts +0 -6
  238. package/lib/view/invoicing/catalogWrite/catalogWriteSelector.js +0 -12
  239. package/lib/view/invoicing/couponView/couponViewEpics.d.ts +0 -11
  240. package/lib/view/invoicing/couponView/couponViewEpics.js +0 -90
  241. package/lib/view/invoicing/couponView/couponViewReducer.d.ts +0 -42
  242. package/lib/view/invoicing/couponView/couponViewReducer.js +0 -109
  243. package/lib/view/invoicing/couponView/couponViewSelector.d.ts +0 -14
  244. package/lib/view/invoicing/couponView/couponViewSelector.js +0 -31
  245. package/lib/view/invoicing/couponWrite/couponWriteEpic.d.ts +0 -8
  246. package/lib/view/invoicing/couponWrite/couponWriteEpic.js +0 -33
  247. package/lib/view/invoicing/couponWrite/couponWriteReducer.d.ts +0 -17
  248. package/lib/view/invoicing/couponWrite/couponWriteReducer.js +0 -40
  249. package/lib/view/invoicing/couponWrite/couponWriteSelector.d.ts +0 -4
  250. package/lib/view/invoicing/couponWrite/couponWriteSelector.js +0 -10
  251. package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +0 -8
  252. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +0 -27
  253. package/lib/view/invoicing/createInvoice/createInvoiceReducer.d.ts +0 -34
  254. package/lib/view/invoicing/createInvoice/createInvoiceReducer.js +0 -40
  255. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +0 -4
  256. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +0 -10
  257. package/lib/view/invoicing/creditNoteView/creditNoteViewEpics.d.ts +0 -11
  258. package/lib/view/invoicing/creditNoteView/creditNoteViewEpics.js +0 -94
  259. package/lib/view/invoicing/creditNoteView/creditNoteViewReducer.d.ts +0 -43
  260. package/lib/view/invoicing/creditNoteView/creditNoteViewReducer.js +0 -109
  261. package/lib/view/invoicing/creditNoteView/creditNoteViewSelector.d.ts +0 -14
  262. package/lib/view/invoicing/creditNoteView/creditNoteViewSelector.js +0 -33
  263. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.d.ts +0 -11
  264. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.js +0 -70
  265. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodReducer.d.ts +0 -42
  266. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodReducer.js +0 -88
  267. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodSelector.d.ts +0 -10
  268. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodSelector.js +0 -17
  269. package/lib/view/invoicing/customerView/customerViewEpics.d.ts +0 -10
  270. package/lib/view/invoicing/customerView/customerViewEpics.js +0 -77
  271. package/lib/view/invoicing/customerView/customerViewReducer.d.ts +0 -41
  272. package/lib/view/invoicing/customerView/customerViewReducer.js +0 -94
  273. package/lib/view/invoicing/customerView/customerViewSelector.d.ts +0 -13
  274. package/lib/view/invoicing/customerView/customerViewSelector.js +0 -29
  275. package/lib/view/invoicing/customerWrite/customerWriteEpic.d.ts +0 -8
  276. package/lib/view/invoicing/customerWrite/customerWriteEpic.js +0 -27
  277. package/lib/view/invoicing/customerWrite/customerWriteReducer.d.ts +0 -17
  278. package/lib/view/invoicing/customerWrite/customerWriteReducer.js +0 -40
  279. package/lib/view/invoicing/customerWrite/customerWriteSelector.d.ts +0 -4
  280. package/lib/view/invoicing/customerWrite/customerWriteSelector.js +0 -10
  281. package/lib/view/invoicing/dataImportAction/dataImportActionEpic.d.ts +0 -7
  282. package/lib/view/invoicing/dataImportAction/dataImportActionEpic.js +0 -45
  283. package/lib/view/invoicing/dataImportAction/dataImportActionReducer.d.ts +0 -23
  284. package/lib/view/invoicing/dataImportAction/dataImportActionReducer.js +0 -77
  285. package/lib/view/invoicing/dataImportAction/dataImportActionSelector.d.ts +0 -4
  286. package/lib/view/invoicing/dataImportAction/dataImportActionSelector.js +0 -9
  287. package/lib/view/invoicing/dataImportView/dataImportViewEpics.d.ts +0 -9
  288. package/lib/view/invoicing/dataImportView/dataImportViewEpics.js +0 -47
  289. package/lib/view/invoicing/dataImportView/dataImportViewReducer.d.ts +0 -15
  290. package/lib/view/invoicing/dataImportView/dataImportViewReducer.js +0 -70
  291. package/lib/view/invoicing/dataImportView/dataImportViewSelector.d.ts +0 -9
  292. package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +0 -15
  293. package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +0 -8
  294. package/lib/view/invoicing/dunningAction/dunningActionEpic.js +0 -32
  295. package/lib/view/invoicing/dunningAction/dunningActionReducer.d.ts +0 -21
  296. package/lib/view/invoicing/dunningAction/dunningActionReducer.js +0 -40
  297. package/lib/view/invoicing/dunningAction/dunningActionSelector.d.ts +0 -3
  298. package/lib/view/invoicing/dunningAction/dunningActionSelector.js +0 -9
  299. package/lib/view/invoicing/dunningCaseView/dunningCaseViewEpics.d.ts +0 -11
  300. package/lib/view/invoicing/dunningCaseView/dunningCaseViewEpics.js +0 -92
  301. package/lib/view/invoicing/dunningCaseView/dunningCaseViewReducer.d.ts +0 -42
  302. package/lib/view/invoicing/dunningCaseView/dunningCaseViewReducer.js +0 -109
  303. package/lib/view/invoicing/dunningCaseView/dunningCaseViewSelector.d.ts +0 -14
  304. package/lib/view/invoicing/dunningCaseView/dunningCaseViewSelector.js +0 -33
  305. package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +0 -9
  306. package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +0 -55
  307. package/lib/view/invoicing/invoiceAction/invoiceActionReducer.d.ts +0 -26
  308. package/lib/view/invoicing/invoiceAction/invoiceActionReducer.js +0 -46
  309. package/lib/view/invoicing/invoiceAction/invoiceActionSelector.d.ts +0 -3
  310. package/lib/view/invoicing/invoiceAction/invoiceActionSelector.js +0 -9
  311. package/lib/view/invoicing/invoiceDetail/fetchInvoiceDetailEpic.d.ts +0 -8
  312. package/lib/view/invoicing/invoiceDetail/fetchInvoiceDetailEpic.js +0 -24
  313. package/lib/view/invoicing/invoiceDetail/invoiceDetailReducer.d.ts +0 -11
  314. package/lib/view/invoicing/invoiceDetail/invoiceDetailReducer.js +0 -38
  315. package/lib/view/invoicing/invoiceDetail/invoiceDetailSelector.d.ts +0 -5
  316. package/lib/view/invoicing/invoiceDetail/invoiceDetailSelector.js +0 -14
  317. package/lib/view/invoicing/invoiceDetail/invoiceDetailState.d.ts +0 -4
  318. package/lib/view/invoicing/invoiceDetail/invoiceDetailState.js +0 -2
  319. package/lib/view/invoicing/invoiceList/fetchInvoiceCountsEpic.d.ts +0 -7
  320. package/lib/view/invoicing/invoiceList/fetchInvoiceCountsEpic.js +0 -36
  321. package/lib/view/invoicing/invoiceList/fetchInvoiceKPIsEpic.d.ts +0 -7
  322. package/lib/view/invoicing/invoiceList/fetchInvoiceKPIsEpic.js +0 -21
  323. package/lib/view/invoicing/invoiceList/fetchInvoiceListEpic.d.ts +0 -8
  324. package/lib/view/invoicing/invoiceList/fetchInvoiceListEpic.js +0 -59
  325. package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +0 -22
  326. package/lib/view/invoicing/invoiceList/invoiceListReducer.js +0 -94
  327. package/lib/view/invoicing/invoiceList/invoiceListSelector.d.ts +0 -11
  328. package/lib/view/invoicing/invoiceList/invoiceListSelector.js +0 -21
  329. package/lib/view/invoicing/invoiceList/invoiceListState.d.ts +0 -25
  330. package/lib/view/invoicing/invoiceList/invoiceListState.js +0 -2
  331. package/lib/view/invoicing/invoicePdf/invoicePdfEpic.d.ts +0 -7
  332. package/lib/view/invoicing/invoicePdf/invoicePdfEpic.js +0 -41
  333. package/lib/view/invoicing/invoicePdf/invoicePdfReducer.d.ts +0 -20
  334. package/lib/view/invoicing/invoicePdf/invoicePdfReducer.js +0 -37
  335. package/lib/view/invoicing/invoicePdf/invoicePdfSelector.d.ts +0 -3
  336. package/lib/view/invoicing/invoicePdf/invoicePdfSelector.js +0 -9
  337. package/lib/view/invoicing/invoicingApiHelper.d.ts +0 -22
  338. package/lib/view/invoicing/invoicingApiHelper.js +0 -44
  339. package/lib/view/invoicing/paymentAction/paymentActionEpic.d.ts +0 -8
  340. package/lib/view/invoicing/paymentAction/paymentActionEpic.js +0 -32
  341. package/lib/view/invoicing/paymentAction/paymentActionReducer.d.ts +0 -21
  342. package/lib/view/invoicing/paymentAction/paymentActionReducer.js +0 -40
  343. package/lib/view/invoicing/paymentAction/paymentActionSelector.d.ts +0 -3
  344. package/lib/view/invoicing/paymentAction/paymentActionSelector.js +0 -9
  345. package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +0 -8
  346. package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +0 -27
  347. package/lib/view/invoicing/recordPayment/recordPaymentReducer.d.ts +0 -32
  348. package/lib/view/invoicing/recordPayment/recordPaymentReducer.js +0 -40
  349. package/lib/view/invoicing/recordPayment/recordPaymentSelector.d.ts +0 -4
  350. package/lib/view/invoicing/recordPayment/recordPaymentSelector.js +0 -10
  351. package/lib/view/invoicing/reportsView/reportsViewEpics.d.ts +0 -7
  352. package/lib/view/invoicing/reportsView/reportsViewEpics.js +0 -32
  353. package/lib/view/invoicing/reportsView/reportsViewReducer.d.ts +0 -20
  354. package/lib/view/invoicing/reportsView/reportsViewReducer.js +0 -58
  355. package/lib/view/invoicing/reportsView/reportsViewSelector.d.ts +0 -12
  356. package/lib/view/invoicing/reportsView/reportsViewSelector.js +0 -24
  357. package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +0 -10
  358. package/lib/view/invoicing/settingsView/settingsViewEpics.js +0 -60
  359. package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +0 -12
  360. package/lib/view/invoicing/settingsView/settingsViewReducer.js +0 -73
  361. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +0 -7
  362. package/lib/view/invoicing/settingsView/settingsViewSelector.js +0 -14
  363. package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +0 -8
  364. package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +0 -32
  365. package/lib/view/invoicing/subscriptionAction/subscriptionActionReducer.d.ts +0 -21
  366. package/lib/view/invoicing/subscriptionAction/subscriptionActionReducer.js +0 -40
  367. package/lib/view/invoicing/subscriptionAction/subscriptionActionSelector.d.ts +0 -3
  368. package/lib/view/invoicing/subscriptionAction/subscriptionActionSelector.js +0 -9
  369. package/lib/view/invoicing/subscriptionView/subscriptionViewEpics.d.ts +0 -10
  370. package/lib/view/invoicing/subscriptionView/subscriptionViewEpics.js +0 -91
  371. package/lib/view/invoicing/subscriptionView/subscriptionViewReducer.d.ts +0 -44
  372. package/lib/view/invoicing/subscriptionView/subscriptionViewReducer.js +0 -94
  373. package/lib/view/invoicing/subscriptionView/subscriptionViewSelector.d.ts +0 -13
  374. package/lib/view/invoicing/subscriptionView/subscriptionViewSelector.js +0 -31
  375. package/lib/view/invoicing/subscriptionWrite/subscriptionWriteEpic.d.ts +0 -8
  376. package/lib/view/invoicing/subscriptionWrite/subscriptionWriteEpic.js +0 -29
  377. package/lib/view/invoicing/subscriptionWrite/subscriptionWriteReducer.d.ts +0 -17
  378. package/lib/view/invoicing/subscriptionWrite/subscriptionWriteReducer.js +0 -40
  379. package/lib/view/invoicing/subscriptionWrite/subscriptionWriteSelector.d.ts +0 -4
  380. package/lib/view/invoicing/subscriptionWrite/subscriptionWriteSelector.js +0 -10
  381. package/lib/view/invoicing/transactionView/transactionViewEpics.d.ts +0 -10
  382. package/lib/view/invoicing/transactionView/transactionViewEpics.js +0 -82
  383. package/lib/view/invoicing/transactionView/transactionViewReducer.d.ts +0 -43
  384. package/lib/view/invoicing/transactionView/transactionViewReducer.js +0 -94
  385. package/lib/view/invoicing/transactionView/transactionViewSelector.d.ts +0 -13
  386. package/lib/view/invoicing/transactionView/transactionViewSelector.js +0 -31
@@ -1,11 +0,0 @@
1
- import { getInvoicesByIds } from '../../../entity/invoicing/invoice/invoiceSelector';
2
- export const getInvoiceListFetchState = (state) => ({
3
- fetchState: state.invoicingInvoiceListState.fetchState,
4
- error: state.invoicingInvoiceListState.error,
5
- });
6
- export const getInvoiceListItems = (state) => getInvoicesByIds(state, state.invoicingInvoiceListState.invoiceIds);
7
- export const getInvoiceListNextCursor = (state) => state.invoicingInvoiceListState.nextCursor;
8
- export const getInvoiceListHasMore = (state) => state.invoicingInvoiceListState.nextCursor != null;
9
- export const getInvoiceListFilters = (state) => state.invoicingInvoiceListState.filters;
10
- export const getInvoiceCounts = (state) => state.invoicingInvoiceListState.counts;
11
- export const getInvoiceKPIs = (state) => state.invoicingInvoiceListState.kpis;
@@ -1,37 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, map, mergeMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus } from '../../../responsePayload';
4
- import { invoicingBaseUrl } from '../invoicingApiHelper';
5
- import { downloadInvoicePdf, downloadInvoicePdfFailure, downloadInvoicePdfSuccess, } from './invoicePdfReducer';
6
- /**
7
- * Turn the auth-fetched PDF bytes into a browser download. The invoicing PDF
8
- * endpoint requires the zeni-* auth headers, so the blob must be fetched via
9
- * ZeniAPI (a plain <a href>/<iframe> cannot attach them) and then handed to the
10
- * browser as an object URL.
11
- */
12
- const triggerBrowserDownload = (data, fileName) => {
13
- if (typeof document === 'undefined' || typeof URL === 'undefined') {
14
- return;
15
- }
16
- const blob = new Blob([data], { type: 'application/pdf' });
17
- const objectUrl = URL.createObjectURL(blob);
18
- const anchor = document.createElement('a');
19
- anchor.href = objectUrl;
20
- anchor.download = fileName;
21
- document.body.appendChild(anchor);
22
- anchor.click();
23
- anchor.remove();
24
- URL.revokeObjectURL(objectUrl);
25
- };
26
- export const downloadInvoicePdfEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(downloadInvoicePdf.match), mergeMap((action) => {
27
- const { fileName, invoiceId } = action.payload;
28
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/invoices/${encodeURIComponent(invoiceId)}/pdf`;
29
- return zeniAPI.getFile(apiUrl).pipe(map((data) => {
30
- triggerBrowserDownload(data, fileName != null && fileName !== '' ? fileName : `${invoiceId}.pdf`);
31
- return downloadInvoicePdfSuccess({ invoiceId });
32
- }), catchError((error) => of(downloadInvoicePdfFailure({
33
- error: createZeniAPIStatus('Unexpected Error', 'Invoice PDF download REST API call errored out ' +
34
- JSON.stringify(error)),
35
- invoiceId,
36
- }))));
37
- }));
@@ -1,33 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- byInvoiceId: {},
4
- };
5
- const invoicePdf = createSlice({
6
- name: 'invoicingInvoicePdf',
7
- initialState,
8
- reducers: {
9
- downloadInvoicePdf(draft, action) {
10
- draft.byInvoiceId[action.payload.invoiceId] = {
11
- fetchState: 'In-Progress',
12
- error: undefined,
13
- };
14
- },
15
- downloadInvoicePdfSuccess(draft, action) {
16
- draft.byInvoiceId[action.payload.invoiceId] = {
17
- fetchState: 'Completed',
18
- error: undefined,
19
- };
20
- },
21
- downloadInvoicePdfFailure(draft, action) {
22
- draft.byInvoiceId[action.payload.invoiceId] = {
23
- fetchState: 'Error',
24
- error: action.payload.error,
25
- };
26
- },
27
- clearAllInvoicingInvoicePdf(draft) {
28
- draft.byInvoiceId = {};
29
- },
30
- },
31
- });
32
- export const { downloadInvoicePdf, downloadInvoicePdfSuccess, downloadInvoicePdfFailure, clearAllInvoicingInvoicePdf, } = invoicePdf.actions;
33
- export default invoicePdf.reducer;
@@ -1,5 +0,0 @@
1
- const NOT_STARTED = {
2
- fetchState: 'Not-Started',
3
- error: undefined,
4
- };
5
- export const getInvoicingInvoicePdfState = (invoiceId) => (state) => state.invoicingInvoicePdfState.byInvoiceId[invoiceId] ?? NOT_STARTED;
@@ -1,38 +0,0 @@
1
- /** Default page size for invoicing list / infinite-scroll requests. */
2
- export const INVOICING_LIST_PAGE_SIZE = 50;
3
- /**
4
- * Hardcoded fallback for the Invoicing microservice root.
5
- *
6
- * The proper wiring routes the URL through `zeni-web-app-v2`'s
7
- * `createAPIEndPoints` into `apiEndPoints.invoicingMicroServiceBaseUrl`. That
8
- * value only reaches the running app once app-v2 is beta-published, which is a
9
- * heavier step than `pnpm build-beta-and-copy` of CES + web-components. Until
10
- * then we hardcode the dev service URL here so the module is runnable after a
11
- * CES/web-components build alone. Once app-v2 ships the endpoint, the configured
12
- * value below takes precedence automatically and this fallback is unused.
13
- */
14
- const INVOICING_SERVICE_FALLBACK_URL = 'https://dev.api.zeni.ai/agents/invoicing-service';
15
- /**
16
- * Base URL for the Invoicing microservice, keeping the platform-standard
17
- * `/1.0/*` path prefix. All invoicing epics route through here so auth headers
18
- * (zeni-user-id / session-id / tenant-id) are attached centrally by the client.
19
- */
20
- export const invoicingBaseUrl = (zeniAPI) => {
21
- const configured = zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl;
22
- const root = configured != null && configured.length > 0
23
- ? configured
24
- : INVOICING_SERVICE_FALLBACK_URL;
25
- return `${root}/1.0`;
26
- };
27
- /** Append a query string (with leading `?`) when params are present. */
28
- export const withQuery = (path, params) => {
29
- const qs = params.toString();
30
- return qs.length > 0 ? `${path}?${qs}` : path;
31
- };
32
- /** Attach `sort_field`/`sort_dir` to a list query when a sort is active. */
33
- export const applyListSortParams = (params, sort) => {
34
- if (sort != null && sort.field !== '') {
35
- params.set('sort_field', sort.field);
36
- params.set('sort_dir', sort.dir);
37
- }
38
- };
@@ -1,28 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { updateInvoicingTransactions } from '../../../entity/invoicing/transaction/transactionReducer';
4
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
5
- import { invoicingBaseUrl } from '../invoicingApiHelper';
6
- import { runInvoicingPaymentAction, runInvoicingPaymentActionFailure, runInvoicingPaymentActionSuccess, } from './paymentActionReducer';
7
- export const runInvoicingPaymentActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingPaymentAction.match), mergeMap((action) => {
8
- const { action: kind, body, id } = action.payload;
9
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/payments/${encodeURIComponent(id)}/${kind}`;
10
- return zeniAPI
11
- .postAndGetJSON(apiUrl, body ?? {})
12
- .pipe(mergeMap((response) => {
13
- if (isSuccessResponse(response) && response.data != null) {
14
- return [
15
- updateInvoicingTransactions([response.data], 'merge'),
16
- runInvoicingPaymentActionSuccess({ id }),
17
- ];
18
- }
19
- return of(runInvoicingPaymentActionFailure({
20
- error: response.status,
21
- id,
22
- }));
23
- }), catchError((error) => of(runInvoicingPaymentActionFailure({
24
- error: createZeniAPIStatus('Unexpected Error', 'Payment action REST API call errored out ' +
25
- JSON.stringify(error)),
26
- id,
27
- }))));
28
- }));
@@ -1,36 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- byId: {},
4
- };
5
- const paymentAction = createSlice({
6
- name: 'invoicingPaymentAction',
7
- initialState,
8
- reducers: {
9
- runInvoicingPaymentAction(draft, action) {
10
- draft.byId[action.payload.id] = {
11
- fetchState: 'In-Progress',
12
- error: undefined,
13
- };
14
- },
15
- runInvoicingPaymentActionSuccess(draft, action) {
16
- draft.byId[action.payload.id] = {
17
- fetchState: 'Completed',
18
- error: undefined,
19
- };
20
- },
21
- runInvoicingPaymentActionFailure(draft, action) {
22
- draft.byId[action.payload.id] = {
23
- fetchState: 'Error',
24
- error: action.payload.error,
25
- };
26
- },
27
- clearInvoicingPaymentAction(draft, action) {
28
- delete draft.byId[action.payload];
29
- },
30
- clearAllInvoicingPaymentActions(draft) {
31
- draft.byId = {};
32
- },
33
- },
34
- });
35
- export const { runInvoicingPaymentAction, runInvoicingPaymentActionSuccess, runInvoicingPaymentActionFailure, clearInvoicingPaymentAction, clearAllInvoicingPaymentActions, } = paymentAction.actions;
36
- export default paymentAction.reducer;
@@ -1,5 +0,0 @@
1
- const NOT_STARTED = {
2
- fetchState: 'Not-Started',
3
- error: undefined,
4
- };
5
- export const getInvoicingPaymentActionState = (id) => (state) => state.invoicingPaymentActionState.byId[id] ?? NOT_STARTED;
@@ -1,23 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { updateInvoicingTransactions } from '../../../entity/invoicing/transaction/transactionReducer';
4
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
5
- import { invoicingBaseUrl } from '../invoicingApiHelper';
6
- import { recordPayment, recordPaymentFailure, recordPaymentSuccess, } from './recordPaymentReducer';
7
- export const recordPaymentEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(recordPayment.match), mergeMap((action) => {
8
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/payments`;
9
- return zeniAPI
10
- .postAndGetJSON(apiUrl, {
11
- ...action.payload,
12
- })
13
- .pipe(mergeMap((response) => {
14
- if (isSuccessResponse(response) && response.data != null) {
15
- return [
16
- updateInvoicingTransactions([response.data], 'merge'),
17
- recordPaymentSuccess({ transactionId: response.data.id }),
18
- ];
19
- }
20
- return of(recordPaymentFailure(response.status));
21
- }), catchError((error) => of(recordPaymentFailure(createZeniAPIStatus('Unexpected Error', 'Record payment REST API call errored out ' +
22
- JSON.stringify(error))))));
23
- }));
@@ -1,36 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- fetchState: 'Not-Started',
4
- error: undefined,
5
- recordedTransactionId: undefined,
6
- request: undefined,
7
- hasValidState() {
8
- return this.fetchState === 'Completed';
9
- },
10
- };
11
- const recordPaymentSlice = createSlice({
12
- name: 'invoicingRecordPayment',
13
- initialState,
14
- reducers: {
15
- recordPayment(draft, action) {
16
- draft.fetchState = 'In-Progress';
17
- draft.error = undefined;
18
- draft.recordedTransactionId = undefined;
19
- draft.request = action.payload;
20
- },
21
- recordPaymentSuccess(draft, action) {
22
- draft.fetchState = 'Completed';
23
- draft.error = undefined;
24
- draft.recordedTransactionId = action.payload.transactionId;
25
- },
26
- recordPaymentFailure(draft, action) {
27
- draft.fetchState = 'Error';
28
- draft.error = action.payload;
29
- },
30
- resetRecordPayment(draft) {
31
- Object.assign(draft, initialState);
32
- },
33
- },
34
- });
35
- export const { recordPayment, recordPaymentSuccess, recordPaymentFailure, resetRecordPayment, } = recordPaymentSlice.actions;
36
- export default recordPaymentSlice.reducer;
@@ -1,5 +0,0 @@
1
- export const getRecordPaymentFetchState = (state) => ({
2
- fetchState: state.invoicingRecordPaymentState.fetchState,
3
- error: state.invoicingRecordPaymentState.error,
4
- });
5
- export const getRecordedTransactionId = (state) => state.invoicingRecordPaymentState.recordedTransactionId;
@@ -1,28 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
4
- import { invoicingBaseUrl } from '../invoicingApiHelper';
5
- import { fetchInvoicingReport, updateInvoicingReport, updateInvoicingReportFailure, } from './reportsViewReducer';
6
- const REPORT_PATHS = {
7
- aging: '/reports/aging',
8
- creditBalances: '/reports/credit-balances',
9
- customerMovement: '/reports/customer-movement',
10
- deferredRevenue: '/reports/deferred-revenue',
11
- discounts: '/reports/discounts',
12
- refunds: '/reports/refunds',
13
- subscriptionCounts: '/reports/subscription-counts',
14
- };
15
- export const fetchInvoicingReportEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingReport.match), mergeMap((action) => {
16
- const key = action.payload;
17
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}${REPORT_PATHS[key]}`;
18
- return zeniAPI.getJSON(apiUrl).pipe(mergeMap((response) => {
19
- if (isSuccessResponse(response)) {
20
- return of(updateInvoicingReport({ key, data: response.data ?? undefined }));
21
- }
22
- return of(updateInvoicingReportFailure({ key, error: response.status }));
23
- }), catchError((error) => of(updateInvoicingReportFailure({
24
- key,
25
- error: createZeniAPIStatus('Unexpected Error', 'Fetch report REST API call errored out ' +
26
- JSON.stringify(error)),
27
- }))));
28
- }));
@@ -1,54 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const INVOICING_REPORT_KEYS = [
3
- 'aging',
4
- 'creditBalances',
5
- 'customerMovement',
6
- 'deferredRevenue',
7
- 'discounts',
8
- 'refunds',
9
- 'subscriptionCounts',
10
- ];
11
- const emptySlot = () => ({
12
- fetchState: 'Not-Started',
13
- error: undefined,
14
- data: undefined,
15
- });
16
- const buildInitialByKey = () => INVOICING_REPORT_KEYS.reduce((acc, key) => {
17
- acc[key] = emptySlot();
18
- return acc;
19
- }, {});
20
- export const initialState = {
21
- byKey: buildInitialByKey(),
22
- };
23
- const reportsView = createSlice({
24
- name: 'invoicingReportsView',
25
- initialState,
26
- reducers: {
27
- fetchInvoicingReport(draft, action) {
28
- draft.byKey[action.payload] = {
29
- fetchState: 'In-Progress',
30
- error: undefined,
31
- data: draft.byKey[action.payload]?.data,
32
- };
33
- },
34
- updateInvoicingReport(draft, action) {
35
- draft.byKey[action.payload.key] = {
36
- fetchState: 'Completed',
37
- error: undefined,
38
- data: action.payload.data,
39
- };
40
- },
41
- updateInvoicingReportFailure(draft, action) {
42
- draft.byKey[action.payload.key] = {
43
- fetchState: 'Error',
44
- error: action.payload.error,
45
- data: draft.byKey[action.payload.key]?.data,
46
- };
47
- },
48
- clearInvoicingReportsView(draft) {
49
- draft.byKey = buildInitialByKey();
50
- },
51
- },
52
- });
53
- export const { fetchInvoicingReport, updateInvoicingReport, updateInvoicingReportFailure, clearInvoicingReportsView, } = reportsView.actions;
54
- export default reportsView.reducer;
@@ -1,13 +0,0 @@
1
- export const getInvoicingReportFetchState = (key) => (state) => {
2
- const slot = state.invoicingReportsViewState.byKey[key];
3
- return { fetchState: slot.fetchState, error: slot.error };
4
- };
5
- const reportData = (state, key) => state.invoicingReportsViewState.byKey[key].data;
6
- export const getInvoicingAgingReport = (state) => reportData(state, 'aging');
7
- export const getInvoicingCustomerMovementReport = (state) => reportData(state, 'customerMovement');
8
- export const getInvoicingDeferredRevenueReport = (state) => reportData(state, 'deferredRevenue');
9
- export const getInvoicingRefundsReport = (state) => reportData(state, 'refunds') ?? [];
10
- export const getInvoicingDiscountsReport = (state) => reportData(state, 'discounts') ??
11
- [];
12
- export const getInvoicingCreditBalancesReport = (state) => reportData(state, 'creditBalances') ?? [];
13
- export const getInvoicingSubscriptionCountsReport = (state) => reportData(state, 'subscriptionCounts');
@@ -1,53 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, switchMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
4
- import { invoicingBaseUrl } from '../invoicingApiHelper';
5
- import { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, invoicingStripeConnectionFailure, saveInvoicingSettings, saveInvoicingSettingsFailure, saveInvoicingSettingsSuccess, updateInvoicingSettings, updateInvoicingSettingsFailure, updateInvoicingStripeConnection, } from './settingsViewReducer';
6
- export const fetchInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingSettings.match), switchMap(() => {
7
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/settings`;
8
- return zeniAPI.getJSON(apiUrl).pipe(switchMap((response) => {
9
- if (isSuccessResponse(response) && response.data != null) {
10
- return of(updateInvoicingSettings(response.data));
11
- }
12
- return of(updateInvoicingSettingsFailure(response.status));
13
- }), catchError((error) => of(updateInvoicingSettingsFailure(createZeniAPIStatus('Unexpected Error', 'Fetch settings REST API call errored out ' +
14
- JSON.stringify(error))))));
15
- }));
16
- export const connectInvoicingStripeEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(connectInvoicingStripe.match), switchMap(() => {
17
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/settings/stripe-connect/setup`;
18
- return zeniAPI
19
- .postAndGetJSON(apiUrl, {})
20
- .pipe(switchMap((response) => {
21
- if (isSuccessResponse(response) && response.data != null) {
22
- return of(updateInvoicingStripeConnection(response.data.connected_account_id));
23
- }
24
- return of(invoicingStripeConnectionFailure(response.status));
25
- }), catchError((error) => of(invoicingStripeConnectionFailure(createZeniAPIStatus('Unexpected Error', 'Stripe connect setup REST API call errored out ' +
26
- JSON.stringify(error))))));
27
- }));
28
- export const disconnectInvoicingStripeEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(disconnectInvoicingStripe.match), switchMap(() => {
29
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/settings/stripe-connect/callback`;
30
- return zeniAPI
31
- .deleteAndGetJSON(apiUrl)
32
- .pipe(switchMap((response) => {
33
- if (isSuccessResponse(response)) {
34
- return of(updateInvoicingStripeConnection(response.data?.connected_account_id ?? ''));
35
- }
36
- return of(invoicingStripeConnectionFailure(response.status));
37
- }), catchError((error) => of(invoicingStripeConnectionFailure(createZeniAPIStatus('Unexpected Error', 'Stripe disconnect REST API call errored out ' +
38
- JSON.stringify(error))))));
39
- }));
40
- export const saveInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(saveInvoicingSettings.match), switchMap((action) => {
41
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/settings`;
42
- return zeniAPI
43
- .putAndGetJSON(apiUrl, {
44
- ...action.payload,
45
- })
46
- .pipe(switchMap((response) => {
47
- if (isSuccessResponse(response) && response.data != null) {
48
- return of(saveInvoicingSettingsSuccess(response.data));
49
- }
50
- return of(saveInvoicingSettingsFailure(response.status));
51
- }), catchError((error) => of(saveInvoicingSettingsFailure(createZeniAPIStatus('Unexpected Error', 'Save settings REST API call errored out ' +
52
- JSON.stringify(error))))));
53
- }));
@@ -1,69 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- fetchState: 'Not-Started',
4
- error: undefined,
5
- saveFetchState: { fetchState: 'Not-Started', error: undefined },
6
- stripeFetchState: { fetchState: 'Not-Started', error: undefined },
7
- settings: undefined,
8
- hasValidState() {
9
- return this.fetchState === 'Completed' && this.settings != null;
10
- },
11
- };
12
- const settingsView = createSlice({
13
- name: 'invoicingSettingsView',
14
- initialState,
15
- reducers: {
16
- fetchInvoicingSettings(draft) {
17
- draft.fetchState = 'In-Progress';
18
- draft.error = undefined;
19
- },
20
- updateInvoicingSettings(draft, action) {
21
- draft.settings = action.payload;
22
- draft.fetchState = 'Completed';
23
- draft.error = undefined;
24
- },
25
- updateInvoicingSettingsFailure(draft, action) {
26
- draft.fetchState = 'Error';
27
- draft.error = action.payload;
28
- },
29
- saveInvoicingSettings(draft, action) {
30
- draft.saveFetchState = { fetchState: 'In-Progress', error: undefined };
31
- if (draft.settings != null) {
32
- draft.settings = { ...draft.settings, ...action.payload };
33
- }
34
- },
35
- saveInvoicingSettingsSuccess(draft, action) {
36
- draft.settings = action.payload;
37
- draft.saveFetchState = { fetchState: 'Completed', error: undefined };
38
- },
39
- saveInvoicingSettingsFailure(draft, action) {
40
- draft.saveFetchState = { fetchState: 'Error', error: action.payload };
41
- },
42
- resetSaveInvoicingSettings(draft) {
43
- draft.saveFetchState = { fetchState: 'Not-Started', error: undefined };
44
- },
45
- connectInvoicingStripe(draft) {
46
- draft.stripeFetchState = { fetchState: 'In-Progress', error: undefined };
47
- },
48
- disconnectInvoicingStripe(draft) {
49
- draft.stripeFetchState = { fetchState: 'In-Progress', error: undefined };
50
- },
51
- updateInvoicingStripeConnection(draft, action) {
52
- draft.stripeFetchState = { fetchState: 'Completed', error: undefined };
53
- if (draft.settings != null) {
54
- draft.settings = {
55
- ...draft.settings,
56
- stripe_connected_account_id: action.payload,
57
- };
58
- }
59
- },
60
- invoicingStripeConnectionFailure(draft, action) {
61
- draft.stripeFetchState = { fetchState: 'Error', error: action.payload };
62
- },
63
- clearInvoicingSettings(draft) {
64
- Object.assign(draft, initialState);
65
- },
66
- },
67
- });
68
- export const { fetchInvoicingSettings, updateInvoicingSettings, updateInvoicingSettingsFailure, saveInvoicingSettings, saveInvoicingSettingsSuccess, saveInvoicingSettingsFailure, resetSaveInvoicingSettings, connectInvoicingStripe, disconnectInvoicingStripe, updateInvoicingStripeConnection, invoicingStripeConnectionFailure, clearInvoicingSettings, } = settingsView.actions;
69
- export default settingsView.reducer;
@@ -1,7 +0,0 @@
1
- export const getInvoicingSettings = (state) => state.invoicingSettingsViewState.settings;
2
- export const getInvoicingSettingsFetchState = (state) => ({
3
- fetchState: state.invoicingSettingsViewState.fetchState,
4
- error: state.invoicingSettingsViewState.error,
5
- });
6
- export const getInvoicingSettingsSaveState = (state) => state.invoicingSettingsViewState.saveFetchState;
7
- export const getInvoicingStripeConnectState = (state) => state.invoicingSettingsViewState.stripeFetchState;
@@ -1,28 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { updateInvoicingSubscriptions } from '../../../entity/invoicing/subscription/subscriptionReducer';
4
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
5
- import { invoicingBaseUrl } from '../invoicingApiHelper';
6
- import { runInvoicingSubscriptionAction, runInvoicingSubscriptionActionFailure, runInvoicingSubscriptionActionSuccess, } from './subscriptionActionReducer';
7
- export const runInvoicingSubscriptionActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(runInvoicingSubscriptionAction.match), mergeMap((action) => {
8
- const { action: kind, body, id } = action.payload;
9
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/subscriptions/${encodeURIComponent(id)}/${kind}`;
10
- return zeniAPI
11
- .postAndGetJSON(apiUrl, body ?? {})
12
- .pipe(mergeMap((response) => {
13
- if (isSuccessResponse(response) && response.data != null) {
14
- return [
15
- updateInvoicingSubscriptions([response.data], 'merge'),
16
- runInvoicingSubscriptionActionSuccess({ id }),
17
- ];
18
- }
19
- return of(runInvoicingSubscriptionActionFailure({
20
- error: response.status,
21
- id,
22
- }));
23
- }), catchError((error) => of(runInvoicingSubscriptionActionFailure({
24
- error: createZeniAPIStatus('Unexpected Error', 'Subscription action REST API call errored out ' +
25
- JSON.stringify(error)),
26
- id,
27
- }))));
28
- }));
@@ -1,36 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- byId: {},
4
- };
5
- const subscriptionAction = createSlice({
6
- name: 'invoicingSubscriptionAction',
7
- initialState,
8
- reducers: {
9
- runInvoicingSubscriptionAction(draft, action) {
10
- draft.byId[action.payload.id] = {
11
- fetchState: 'In-Progress',
12
- error: undefined,
13
- };
14
- },
15
- runInvoicingSubscriptionActionSuccess(draft, action) {
16
- draft.byId[action.payload.id] = {
17
- fetchState: 'Completed',
18
- error: undefined,
19
- };
20
- },
21
- runInvoicingSubscriptionActionFailure(draft, action) {
22
- draft.byId[action.payload.id] = {
23
- fetchState: 'Error',
24
- error: action.payload.error,
25
- };
26
- },
27
- clearInvoicingSubscriptionAction(draft, action) {
28
- delete draft.byId[action.payload];
29
- },
30
- clearAllInvoicingSubscriptionActions(draft) {
31
- draft.byId = {};
32
- },
33
- },
34
- });
35
- export const { runInvoicingSubscriptionAction, runInvoicingSubscriptionActionSuccess, runInvoicingSubscriptionActionFailure, clearInvoicingSubscriptionAction, clearAllInvoicingSubscriptionActions, } = subscriptionAction.actions;
36
- export default subscriptionAction.reducer;
@@ -1,5 +0,0 @@
1
- const NOT_STARTED = {
2
- fetchState: 'Not-Started',
3
- error: undefined,
4
- };
5
- export const getInvoicingSubscriptionActionState = (id) => (state) => state.invoicingSubscriptionActionState.byId[id] ?? NOT_STARTED;