@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,63 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
4
- import { fetchInvoicingCustomerDetail } from '../customerView/customerViewReducer';
5
- import { invoicingBaseUrl } from '../invoicingApiHelper';
6
- import { createInvoicingSetupIntent, createInvoicingSetupIntentFailure, createInvoicingSetupIntentSuccess, fetchInvoicingPlaidLinkToken, fetchInvoicingPlaidLinkTokenFailure, fetchInvoicingPlaidLinkTokenSuccess, saveInvoicingPaymentMethod, saveInvoicingPaymentMethodFailure, saveInvoicingPaymentMethodSuccess, sendInvoicingPaymentLink, sendInvoicingPaymentLinkFailure, sendInvoicingPaymentLinkSuccess, } from './customerPaymentMethodReducer';
7
- export const createInvoicingSetupIntentEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(createInvoicingSetupIntent.match), switchMap((action) => {
8
- const { customerId } = action.payload;
9
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/customers/${encodeURIComponent(customerId)}/payment-methods/setup-intent`;
10
- return zeniAPI
11
- .postAndGetJSON(apiUrl, {})
12
- .pipe(switchMap((response) => {
13
- if (isSuccessResponse(response) && response.data != null) {
14
- return of(createInvoicingSetupIntentSuccess(response.data));
15
- }
16
- return of(createInvoicingSetupIntentFailure(response.status));
17
- }), catchError((error) => of(createInvoicingSetupIntentFailure(createZeniAPIStatus('Unexpected Error', 'Setup intent REST API call errored out ' +
18
- JSON.stringify(error))))));
19
- }));
20
- export const fetchInvoicingPlaidLinkTokenEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingPlaidLinkToken.match), switchMap((action) => {
21
- const { customerId } = action.payload;
22
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/plaid/link-token?customer_id=${encodeURIComponent(customerId)}`;
23
- return zeniAPI
24
- .getJSON(apiUrl)
25
- .pipe(switchMap((response) => {
26
- if (isSuccessResponse(response) && response.data != null) {
27
- return of(fetchInvoicingPlaidLinkTokenSuccess(response.data.link_token));
28
- }
29
- return of(fetchInvoicingPlaidLinkTokenFailure(response.status));
30
- }), catchError((error) => of(fetchInvoicingPlaidLinkTokenFailure(createZeniAPIStatus('Unexpected Error', 'Plaid link token REST API call errored out ' +
31
- JSON.stringify(error))))));
32
- }));
33
- export const saveInvoicingPaymentMethodEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(saveInvoicingPaymentMethod.match), mergeMap((action) => {
34
- const { customerId, data } = action.payload;
35
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/customers/${encodeURIComponent(customerId)}/payment-methods`;
36
- return zeniAPI
37
- .postAndGetJSON(apiUrl, data)
38
- .pipe(mergeMap((response) => {
39
- if (isSuccessResponse(response) && response.data != null) {
40
- return [
41
- saveInvoicingPaymentMethodSuccess(),
42
- fetchInvoicingCustomerDetail({ id: customerId }),
43
- ];
44
- }
45
- return of(saveInvoicingPaymentMethodFailure(response.status));
46
- }), catchError((error) => of(saveInvoicingPaymentMethodFailure(createZeniAPIStatus('Unexpected Error', 'Save payment method REST API call errored out ' +
47
- JSON.stringify(error))))));
48
- }));
49
- export const sendInvoicingPaymentLinkEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(sendInvoicingPaymentLink.match), mergeMap((action) => {
50
- const { customerId, email } = action.payload;
51
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/customers/${encodeURIComponent(customerId)}/payment-link`;
52
- return zeniAPI
53
- .postAndGetJSON(apiUrl, {
54
- email,
55
- })
56
- .pipe(switchMap((response) => {
57
- if (isSuccessResponse(response) && response.data != null) {
58
- return of(sendInvoicingPaymentLinkSuccess(response.data.email));
59
- }
60
- return of(sendInvoicingPaymentLinkFailure(response.status));
61
- }), catchError((error) => of(sendInvoicingPaymentLinkFailure(createZeniAPIStatus('Unexpected Error', 'Send payment link REST API call errored out ' +
62
- JSON.stringify(error))))));
63
- }));
@@ -1,84 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- fetchState: 'Not-Started',
4
- error: undefined,
5
- customerId: undefined,
6
- plaidLinkToken: undefined,
7
- plaidTokenFetchState: { fetchState: 'Not-Started', error: undefined },
8
- saveFetchState: { fetchState: 'Not-Started', error: undefined },
9
- sendLinkFetchState: { fetchState: 'Not-Started', error: undefined },
10
- sentLinkEmail: undefined,
11
- setupIntent: undefined,
12
- setupIntentFetchState: { fetchState: 'Not-Started', error: undefined },
13
- hasValidState() {
14
- return true;
15
- },
16
- };
17
- const customerPaymentMethod = createSlice({
18
- name: 'invoicingCustomerPaymentMethod',
19
- initialState,
20
- reducers: {
21
- createInvoicingSetupIntent(draft, action) {
22
- draft.customerId = action.payload.customerId;
23
- draft.setupIntent = undefined;
24
- draft.setupIntentFetchState = {
25
- fetchState: 'In-Progress',
26
- error: undefined,
27
- };
28
- },
29
- createInvoicingSetupIntentSuccess(draft, action) {
30
- draft.setupIntent = action.payload;
31
- draft.setupIntentFetchState = {
32
- fetchState: 'Completed',
33
- error: undefined,
34
- };
35
- },
36
- createInvoicingSetupIntentFailure(draft, action) {
37
- draft.setupIntentFetchState = {
38
- fetchState: 'Error',
39
- error: action.payload,
40
- };
41
- },
42
- fetchInvoicingPlaidLinkToken(draft, action) {
43
- draft.customerId = action.payload.customerId;
44
- draft.plaidLinkToken = undefined;
45
- draft.plaidTokenFetchState = {
46
- fetchState: 'In-Progress',
47
- error: undefined,
48
- };
49
- },
50
- fetchInvoicingPlaidLinkTokenSuccess(draft, action) {
51
- draft.plaidLinkToken = action.payload;
52
- draft.plaidTokenFetchState = { fetchState: 'Completed', error: undefined };
53
- },
54
- fetchInvoicingPlaidLinkTokenFailure(draft, action) {
55
- draft.plaidTokenFetchState = { fetchState: 'Error', error: action.payload };
56
- },
57
- saveInvoicingPaymentMethod(draft, action) {
58
- draft.customerId = action.payload.customerId;
59
- draft.saveFetchState = { fetchState: 'In-Progress', error: undefined };
60
- },
61
- saveInvoicingPaymentMethodSuccess(draft) {
62
- draft.saveFetchState = { fetchState: 'Completed', error: undefined };
63
- },
64
- saveInvoicingPaymentMethodFailure(draft, action) {
65
- draft.saveFetchState = { fetchState: 'Error', error: action.payload };
66
- },
67
- sendInvoicingPaymentLink(draft, action) {
68
- draft.customerId = action.payload.customerId;
69
- draft.sendLinkFetchState = { fetchState: 'In-Progress', error: undefined };
70
- },
71
- sendInvoicingPaymentLinkSuccess(draft, action) {
72
- draft.sentLinkEmail = action.payload;
73
- draft.sendLinkFetchState = { fetchState: 'Completed', error: undefined };
74
- },
75
- sendInvoicingPaymentLinkFailure(draft, action) {
76
- draft.sendLinkFetchState = { fetchState: 'Error', error: action.payload };
77
- },
78
- resetInvoicingCustomerPaymentMethod(draft) {
79
- Object.assign(draft, initialState);
80
- },
81
- },
82
- });
83
- export const { createInvoicingSetupIntent, createInvoicingSetupIntentSuccess, createInvoicingSetupIntentFailure, fetchInvoicingPlaidLinkToken, fetchInvoicingPlaidLinkTokenSuccess, fetchInvoicingPlaidLinkTokenFailure, saveInvoicingPaymentMethod, saveInvoicingPaymentMethodSuccess, saveInvoicingPaymentMethodFailure, sendInvoicingPaymentLink, sendInvoicingPaymentLinkSuccess, sendInvoicingPaymentLinkFailure, resetInvoicingCustomerPaymentMethod, } = customerPaymentMethod.actions;
84
- export default customerPaymentMethod.reducer;
@@ -1,7 +0,0 @@
1
- export const getInvoicingSetupIntent = (state) => state.invoicingCustomerPaymentMethodState.setupIntent;
2
- export const getInvoicingSetupIntentFetchState = (state) => state.invoicingCustomerPaymentMethodState.setupIntentFetchState;
3
- export const getInvoicingPlaidLinkToken = (state) => state.invoicingCustomerPaymentMethodState.plaidLinkToken;
4
- export const getInvoicingPlaidLinkTokenFetchState = (state) => state.invoicingCustomerPaymentMethodState.plaidTokenFetchState;
5
- export const getInvoicingPaymentMethodSaveState = (state) => state.invoicingCustomerPaymentMethodState.saveFetchState;
6
- export const getInvoicingPaymentLinkSendState = (state) => state.invoicingCustomerPaymentMethodState.sendLinkFetchState;
7
- export const getInvoicingSentPaymentLinkEmail = (state) => state.invoicingCustomerPaymentMethodState.sentLinkEmail;
@@ -1,71 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, switchMap } from 'rxjs/operators';
3
- import { updateInvoicingCustomers } from '../../../entity/invoicing/customer/customerReducer';
4
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
5
- import { INVOICING_LIST_PAGE_SIZE, applyListSortParams, invoicingBaseUrl, withQuery, } from '../invoicingApiHelper';
6
- import { fetchInvoicingCustomerCounts, fetchInvoicingCustomerDetail, fetchInvoicingCustomerList, updateInvoicingCustomerCounts, updateInvoicingCustomerCountsFailure, updateInvoicingCustomerDetail, updateInvoicingCustomerDetailFailure, updateInvoicingCustomerList, updateInvoicingCustomerListFailure, } from './customerViewReducer';
7
- const buildQuery = (filters, cursor, sort) => {
8
- const params = new URLSearchParams();
9
- if (filters.search != null && filters.search.length > 0) {
10
- params.set('search', filters.search);
11
- }
12
- if (filters.status != null && filters.status.length > 0) {
13
- params.set('status', filters.status);
14
- }
15
- params.set('limit', String(INVOICING_LIST_PAGE_SIZE));
16
- if (cursor != null) {
17
- params.set('cursor', cursor);
18
- }
19
- applyListSortParams(params, sort);
20
- return params;
21
- };
22
- export const fetchInvoicingCustomerListEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingCustomerList.match), switchMap((action) => {
23
- const { filters, cursor, keepExistingListItems, sort } = action.payload;
24
- const apiUrl = withQuery(`${invoicingBaseUrl(zeniAPI)}/customers`, buildQuery(filters, cursor, sort));
25
- return zeniAPI
26
- .getJSON(apiUrl)
27
- .pipe(switchMap((response) => {
28
- if (isSuccessResponse(response)) {
29
- const items = response.data?.items ?? [];
30
- return [
31
- updateInvoicingCustomers(items, 'merge'),
32
- updateInvoicingCustomerList({
33
- ids: items.map((item) => item.id),
34
- nextCursor: response.data?.next_cursor ?? null,
35
- keepExistingListItems,
36
- }),
37
- ];
38
- }
39
- return of(updateInvoicingCustomerListFailure(response.status));
40
- }), catchError((error) => of(updateInvoicingCustomerListFailure(createZeniAPIStatus('Unexpected Error', 'Fetch customer list REST API call errored out ' +
41
- JSON.stringify(error))))));
42
- }));
43
- export const fetchInvoicingCustomerCountsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingCustomerCounts.match), switchMap(() => {
44
- const { filters } = state$.value.invoicingCustomerViewState;
45
- const params = new URLSearchParams();
46
- if (filters.search != null && filters.search.length > 0) {
47
- params.set('search', filters.search);
48
- }
49
- const apiUrl = withQuery(`${invoicingBaseUrl(zeniAPI)}/customers/counts`, params);
50
- return zeniAPI.getJSON(apiUrl).pipe(switchMap((response) => {
51
- if (isSuccessResponse(response) && response.data != null) {
52
- return of(updateInvoicingCustomerCounts(response.data));
53
- }
54
- return of(updateInvoicingCustomerCountsFailure(response.status));
55
- }), catchError((error) => of(updateInvoicingCustomerCountsFailure(createZeniAPIStatus('Unexpected Error', 'Fetch customer counts REST API call errored out ' +
56
- JSON.stringify(error))))));
57
- }));
58
- export const fetchInvoicingCustomerDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingCustomerDetail.match), switchMap((action) => {
59
- const { id } = action.payload;
60
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/customers/${id}`;
61
- return zeniAPI.getJSON(apiUrl).pipe(switchMap((response) => {
62
- if (isSuccessResponse(response) && response.data != null) {
63
- return [
64
- updateInvoicingCustomers([response.data], 'merge'),
65
- updateInvoicingCustomerDetail({ id: response.data.id }),
66
- ];
67
- }
68
- return of(updateInvoicingCustomerDetailFailure(response.status));
69
- }), catchError((error) => of(updateInvoicingCustomerDetailFailure(createZeniAPIStatus('Unexpected Error', 'Fetch customer detail REST API call errored out ' +
70
- JSON.stringify(error))))));
71
- }));
@@ -1,90 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- fetchState: 'Not-Started',
4
- error: undefined,
5
- ids: [],
6
- nextCursor: null,
7
- filters: {},
8
- counts: { all: 0 },
9
- countsFetchState: { fetchState: 'Not-Started', error: undefined },
10
- detailId: undefined,
11
- detailFetchState: { fetchState: 'Not-Started', error: undefined },
12
- hasValidState() {
13
- return this.fetchState === 'Completed';
14
- },
15
- };
16
- const customerView = createSlice({
17
- name: 'invoicingCustomerView',
18
- initialState,
19
- reducers: {
20
- fetchInvoicingCustomerList: {
21
- reducer(draft, action) {
22
- if (!action.payload.keepExistingListItems) {
23
- draft.ids = [];
24
- draft.nextCursor = null;
25
- }
26
- draft.filters = action.payload.filters;
27
- draft.sort = action.payload.sort;
28
- draft.fetchState = 'In-Progress';
29
- draft.error = undefined;
30
- },
31
- prepare(payload) {
32
- return {
33
- payload: {
34
- filters: payload.filters ?? {},
35
- cursor: payload.cursor,
36
- keepExistingListItems: payload.keepExistingListItems ?? false,
37
- sort: payload.sort,
38
- },
39
- };
40
- },
41
- },
42
- updateInvoicingCustomerList(draft, action) {
43
- draft.ids = action.payload.keepExistingListItems
44
- ? [...new Set([...draft.ids, ...action.payload.ids])]
45
- : action.payload.ids;
46
- draft.nextCursor = action.payload.nextCursor;
47
- draft.fetchState = 'Completed';
48
- draft.error = undefined;
49
- },
50
- updateInvoicingCustomerListFailure(draft, action) {
51
- draft.fetchState = 'Error';
52
- draft.error = action.payload;
53
- },
54
- fetchInvoicingCustomerCounts(draft) {
55
- draft.countsFetchState.fetchState = 'In-Progress';
56
- draft.countsFetchState.error = undefined;
57
- },
58
- updateInvoicingCustomerCounts(draft, action) {
59
- draft.counts = action.payload;
60
- draft.countsFetchState.fetchState = 'Completed';
61
- draft.countsFetchState.error = undefined;
62
- },
63
- updateInvoicingCustomerCountsFailure(draft, action) {
64
- draft.countsFetchState.fetchState = 'Error';
65
- draft.countsFetchState.error = action.payload;
66
- },
67
- updateInvoicingCustomerFilters(draft, action) {
68
- draft.filters = action.payload;
69
- },
70
- fetchInvoicingCustomerDetail(draft, action) {
71
- draft.detailId = action.payload.id;
72
- draft.detailFetchState.fetchState = 'In-Progress';
73
- draft.detailFetchState.error = undefined;
74
- },
75
- updateInvoicingCustomerDetail(draft, action) {
76
- draft.detailId = action.payload.id;
77
- draft.detailFetchState.fetchState = 'Completed';
78
- draft.detailFetchState.error = undefined;
79
- },
80
- updateInvoicingCustomerDetailFailure(draft, action) {
81
- draft.detailFetchState.fetchState = 'Error';
82
- draft.detailFetchState.error = action.payload;
83
- },
84
- clearInvoicingCustomerView(draft) {
85
- Object.assign(draft, initialState);
86
- },
87
- },
88
- });
89
- export const { fetchInvoicingCustomerList, updateInvoicingCustomerList, updateInvoicingCustomerListFailure, fetchInvoicingCustomerCounts, updateInvoicingCustomerCounts, updateInvoicingCustomerCountsFailure, updateInvoicingCustomerFilters, fetchInvoicingCustomerDetail, updateInvoicingCustomerDetail, updateInvoicingCustomerDetailFailure, clearInvoicingCustomerView, } = customerView.actions;
90
- export default customerView.reducer;
@@ -1,17 +0,0 @@
1
- export const getInvoicingCustomerListItems = (state) => state.invoicingCustomerViewState.ids
2
- .map((id) => state.invoicingCustomerState.customerByID[id])
3
- .filter((item) => item != null);
4
- export const getInvoicingCustomerListFetchState = (state) => ({
5
- fetchState: state.invoicingCustomerViewState.fetchState,
6
- error: state.invoicingCustomerViewState.error,
7
- });
8
- export const getInvoicingCustomerListNextCursor = (state) => state.invoicingCustomerViewState.nextCursor;
9
- export const getInvoicingCustomerListHasMore = (state) => state.invoicingCustomerViewState.nextCursor != null;
10
- export const getInvoicingCustomerListFilters = (state) => state.invoicingCustomerViewState.filters;
11
- export const getInvoicingCustomerCounts = (state) => state.invoicingCustomerViewState.counts;
12
- export const getInvoicingCustomerById = (state, id) => state.invoicingCustomerState.customerByID[id];
13
- export const getInvoicingCustomerDetail = (state) => {
14
- const id = state.invoicingCustomerViewState.detailId;
15
- return id != null ? state.invoicingCustomerState.customerByID[id] : undefined;
16
- };
17
- export const getInvoicingCustomerDetailFetchState = (state) => state.invoicingCustomerViewState.detailFetchState;
@@ -1,23 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { updateInvoicingCustomers } from '../../../entity/invoicing/customer/customerReducer';
4
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
5
- import { invoicingBaseUrl } from '../invoicingApiHelper';
6
- import { saveInvoicingCustomer, saveInvoicingCustomerFailure, saveInvoicingCustomerSuccess, } from './customerWriteReducer';
7
- export const saveInvoicingCustomerEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(saveInvoicingCustomer.match), mergeMap((action) => {
8
- const { data, id } = action.payload;
9
- const baseUrl = invoicingBaseUrl(zeniAPI);
10
- const request$ = id != null
11
- ? zeniAPI.putAndGetJSON(`${baseUrl}/customers/${encodeURIComponent(id)}`, { ...data })
12
- : zeniAPI.postAndGetJSON(`${baseUrl}/customers`, { ...data });
13
- return request$.pipe(mergeMap((response) => {
14
- if (isSuccessResponse(response) && response.data != null) {
15
- return [
16
- updateInvoicingCustomers([response.data], 'merge'),
17
- saveInvoicingCustomerSuccess({ customerId: response.data.id }),
18
- ];
19
- }
20
- return of(saveInvoicingCustomerFailure(response.status));
21
- }), catchError((error) => of(saveInvoicingCustomerFailure(createZeniAPIStatus('Unexpected Error', 'Save customer 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
- data: undefined,
6
- savedCustomerId: undefined,
7
- hasValidState() {
8
- return this.fetchState === 'Completed';
9
- },
10
- };
11
- const customerWrite = createSlice({
12
- name: 'invoicingCustomerWrite',
13
- initialState,
14
- reducers: {
15
- saveInvoicingCustomer(draft, action) {
16
- draft.fetchState = 'In-Progress';
17
- draft.error = undefined;
18
- draft.savedCustomerId = undefined;
19
- draft.data = action.payload.data;
20
- },
21
- saveInvoicingCustomerSuccess(draft, action) {
22
- draft.fetchState = 'Completed';
23
- draft.error = undefined;
24
- draft.savedCustomerId = action.payload.customerId;
25
- },
26
- saveInvoicingCustomerFailure(draft, action) {
27
- draft.fetchState = 'Error';
28
- draft.error = action.payload;
29
- },
30
- resetInvoicingCustomerWrite(draft) {
31
- Object.assign(draft, initialState);
32
- },
33
- },
34
- });
35
- export const { saveInvoicingCustomer, saveInvoicingCustomerSuccess, saveInvoicingCustomerFailure, resetInvoicingCustomerWrite, } = customerWrite.actions;
36
- export default customerWrite.reducer;
@@ -1,5 +0,0 @@
1
- export const getInvoicingCustomerWriteState = (state) => ({
2
- fetchState: state.invoicingCustomerWriteState.fetchState,
3
- error: state.invoicingCustomerWriteState.error,
4
- });
5
- export const getSavedInvoicingCustomerId = (state) => state.invoicingCustomerWriteState.savedCustomerId;
@@ -1,41 +0,0 @@
1
- import { merge, of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
4
- import { invoicingBaseUrl } from '../invoicingApiHelper';
5
- import { fetchInvoicingDataImportStatus, fetchInvoicingMigrationSessions, setInvoicingActiveMigrationSessionId, upsertInvoicingMigrationSession, } from '../dataImportView/dataImportViewReducer';
6
- import { connectInvoicingChargebee, invoicingDataImportActionFailure, invoicingDataImportActionSuccess, retryInvoicingMigration, rollbackInvoicingMigration, startInvoicingMigration, uploadInvoicingMigrationFiles, } from './dataImportActionReducer';
7
- const onSuccess = (kind, session) => [
8
- upsertInvoicingMigrationSession(session),
9
- setInvoicingActiveMigrationSessionId(session.id),
10
- invoicingDataImportActionSuccess(kind),
11
- fetchInvoicingMigrationSessions(),
12
- fetchInvoicingDataImportStatus(),
13
- ];
14
- const handleResponse = (kind, response$) => response$.pipe(mergeMap((response) => {
15
- if (isSuccessResponse(response) && response.data != null) {
16
- return onSuccess(kind, response.data);
17
- }
18
- return of(invoicingDataImportActionFailure({ kind, error: response.status }));
19
- }), catchError((error) => of(invoicingDataImportActionFailure({
20
- kind,
21
- error: createZeniAPIStatus('Unexpected Error', `Data import ${kind} REST API call errored out ` +
22
- JSON.stringify(error)),
23
- }))));
24
- export const invoicingDataImportActionEpic = (actions$, _state$, zeniAPI) => {
25
- const base = () => `${invoicingBaseUrl(zeniAPI)}/data-import`;
26
- const connect$ = actions$.pipe(filter(connectInvoicingChargebee.match), mergeMap((action) => handleResponse('connect', zeniAPI.postAndGetJSON(`${base()}/chargebee/connect`, {
27
- site: action.payload.site,
28
- ...(action.payload.apiKey != null && action.payload.apiKey.length > 0
29
- ? { api_key: action.payload.apiKey }
30
- : {}),
31
- }))));
32
- const upload$ = actions$.pipe(filter(uploadInvoicingMigrationFiles.match), mergeMap((action) => {
33
- const form = new FormData();
34
- action.payload.files.forEach((file) => form.append('files', file, file.name));
35
- return handleResponse('upload', zeniAPI.postFormData(`${base()}/uploads`, form));
36
- }));
37
- const start$ = actions$.pipe(filter(startInvoicingMigration.match), mergeMap((action) => handleResponse('start', zeniAPI.postAndGetJSON(`${base()}/${encodeURIComponent(action.payload)}/import`, {}))));
38
- const retry$ = actions$.pipe(filter(retryInvoicingMigration.match), mergeMap((action) => handleResponse('retry', zeniAPI.postAndGetJSON(`${base()}/${encodeURIComponent(action.payload)}/retry`, {}))));
39
- const rollback$ = actions$.pipe(filter(rollbackInvoicingMigration.match), mergeMap((action) => handleResponse('rollback', zeniAPI.postAndGetJSON(`${base()}/${encodeURIComponent(action.payload)}/rollback`, {}))));
40
- return merge(connect$, upload$, start$, retry$, rollback$);
41
- };
@@ -1,73 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- byKind: {},
4
- };
5
- const inProgress = (draft, kind) => {
6
- draft.byKind[kind] = { fetchState: 'In-Progress', error: undefined };
7
- };
8
- const dataImportAction = createSlice({
9
- name: 'invoicingDataImportAction',
10
- initialState,
11
- reducers: {
12
- connectInvoicingChargebee: {
13
- reducer(draft) {
14
- inProgress(draft, 'connect');
15
- },
16
- prepare(payload) {
17
- return { payload };
18
- },
19
- },
20
- uploadInvoicingMigrationFiles: {
21
- reducer(draft) {
22
- inProgress(draft, 'upload');
23
- },
24
- prepare(payload) {
25
- return { payload };
26
- },
27
- },
28
- startInvoicingMigration: {
29
- reducer(draft) {
30
- inProgress(draft, 'start');
31
- },
32
- prepare(payload) {
33
- return { payload };
34
- },
35
- },
36
- retryInvoicingMigration: {
37
- reducer(draft) {
38
- inProgress(draft, 'retry');
39
- },
40
- prepare(payload) {
41
- return { payload };
42
- },
43
- },
44
- rollbackInvoicingMigration: {
45
- reducer(draft) {
46
- inProgress(draft, 'rollback');
47
- },
48
- prepare(payload) {
49
- return { payload };
50
- },
51
- },
52
- invoicingDataImportActionSuccess(draft, action) {
53
- draft.byKind[action.payload] = {
54
- fetchState: 'Completed',
55
- error: undefined,
56
- };
57
- },
58
- invoicingDataImportActionFailure(draft, action) {
59
- draft.byKind[action.payload.kind] = {
60
- fetchState: 'Error',
61
- error: action.payload.error,
62
- };
63
- },
64
- clearInvoicingDataImportAction(draft, action) {
65
- delete draft.byKind[action.payload];
66
- },
67
- clearAllInvoicingDataImportActions(draft) {
68
- draft.byKind = {};
69
- },
70
- },
71
- });
72
- export const { connectInvoicingChargebee, uploadInvoicingMigrationFiles, startInvoicingMigration, retryInvoicingMigration, rollbackInvoicingMigration, invoicingDataImportActionSuccess, invoicingDataImportActionFailure, clearInvoicingDataImportAction, clearAllInvoicingDataImportActions, } = dataImportAction.actions;
73
- export default dataImportAction.reducer;
@@ -1,5 +0,0 @@
1
- const NOT_STARTED = {
2
- fetchState: 'Not-Started',
3
- error: undefined,
4
- };
5
- export const getInvoicingDataImportActionState = (kind) => (state) => state.invoicingDataImportActionState.byKind[kind] ?? NOT_STARTED;
@@ -1,41 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
4
- import { invoicingBaseUrl } from '../invoicingApiHelper';
5
- import { fetchInvoicingDataImportStatus, fetchInvoicingMigrationSession, fetchInvoicingMigrationSessions, updateInvoicingDataImportStatus, updateInvoicingDataImportStatusFailure, updateInvoicingMigrationSessions, updateInvoicingMigrationSessionsFailure, upsertInvoicingMigrationSession, } from './dataImportViewReducer';
6
- export const fetchInvoicingMigrationSessionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingMigrationSessions.match), switchMap(() => {
7
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/data-import/sessions`;
8
- return zeniAPI
9
- .getJSON(apiUrl)
10
- .pipe(switchMap((response) => {
11
- if (isSuccessResponse(response)) {
12
- return of(updateInvoicingMigrationSessions(response.data ?? []));
13
- }
14
- return of(updateInvoicingMigrationSessionsFailure(response.status));
15
- }), catchError((error) => of(updateInvoicingMigrationSessionsFailure(createZeniAPIStatus('Unexpected Error', 'Fetch migration sessions REST API call errored out ' +
16
- JSON.stringify(error))))));
17
- }));
18
- export const fetchInvoicingDataImportStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingDataImportStatus.match), switchMap(() => {
19
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/data-import/status`;
20
- return zeniAPI
21
- .getJSON(apiUrl)
22
- .pipe(switchMap((response) => {
23
- if (isSuccessResponse(response)) {
24
- return of(updateInvoicingDataImportStatus(response.data ?? []));
25
- }
26
- return of(updateInvoicingDataImportStatusFailure(response.status));
27
- }), catchError((error) => of(updateInvoicingDataImportStatusFailure(createZeniAPIStatus('Unexpected Error', 'Fetch data import status REST API call errored out ' +
28
- JSON.stringify(error))))));
29
- }));
30
- export const fetchInvoicingMigrationSessionEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingMigrationSession.match), mergeMap((action) => {
31
- const apiUrl = `${invoicingBaseUrl(zeniAPI)}/data-import/${encodeURIComponent(action.payload)}`;
32
- return zeniAPI
33
- .getJSON(apiUrl)
34
- .pipe(switchMap((response) => {
35
- if (isSuccessResponse(response) && response.data != null) {
36
- return of(upsertInvoicingMigrationSession(response.data));
37
- }
38
- return of(updateInvoicingMigrationSessionsFailure(response.status));
39
- }), catchError((error) => of(updateInvoicingMigrationSessionsFailure(createZeniAPIStatus('Unexpected Error', 'Fetch migration session REST API call errored out ' +
40
- JSON.stringify(error))))));
41
- }));
@@ -1,66 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- export const initialState = {
3
- activeDetailId: null,
4
- sessions: [],
5
- sessionsFetch: { fetchState: 'Not-Started', error: undefined },
6
- statusRows: [],
7
- statusFetch: { fetchState: 'Not-Started', error: undefined },
8
- sessionDetail: {},
9
- };
10
- const upsertSessionInList = (list, session) => {
11
- const index = list.findIndex((item) => item.id === session.id);
12
- if (index >= 0) {
13
- const next = [...list];
14
- next[index] = session;
15
- return next;
16
- }
17
- return [session, ...list];
18
- };
19
- const dataImportView = createSlice({
20
- name: 'invoicingDataImportView',
21
- initialState,
22
- reducers: {
23
- fetchInvoicingMigrationSessions(draft) {
24
- draft.sessionsFetch = { fetchState: 'In-Progress', error: undefined };
25
- },
26
- updateInvoicingMigrationSessions(draft, action) {
27
- draft.sessions = action.payload;
28
- draft.sessionsFetch = { fetchState: 'Completed', error: undefined };
29
- },
30
- updateInvoicingMigrationSessionsFailure(draft, action) {
31
- draft.sessionsFetch = { fetchState: 'Error', error: action.payload };
32
- },
33
- fetchInvoicingDataImportStatus(draft) {
34
- draft.statusFetch = { fetchState: 'In-Progress', error: undefined };
35
- },
36
- updateInvoicingDataImportStatus(draft, action) {
37
- draft.statusRows = action.payload;
38
- draft.statusFetch = { fetchState: 'Completed', error: undefined };
39
- },
40
- updateInvoicingDataImportStatusFailure(draft, action) {
41
- draft.statusFetch = { fetchState: 'Error', error: action.payload };
42
- },
43
- setInvoicingActiveMigrationSessionId(draft, action) {
44
- draft.activeDetailId = action.payload;
45
- },
46
- fetchInvoicingMigrationSession(draft, action) {
47
- // Detail/polling fetch is handled by the epic; the cache is updated via
48
- // upsert. We track the in-flight id so the UI can scope its polling.
49
- draft.activeDetailId = action.payload;
50
- },
51
- upsertInvoicingMigrationSession(draft, action) {
52
- draft.sessionDetail[action.payload.id] = action.payload;
53
- draft.sessions = upsertSessionInList(draft.sessions, action.payload);
54
- },
55
- clearInvoicingDataImportView(draft) {
56
- draft.activeDetailId = null;
57
- draft.sessions = [];
58
- draft.sessionsFetch = { fetchState: 'Not-Started', error: undefined };
59
- draft.statusRows = [];
60
- draft.statusFetch = { fetchState: 'Not-Started', error: undefined };
61
- draft.sessionDetail = {};
62
- },
63
- },
64
- });
65
- export const { fetchInvoicingMigrationSessions, updateInvoicingMigrationSessions, updateInvoicingMigrationSessionsFailure, fetchInvoicingDataImportStatus, updateInvoicingDataImportStatus, updateInvoicingDataImportStatusFailure, fetchInvoicingMigrationSession, setInvoicingActiveMigrationSessionId, upsertInvoicingMigrationSession, clearInvoicingDataImportView, } = dataImportView.actions;
66
- export default dataImportView.reducer;
@@ -1,6 +0,0 @@
1
- export const getInvoicingMigrationSessions = (state) => state.invoicingDataImportViewState.sessions;
2
- export const getInvoicingMigrationSessionsFetchState = (state) => state.invoicingDataImportViewState.sessionsFetch;
3
- export const getInvoicingDataImportStatusRows = (state) => state.invoicingDataImportViewState.statusRows;
4
- export const getInvoicingDataImportStatusFetchState = (state) => state.invoicingDataImportViewState.statusFetch;
5
- export const getInvoicingMigrationSessionById = (id) => (state) => id != null ? state.invoicingDataImportViewState.sessionDetail[id] : undefined;
6
- export const getInvoicingActiveMigrationSessionId = (state) => state.invoicingDataImportViewState.activeDetailId;