@reventlessdev/online-shop-aggregates-catalog 3.0.0-alpha.101

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 (330) hide show
  1. package/CHANGELOG.md +854 -0
  2. package/LICENSE +202 -0
  3. package/__mocks__/emptyModule.js +1 -0
  4. package/lib/bs/.compiler.log +2 -0
  5. package/lib/bs/CatalogPlugin.cmi +0 -0
  6. package/lib/bs/CatalogPlugin.cmj +0 -0
  7. package/lib/bs/CatalogPlugin.cmt +0 -0
  8. package/lib/bs/CatalogPlugin.mlmap +25 -0
  9. package/lib/bs/build.ninja +0 -0
  10. package/lib/bs/compiler-info.json +8 -0
  11. package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmi +0 -0
  12. package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmj +0 -0
  13. package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmt +0 -0
  14. package/lib/bs/src/Category/Aggregate/Category.ast +0 -0
  15. package/lib/bs/src/Category/Aggregate/Category.res +22 -0
  16. package/lib/bs/src/Category/Aggregate/Category.res.mjs +61 -0
  17. package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmi +0 -0
  18. package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmj +0 -0
  19. package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmt +0 -0
  20. package/lib/bs/src/Category/Aggregate/Category_Behavior.ast +0 -0
  21. package/lib/bs/src/Category/Aggregate/Category_Behavior.res +36 -0
  22. package/lib/bs/src/Category/Aggregate/Category_Behavior.res.mjs +106 -0
  23. package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmi +0 -0
  24. package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmj +0 -0
  25. package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmt +0 -0
  26. package/lib/bs/src/Category/ReadModel/Categories.ast +0 -0
  27. package/lib/bs/src/Category/ReadModel/Categories.res +11 -0
  28. package/lib/bs/src/Category/ReadModel/Categories.res.mjs +35 -0
  29. package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmi +0 -0
  30. package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmj +0 -0
  31. package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmt +0 -0
  32. package/lib/bs/src/Category/ReadModel/Categories_Projections.ast +0 -0
  33. package/lib/bs/src/Category/ReadModel/Categories_Projections.res +19 -0
  34. package/lib/bs/src/Category/ReadModel/Categories_Projections.res.mjs +75 -0
  35. package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmi +0 -0
  36. package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmj +0 -0
  37. package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmt +0 -0
  38. package/lib/bs/src/Extension/Orders_Extension.ast +0 -0
  39. package/lib/bs/src/Extension/Orders_Extension.res +23 -0
  40. package/lib/bs/src/Extension/Orders_Extension.res.mjs +42 -0
  41. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
  42. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmj +0 -0
  43. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
  44. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.ast +0 -0
  45. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.res +19 -0
  46. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs +56 -0
  47. package/lib/bs/src/Plugin-CatalogPlugin.cmi +0 -0
  48. package/lib/bs/src/Plugin-CatalogPlugin.cmj +0 -0
  49. package/lib/bs/src/Plugin-CatalogPlugin.cmt +0 -0
  50. package/lib/bs/src/Plugin.ast +0 -0
  51. package/lib/bs/src/Plugin.res +65 -0
  52. package/lib/bs/src/Plugin.res.mjs +222 -0
  53. package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmi +0 -0
  54. package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmj +0 -0
  55. package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmt +0 -0
  56. package/lib/bs/src/Product/Aggregate/Product.ast +0 -0
  57. package/lib/bs/src/Product/Aggregate/Product.res +23 -0
  58. package/lib/bs/src/Product/Aggregate/Product.res.mjs +71 -0
  59. package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmi +0 -0
  60. package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmj +0 -0
  61. package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmt +0 -0
  62. package/lib/bs/src/Product/Aggregate/Product_Behavior.ast +0 -0
  63. package/lib/bs/src/Product/Aggregate/Product_Behavior.res +38 -0
  64. package/lib/bs/src/Product/Aggregate/Product_Behavior.res.mjs +150 -0
  65. package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmi +0 -0
  66. package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmj +0 -0
  67. package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmt +0 -0
  68. package/lib/bs/src/Product/ReadModel/Products.ast +0 -0
  69. package/lib/bs/src/Product/ReadModel/Products.res +12 -0
  70. package/lib/bs/src/Product/ReadModel/Products.res.mjs +36 -0
  71. package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmi +0 -0
  72. package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmj +0 -0
  73. package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmt +0 -0
  74. package/lib/bs/src/Product/ReadModel/Products_Projections.ast +0 -0
  75. package/lib/bs/src/Product/ReadModel/Products_Projections.res +22 -0
  76. package/lib/bs/src/Product/ReadModel/Products_Projections.res.mjs +91 -0
  77. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmi +0 -0
  78. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmj +0 -0
  79. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmt +0 -0
  80. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand.ast +0 -0
  81. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand.res +20 -0
  82. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand.res.mjs +51 -0
  83. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
  84. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmj +0 -0
  85. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
  86. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior.ast +0 -0
  87. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior.res +39 -0
  88. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior.res.mjs +102 -0
  89. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmi +0 -0
  90. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmj +0 -0
  91. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmt +0 -0
  92. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands.ast +0 -0
  93. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands.res +8 -0
  94. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands.res.mjs +35 -0
  95. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
  96. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmj +0 -0
  97. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
  98. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.ast +0 -0
  99. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.res +36 -0
  100. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.res.mjs +99 -0
  101. package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmi +0 -0
  102. package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmj +0 -0
  103. package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmt +0 -0
  104. package/lib/bs/src/Task/ImportProducts.ast +0 -0
  105. package/lib/bs/src/Task/ImportProducts.res +48 -0
  106. package/lib/bs/src/Task/ImportProducts.res.mjs +58 -0
  107. package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmi +0 -0
  108. package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmj +0 -0
  109. package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmt +0 -0
  110. package/lib/bs/tests/Category/Aggregate/Category_GWT.ast +0 -0
  111. package/lib/bs/tests/Category/Aggregate/Category_GWT.res +51 -0
  112. package/lib/bs/tests/Category/Aggregate/Category_GWT.res.mjs +125 -0
  113. package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmi +0 -0
  114. package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmj +0 -0
  115. package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmt +0 -0
  116. package/lib/bs/tests/Category/ReadModel/Categories_GWT.ast +0 -0
  117. package/lib/bs/tests/Category/ReadModel/Categories_GWT.res +21 -0
  118. package/lib/bs/tests/Category/ReadModel/Categories_GWT.res.mjs +88 -0
  119. package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
  120. package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmj +0 -0
  121. package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
  122. package/lib/bs/tests/Extension/Orders_Extension_GWT.ast +0 -0
  123. package/lib/bs/tests/Extension/Orders_Extension_GWT.res +21 -0
  124. package/lib/bs/tests/Extension/Orders_Extension_GWT.res.mjs +105 -0
  125. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
  126. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmj +0 -0
  127. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
  128. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.ast +0 -0
  129. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +31 -0
  130. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res.mjs +114 -0
  131. package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmi +0 -0
  132. package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmj +0 -0
  133. package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmt +0 -0
  134. package/lib/bs/tests/Product/Aggregate/Product_GWT.ast +0 -0
  135. package/lib/bs/tests/Product/Aggregate/Product_GWT.res +69 -0
  136. package/lib/bs/tests/Product/Aggregate/Product_GWT.res.mjs +166 -0
  137. package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmi +0 -0
  138. package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmj +0 -0
  139. package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmt +0 -0
  140. package/lib/bs/tests/Product/ReadModel/Products_GWT.ast +0 -0
  141. package/lib/bs/tests/Product/ReadModel/Products_GWT.res +27 -0
  142. package/lib/bs/tests/Product/ReadModel/Products_GWT.res.mjs +113 -0
  143. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
  144. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmj +0 -0
  145. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
  146. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.ast +0 -0
  147. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +39 -0
  148. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +114 -0
  149. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
  150. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmj +0 -0
  151. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
  152. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.ast +0 -0
  153. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +56 -0
  154. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.res.mjs +73 -0
  155. package/lib/ocaml/.compiler.log +2 -0
  156. package/lib/ocaml/CatalogPlugin.cmi +0 -0
  157. package/lib/ocaml/CatalogPlugin.cmj +0 -0
  158. package/lib/ocaml/CatalogPlugin.cmt +0 -0
  159. package/lib/ocaml/CatalogPlugin.mlmap +25 -0
  160. package/lib/ocaml/Categories-CatalogPlugin.cmi +0 -0
  161. package/lib/ocaml/Categories-CatalogPlugin.cmj +0 -0
  162. package/lib/ocaml/Categories-CatalogPlugin.cmt +0 -0
  163. package/lib/ocaml/Categories.ast +0 -0
  164. package/lib/ocaml/Categories.res +11 -0
  165. package/lib/ocaml/Categories_GWT-CatalogPlugin.cmi +0 -0
  166. package/lib/ocaml/Categories_GWT-CatalogPlugin.cmj +0 -0
  167. package/lib/ocaml/Categories_GWT-CatalogPlugin.cmt +0 -0
  168. package/lib/ocaml/Categories_GWT.ast +0 -0
  169. package/lib/ocaml/Categories_GWT.res +21 -0
  170. package/lib/ocaml/Categories_Projections-CatalogPlugin.cmi +0 -0
  171. package/lib/ocaml/Categories_Projections-CatalogPlugin.cmj +0 -0
  172. package/lib/ocaml/Categories_Projections-CatalogPlugin.cmt +0 -0
  173. package/lib/ocaml/Categories_Projections.ast +0 -0
  174. package/lib/ocaml/Categories_Projections.res +19 -0
  175. package/lib/ocaml/Category-CatalogPlugin.cmi +0 -0
  176. package/lib/ocaml/Category-CatalogPlugin.cmj +0 -0
  177. package/lib/ocaml/Category-CatalogPlugin.cmt +0 -0
  178. package/lib/ocaml/Category.ast +0 -0
  179. package/lib/ocaml/Category.res +22 -0
  180. package/lib/ocaml/Category_Behavior-CatalogPlugin.cmi +0 -0
  181. package/lib/ocaml/Category_Behavior-CatalogPlugin.cmj +0 -0
  182. package/lib/ocaml/Category_Behavior-CatalogPlugin.cmt +0 -0
  183. package/lib/ocaml/Category_Behavior.ast +0 -0
  184. package/lib/ocaml/Category_Behavior.res +36 -0
  185. package/lib/ocaml/Category_GWT-CatalogPlugin.cmi +0 -0
  186. package/lib/ocaml/Category_GWT-CatalogPlugin.cmj +0 -0
  187. package/lib/ocaml/Category_GWT-CatalogPlugin.cmt +0 -0
  188. package/lib/ocaml/Category_GWT.ast +0 -0
  189. package/lib/ocaml/Category_GWT.res +51 -0
  190. package/lib/ocaml/ImportProducts-CatalogPlugin.cmi +0 -0
  191. package/lib/ocaml/ImportProducts-CatalogPlugin.cmj +0 -0
  192. package/lib/ocaml/ImportProducts-CatalogPlugin.cmt +0 -0
  193. package/lib/ocaml/ImportProducts.ast +0 -0
  194. package/lib/ocaml/ImportProducts.res +48 -0
  195. package/lib/ocaml/Orders_Extension-CatalogPlugin.cmi +0 -0
  196. package/lib/ocaml/Orders_Extension-CatalogPlugin.cmj +0 -0
  197. package/lib/ocaml/Orders_Extension-CatalogPlugin.cmt +0 -0
  198. package/lib/ocaml/Orders_Extension.ast +0 -0
  199. package/lib/ocaml/Orders_Extension.res +23 -0
  200. package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
  201. package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmj +0 -0
  202. package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
  203. package/lib/ocaml/Orders_Extension_GWT.ast +0 -0
  204. package/lib/ocaml/Orders_Extension_GWT.res +21 -0
  205. package/lib/ocaml/Plugin-CatalogPlugin.cmi +0 -0
  206. package/lib/ocaml/Plugin-CatalogPlugin.cmj +0 -0
  207. package/lib/ocaml/Plugin-CatalogPlugin.cmt +0 -0
  208. package/lib/ocaml/Plugin.ast +0 -0
  209. package/lib/ocaml/Plugin.res +65 -0
  210. package/lib/ocaml/Product-CatalogPlugin.cmi +0 -0
  211. package/lib/ocaml/Product-CatalogPlugin.cmj +0 -0
  212. package/lib/ocaml/Product-CatalogPlugin.cmt +0 -0
  213. package/lib/ocaml/Product.ast +0 -0
  214. package/lib/ocaml/Product.res +23 -0
  215. package/lib/ocaml/ProductDemand-CatalogPlugin.cmi +0 -0
  216. package/lib/ocaml/ProductDemand-CatalogPlugin.cmj +0 -0
  217. package/lib/ocaml/ProductDemand-CatalogPlugin.cmt +0 -0
  218. package/lib/ocaml/ProductDemand.ast +0 -0
  219. package/lib/ocaml/ProductDemand.res +20 -0
  220. package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
  221. package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmj +0 -0
  222. package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
  223. package/lib/ocaml/ProductDemand_Behavior.ast +0 -0
  224. package/lib/ocaml/ProductDemand_Behavior.res +39 -0
  225. package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
  226. package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmj +0 -0
  227. package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
  228. package/lib/ocaml/ProductDemand_GWT.ast +0 -0
  229. package/lib/ocaml/ProductDemand_GWT.res +39 -0
  230. package/lib/ocaml/ProductDemands-CatalogPlugin.cmi +0 -0
  231. package/lib/ocaml/ProductDemands-CatalogPlugin.cmj +0 -0
  232. package/lib/ocaml/ProductDemands-CatalogPlugin.cmt +0 -0
  233. package/lib/ocaml/ProductDemands.ast +0 -0
  234. package/lib/ocaml/ProductDemands.res +8 -0
  235. package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
  236. package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmj +0 -0
  237. package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
  238. package/lib/ocaml/ProductDemands_GWT.ast +0 -0
  239. package/lib/ocaml/ProductDemands_GWT.res +56 -0
  240. package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
  241. package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmj +0 -0
  242. package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
  243. package/lib/ocaml/ProductDemands_Projections.ast +0 -0
  244. package/lib/ocaml/ProductDemands_Projections.res +36 -0
  245. package/lib/ocaml/Product_Behavior-CatalogPlugin.cmi +0 -0
  246. package/lib/ocaml/Product_Behavior-CatalogPlugin.cmj +0 -0
  247. package/lib/ocaml/Product_Behavior-CatalogPlugin.cmt +0 -0
  248. package/lib/ocaml/Product_Behavior.ast +0 -0
  249. package/lib/ocaml/Product_Behavior.res +38 -0
  250. package/lib/ocaml/Product_GWT-CatalogPlugin.cmi +0 -0
  251. package/lib/ocaml/Product_GWT-CatalogPlugin.cmj +0 -0
  252. package/lib/ocaml/Product_GWT-CatalogPlugin.cmt +0 -0
  253. package/lib/ocaml/Product_GWT.ast +0 -0
  254. package/lib/ocaml/Product_GWT.res +69 -0
  255. package/lib/ocaml/Products-CatalogPlugin.cmi +0 -0
  256. package/lib/ocaml/Products-CatalogPlugin.cmj +0 -0
  257. package/lib/ocaml/Products-CatalogPlugin.cmt +0 -0
  258. package/lib/ocaml/Products.ast +0 -0
  259. package/lib/ocaml/Products.res +12 -0
  260. package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
  261. package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmj +0 -0
  262. package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
  263. package/lib/ocaml/Products_ExtensionPointMapping.ast +0 -0
  264. package/lib/ocaml/Products_ExtensionPointMapping.res +19 -0
  265. package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
  266. package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmj +0 -0
  267. package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
  268. package/lib/ocaml/Products_ExtensionPointMapping_GWT.ast +0 -0
  269. package/lib/ocaml/Products_ExtensionPointMapping_GWT.res +31 -0
  270. package/lib/ocaml/Products_GWT-CatalogPlugin.cmi +0 -0
  271. package/lib/ocaml/Products_GWT-CatalogPlugin.cmj +0 -0
  272. package/lib/ocaml/Products_GWT-CatalogPlugin.cmt +0 -0
  273. package/lib/ocaml/Products_GWT.ast +0 -0
  274. package/lib/ocaml/Products_GWT.res +27 -0
  275. package/lib/ocaml/Products_Projections-CatalogPlugin.cmi +0 -0
  276. package/lib/ocaml/Products_Projections-CatalogPlugin.cmj +0 -0
  277. package/lib/ocaml/Products_Projections-CatalogPlugin.cmt +0 -0
  278. package/lib/ocaml/Products_Projections.ast +0 -0
  279. package/lib/ocaml/Products_Projections.res +22 -0
  280. package/package.json +52 -0
  281. package/rescript.json +39 -0
  282. package/src/Category/Aggregate/Category.res +22 -0
  283. package/src/Category/Aggregate/Category.res.mjs +61 -0
  284. package/src/Category/Aggregate/Category_Behavior.res +36 -0
  285. package/src/Category/Aggregate/Category_Behavior.res.mjs +106 -0
  286. package/src/Category/ReadModel/Categories.res +11 -0
  287. package/src/Category/ReadModel/Categories.res.mjs +35 -0
  288. package/src/Category/ReadModel/Categories_Projections.res +19 -0
  289. package/src/Category/ReadModel/Categories_Projections.res.mjs +75 -0
  290. package/src/Extension/Orders_Extension.res +23 -0
  291. package/src/Extension/Orders_Extension.res.mjs +42 -0
  292. package/src/ExtensionPoint/Products_ExtensionPointMapping.res +19 -0
  293. package/src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs +56 -0
  294. package/src/Plugin.res +65 -0
  295. package/src/Plugin.res.mjs +222 -0
  296. package/src/Product/Aggregate/Product.res +23 -0
  297. package/src/Product/Aggregate/Product.res.mjs +71 -0
  298. package/src/Product/Aggregate/Product_Behavior.res +38 -0
  299. package/src/Product/Aggregate/Product_Behavior.res.mjs +150 -0
  300. package/src/Product/ReadModel/Products.res +12 -0
  301. package/src/Product/ReadModel/Products.res.mjs +36 -0
  302. package/src/Product/ReadModel/Products_Projections.res +22 -0
  303. package/src/Product/ReadModel/Products_Projections.res.mjs +91 -0
  304. package/src/ProductDemand/Aggregate/ProductDemand.res +20 -0
  305. package/src/ProductDemand/Aggregate/ProductDemand.res.mjs +51 -0
  306. package/src/ProductDemand/Aggregate/ProductDemand_Behavior.res +39 -0
  307. package/src/ProductDemand/Aggregate/ProductDemand_Behavior.res.mjs +102 -0
  308. package/src/ProductDemand/ReadModel/ProductDemands.res +8 -0
  309. package/src/ProductDemand/ReadModel/ProductDemands.res.mjs +35 -0
  310. package/src/ProductDemand/ReadModel/ProductDemands_Projections.res +36 -0
  311. package/src/ProductDemand/ReadModel/ProductDemands_Projections.res.mjs +99 -0
  312. package/src/Task/ImportProducts.res +48 -0
  313. package/src/Task/ImportProducts.res.mjs +58 -0
  314. package/src/plugin.json +1 -0
  315. package/tests/Category/Aggregate/Category_GWT.res +51 -0
  316. package/tests/Category/Aggregate/Category_GWT.res.mjs +125 -0
  317. package/tests/Category/ReadModel/Categories_GWT.res +21 -0
  318. package/tests/Category/ReadModel/Categories_GWT.res.mjs +88 -0
  319. package/tests/Extension/Orders_Extension_GWT.res +21 -0
  320. package/tests/Extension/Orders_Extension_GWT.res.mjs +105 -0
  321. package/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +31 -0
  322. package/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res.mjs +114 -0
  323. package/tests/Product/Aggregate/Product_GWT.res +69 -0
  324. package/tests/Product/Aggregate/Product_GWT.res.mjs +166 -0
  325. package/tests/Product/ReadModel/Products_GWT.res +27 -0
  326. package/tests/Product/ReadModel/Products_GWT.res.mjs +113 -0
  327. package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +39 -0
  328. package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +114 -0
  329. package/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +56 -0
  330. package/tests/ProductDemand/ReadModel/ProductDemands_GWT.res.mjs +73 -0
@@ -0,0 +1,99 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
4
+ import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.js";
5
+ import * as Product$CatalogPlugin from "../../Product/Aggregate/Product.res.mjs";
6
+ import * as Projection$Reventless from "@reventlessdev/reventless-spec/src/types/Projection.res.mjs";
7
+ import * as ProductDemand$CatalogPlugin from "../Aggregate/ProductDemand.res.mjs";
8
+ import * as ProductDemands$CatalogPlugin from "./ProductDemands.res.mjs";
9
+
10
+ let M = Projection$Reventless.Mappings.Make({
11
+ Id: Id$Reventless.$$String,
12
+ name: ProductDemands$CatalogPlugin.name,
13
+ stateSchema: ProductDemands$CatalogPlugin.stateSchema,
14
+ subIdConfig: undefined
15
+ });
16
+
17
+ function project(param) {
18
+ let event = param.event;
19
+ if (event.TAG === "Added") {
20
+ return {
21
+ TAG: "Set",
22
+ _0: param.id,
23
+ _1: {
24
+ name: event.name,
25
+ orderCount: 0
26
+ }
27
+ };
28
+ } else {
29
+ return "Ignore";
30
+ }
31
+ }
32
+
33
+ let ProductMapping = Projection$Reventless.Mapping.Make({
34
+ Id: Id$Reventless.$$String,
35
+ name: Product$CatalogPlugin.name,
36
+ eventSchema: Product$CatalogPlugin.eventSchema
37
+ })({
38
+ Id: Id$Reventless.$$String,
39
+ name: ProductDemands$CatalogPlugin.name,
40
+ stateSchema: ProductDemands$CatalogPlugin.stateSchema,
41
+ subIdConfig: undefined
42
+ })({
43
+ project: project
44
+ });
45
+
46
+ function project$1(param) {
47
+ let id = param.id;
48
+ if (param.event.TAG === "Recorded") {
49
+ return {
50
+ TAG: "Update",
51
+ _0: id,
52
+ _1: state => ({
53
+ name: state.name,
54
+ orderCount: state.orderCount + 1 | 0
55
+ })
56
+ };
57
+ } else {
58
+ return {
59
+ TAG: "Update",
60
+ _0: id,
61
+ _1: state => ({
62
+ name: state.name,
63
+ orderCount: Primitive_int.max(0, state.orderCount - 1 | 0)
64
+ })
65
+ };
66
+ }
67
+ }
68
+
69
+ let ProductDemandMapping = Projection$Reventless.Mapping.Make({
70
+ Id: Id$Reventless.$$String,
71
+ name: ProductDemand$CatalogPlugin.name,
72
+ eventSchema: ProductDemand$CatalogPlugin.eventSchema
73
+ })({
74
+ Id: Id$Reventless.$$String,
75
+ name: ProductDemands$CatalogPlugin.name,
76
+ stateSchema: ProductDemands$CatalogPlugin.stateSchema,
77
+ subIdConfig: undefined
78
+ })({
79
+ project: project$1
80
+ });
81
+
82
+ let mappings = [
83
+ ProductMapping,
84
+ ProductDemandMapping
85
+ ];
86
+
87
+ let Target;
88
+
89
+ let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/ProductDemand/ReadModel/ProductDemands_Projections.res.mjs";
90
+
91
+ export {
92
+ Target,
93
+ M,
94
+ ProductMapping,
95
+ ProductDemandMapping,
96
+ mappings,
97
+ moduleUrl,
98
+ }
99
+ /* M Not a pure module */
@@ -0,0 +1,48 @@
1
+ // Import products from a CSV file uploaded to S3.
2
+ // Each row is translated to a Product.Add command.
3
+
4
+ @@reventless.task
5
+
6
+ let importCallback = (~eventName, ~key) => {
7
+ if eventName->String.includes("ObjectCreated") {
8
+ Console.log("[ImportProducts] Processing file: " ++ key)
9
+
10
+ let meta: Message.meta = {
11
+ service: "ImportProducts",
12
+ time: Date.now()->Float.toString,
13
+ ip: "",
14
+ user: "system",
15
+ msgId: key,
16
+ correlationId: key,
17
+ }
18
+
19
+ [
20
+ Task.PublishCommands(
21
+ "Product",
22
+ [
23
+ {
24
+ id: key,
25
+ meta,
26
+ commandJson: Product.Add({
27
+ name: "Imported Product",
28
+ description: "Imported from " ++ key,
29
+ price: 9.99,
30
+ })->Message.encode(Product.commandSchema),
31
+ },
32
+ ],
33
+ ),
34
+ ]->Promise.resolve
35
+ } else {
36
+ []->Promise.resolve
37
+ }
38
+ }
39
+
40
+ let setup = (_queryEngine, _queryBucketName, _opts) => {
41
+ Task.buckets: [
42
+ {
43
+ bucketName: "product-imports",
44
+ bucketMode: Task.Read,
45
+ callback: importCallback,
46
+ },
47
+ ],
48
+ }
@@ -0,0 +1,58 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
4
+ import * as Product$CatalogPlugin from "../Product/Aggregate/Product.res.mjs";
5
+
6
+ function importCallback(eventName, key) {
7
+ if (!eventName.includes("ObjectCreated")) {
8
+ return Promise.resolve([]);
9
+ }
10
+ console.log("[ImportProducts] Processing file: " + key);
11
+ let meta_time = Date.now().toString();
12
+ let meta_ip = "";
13
+ let meta_user = "system";
14
+ let meta = {
15
+ service: "ImportProducts",
16
+ time: meta_time,
17
+ ip: meta_ip,
18
+ user: meta_user,
19
+ msgId: key,
20
+ correlationId: key
21
+ };
22
+ return Promise.resolve([{
23
+ TAG: "PublishCommands",
24
+ _0: "Product",
25
+ _1: [{
26
+ id: key,
27
+ meta: meta,
28
+ commandJson: Message$Reventless.encode({
29
+ TAG: "Add",
30
+ name: "Imported Product",
31
+ description: "Imported from " + key,
32
+ price: 9.99
33
+ }, Product$CatalogPlugin.commandSchema)
34
+ }]
35
+ }]);
36
+ }
37
+
38
+ function setup(_queryEngine, _queryBucketName, _opts) {
39
+ return {
40
+ buckets: [{
41
+ bucketName: "product-imports",
42
+ bucketMode: "Read",
43
+ callback: importCallback
44
+ }]
45
+ };
46
+ }
47
+
48
+ let name = "ImportProducts";
49
+
50
+ let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Task/ImportProducts.res.mjs";
51
+
52
+ export {
53
+ name,
54
+ importCallback,
55
+ setup,
56
+ moduleUrl,
57
+ }
58
+ /* Message-Reventless Not a pure module */
@@ -0,0 +1,51 @@
1
+ @@reventless.gwt
2
+
3
+ describe("Category Behavior", () => {
4
+ test("Add on new aggregate produces Added", () =>
5
+ givenEvents([])
6
+ ->whenCmd(Add({name: "Electronics"}))
7
+ ->thenEvent(Added({name: "Electronics"}))
8
+ )
9
+
10
+ test("Add on existing aggregate returns CategoryAlreadyExists", () =>
11
+ givenEvents([Added({name: "Electronics"})])
12
+ ->whenCmd(Add({name: "Electronics 2"}))
13
+ ->thenError(CategoryAlreadyExists)
14
+ )
15
+
16
+ test("Rename on non-existent aggregate returns CategoryNotFound", () =>
17
+ givenEvents([])
18
+ ->whenCmd(Rename({name: "New Name"}))
19
+ ->thenError(CategoryNotFound)
20
+ )
21
+
22
+ test("Rename on active category produces Renamed", () =>
23
+ givenEvents([Added({name: "Electronics"})])
24
+ ->whenCmd(Rename({name: "Consumer Electronics"}))
25
+ ->thenEvent(Renamed({name: "Consumer Electronics"}))
26
+ )
27
+
28
+ test("Rename to same name produces no events (idempotent)", () =>
29
+ givenEvents([Added({name: "Electronics"})])
30
+ ->whenCmd(Rename({name: "Electronics"}))
31
+ ->thenNoEvent
32
+ )
33
+
34
+ test("Rename on archived category returns CategoryAlreadyArchived", () =>
35
+ givenEvents([Added({name: "Electronics"}), Archived])
36
+ ->whenCmd(Rename({name: "New Name"}))
37
+ ->thenError(CategoryAlreadyArchived)
38
+ )
39
+
40
+ test("Archive on active category produces Archived", () =>
41
+ givenEvents([Added({name: "Electronics"})])
42
+ ->whenCmd(Archive)
43
+ ->thenEvent(Archived)
44
+ )
45
+
46
+ test("Archive on archived category produces no events (idempotent)", () =>
47
+ givenEvents([Added({name: "Electronics"}), Archived])
48
+ ->whenCmd(Archive)
49
+ ->thenNoEvent
50
+ )
51
+ })
@@ -0,0 +1,125 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Category$CatalogPlugin from "../../../src/Category/Aggregate/Category.res.mjs";
4
+ import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
5
+ import * as Category_Behavior$CatalogPlugin from "../../../src/Category/Aggregate/Category_Behavior.res.mjs";
6
+
7
+ let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
8
+ name: Category$CatalogPlugin.name,
9
+ commandSchema: Category$CatalogPlugin.commandSchema,
10
+ eventSchema: Category$CatalogPlugin.eventSchema,
11
+ errorSchema: Category$CatalogPlugin.errorSchema
12
+ })({
13
+ Spec: {
14
+ name: Category$CatalogPlugin.name,
15
+ commandSchema: Category$CatalogPlugin.commandSchema,
16
+ eventSchema: Category$CatalogPlugin.eventSchema,
17
+ errorSchema: Category$CatalogPlugin.errorSchema
18
+ },
19
+ initialState: Category_Behavior$CatalogPlugin.initialState,
20
+ evolve: Category_Behavior$CatalogPlugin.evolve,
21
+ decide: Category_Behavior$CatalogPlugin.decide,
22
+ moduleUrl: Category_Behavior$CatalogPlugin.moduleUrl
23
+ });
24
+
25
+ let describe = include.describe;
26
+
27
+ let test = include.test;
28
+
29
+ let givenEvents = include.givenEvents;
30
+
31
+ let whenCmd = include.whenCmd;
32
+
33
+ let thenEvent = include.thenEvent;
34
+
35
+ let thenNoEvent = include.thenNoEvent;
36
+
37
+ let thenError = include.thenError;
38
+
39
+ describe("Category Behavior", () => {
40
+ test("Add on new aggregate produces Added", () => thenEvent(whenCmd(givenEvents([]), {
41
+ TAG: "Add",
42
+ name: "Electronics"
43
+ }), {
44
+ TAG: "Added",
45
+ name: "Electronics"
46
+ }));
47
+ test("Add on existing aggregate returns CategoryAlreadyExists", () => thenError(whenCmd(givenEvents([{
48
+ TAG: "Added",
49
+ name: "Electronics"
50
+ }]), {
51
+ TAG: "Add",
52
+ name: "Electronics 2"
53
+ }), "CategoryAlreadyExists"));
54
+ test("Rename on non-existent aggregate returns CategoryNotFound", () => thenError(whenCmd(givenEvents([]), {
55
+ TAG: "Rename",
56
+ name: "New Name"
57
+ }), "CategoryNotFound"));
58
+ test("Rename on active category produces Renamed", () => thenEvent(whenCmd(givenEvents([{
59
+ TAG: "Added",
60
+ name: "Electronics"
61
+ }]), {
62
+ TAG: "Rename",
63
+ name: "Consumer Electronics"
64
+ }), {
65
+ TAG: "Renamed",
66
+ name: "Consumer Electronics"
67
+ }));
68
+ test("Rename to same name produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
69
+ TAG: "Added",
70
+ name: "Electronics"
71
+ }]), {
72
+ TAG: "Rename",
73
+ name: "Electronics"
74
+ })));
75
+ test("Rename on archived category returns CategoryAlreadyArchived", () => thenError(whenCmd(givenEvents([
76
+ {
77
+ TAG: "Added",
78
+ name: "Electronics"
79
+ },
80
+ "Archived"
81
+ ]), {
82
+ TAG: "Rename",
83
+ name: "New Name"
84
+ }), "CategoryAlreadyArchived"));
85
+ test("Archive on active category produces Archived", () => thenEvent(whenCmd(givenEvents([{
86
+ TAG: "Added",
87
+ name: "Electronics"
88
+ }]), "Archive"), "Archived"));
89
+ test("Archive on archived category produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
90
+ {
91
+ TAG: "Added",
92
+ name: "Electronics"
93
+ },
94
+ "Archived"
95
+ ]), "Archive")));
96
+ });
97
+
98
+ let Spec = include.Spec;
99
+
100
+ let thenCompareEvent = include.thenCompareEvent;
101
+
102
+ let thenEventWithError = include.thenEventWithError;
103
+
104
+ let thenEvents = include.thenEvents;
105
+
106
+ let thenCompareEvents = include.thenCompareEvents;
107
+
108
+ let thenEventsWithError = include.thenEventsWithError;
109
+
110
+ export {
111
+ Spec,
112
+ describe,
113
+ test,
114
+ givenEvents,
115
+ whenCmd,
116
+ thenEvent,
117
+ thenCompareEvent,
118
+ thenNoEvent,
119
+ thenEventWithError,
120
+ thenEvents,
121
+ thenCompareEvents,
122
+ thenEventsWithError,
123
+ thenError,
124
+ }
125
+ /* include Not a pure module */
@@ -0,0 +1,21 @@
1
+ @@reventless.gwt(Categories_Projections.CategoryMapping)
2
+
3
+ describe("Categories ReadModel ← Category", () => {
4
+ test("Added sets initial read model state", () =>
5
+ givenEvents([])
6
+ ->whenEvent(Category.Added({name: "Electronics"}))
7
+ ->thenState({Categories.name: "Electronics", archived: false})
8
+ )
9
+
10
+ test("Renamed updates the name", () =>
11
+ givenEvents([Category.Added({name: "Electronics"})])
12
+ ->whenEvent(Category.Renamed({name: "Consumer Electronics"}))
13
+ ->thenState({Categories.name: "Consumer Electronics", archived: false})
14
+ )
15
+
16
+ test("Archived sets archived flag", () =>
17
+ givenEvents([Category.Added({name: "Electronics"})])
18
+ ->whenEvent(Category.Archived)
19
+ ->thenState({Categories.name: "Electronics", archived: true})
20
+ )
21
+ })
@@ -0,0 +1,88 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Categories_Projections$CatalogPlugin from "../../../src/Category/ReadModel/Categories_Projections.res.mjs";
4
+ import * as MultiSourceProjection_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/MultiSourceProjection_GWT.res.mjs";
5
+
6
+ let include = MultiSourceProjection_GWT$ReventlessGwt.Make(Categories_Projections$CatalogPlugin.CategoryMapping);
7
+
8
+ let describe = include.describe;
9
+
10
+ let test = include.test;
11
+
12
+ let givenEvents = include.givenEvents;
13
+
14
+ let whenEvent = include.whenEvent;
15
+
16
+ let thenState = include.thenState;
17
+
18
+ describe("Categories ReadModel ← Category", () => {
19
+ test("Added sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
20
+ TAG: "Added",
21
+ name: "Electronics"
22
+ }), {
23
+ name: "Electronics",
24
+ archived: false
25
+ }));
26
+ test("Renamed updates the name", undefined, () => thenState(whenEvent(givenEvents([{
27
+ TAG: "Added",
28
+ name: "Electronics"
29
+ }]), {
30
+ TAG: "Renamed",
31
+ name: "Consumer Electronics"
32
+ }), {
33
+ name: "Consumer Electronics",
34
+ archived: false
35
+ }));
36
+ test("Archived sets archived flag", undefined, () => thenState(whenEvent(givenEvents([{
37
+ TAG: "Added",
38
+ name: "Electronics"
39
+ }]), "Archived"), {
40
+ name: "Electronics",
41
+ archived: true
42
+ }));
43
+ });
44
+
45
+ let describeWithId = include.describeWithId;
46
+
47
+ let givenEventsWithTime = include.givenEventsWithTime;
48
+
49
+ let whenEvents = include.whenEvents;
50
+
51
+ let whenEventWithTime = include.whenEventWithTime;
52
+
53
+ let whenEventsWithTime = include.whenEventsWithTime;
54
+
55
+ let thenStates = include.thenStates;
56
+
57
+ let thenStatesWithId = include.thenStatesWithId;
58
+
59
+ let thenAllStates = include.thenAllStates;
60
+
61
+ let thenStateWithId = include.thenStateWithId;
62
+
63
+ let thenNoState = include.thenNoState;
64
+
65
+ let thenThrow = include.thenThrow;
66
+
67
+ let thenFail = include.thenFail;
68
+
69
+ export {
70
+ describe,
71
+ describeWithId,
72
+ test,
73
+ givenEvents,
74
+ givenEventsWithTime,
75
+ whenEvent,
76
+ whenEvents,
77
+ whenEventWithTime,
78
+ whenEventsWithTime,
79
+ thenStates,
80
+ thenStatesWithId,
81
+ thenAllStates,
82
+ thenState,
83
+ thenStateWithId,
84
+ thenNoState,
85
+ thenThrow,
86
+ thenFail,
87
+ }
88
+ /* include Not a pure module */
@@ -0,0 +1,21 @@
1
+ // Boundary GWT for Catalog's Orders extension: public Ordering events become
2
+ // ProductDemand commands on Catalog's aggregate.
3
+ @@reventless.gwt
4
+
5
+ // `Mapping` is brought into scope by the PPX `open Orders_Extension`; opening
6
+ // it surfaces the extension point's events and the delegate's commands.
7
+ open Mapping
8
+
9
+ describe("Orders Extension delegate", () => {
10
+ test("ItemOrdered records demand for the product", () =>
11
+ whenIncomingEvent(
12
+ ExtensionPoint.ItemOrdered({productId: "p1", orderId: "o1", customerId: "c1"}),
13
+ )->thenPublishesAggregateCommand("p1", Delegate.Record({orderId: "o1"}))
14
+ )
15
+
16
+ test("ItemOrderCancelled revokes demand for the product", () =>
17
+ whenIncomingEvent(
18
+ ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "o1"}),
19
+ )->thenPublishesAggregateCommand("p1", Delegate.Revoke({orderId: "o1"}))
20
+ )
21
+ })
@@ -0,0 +1,105 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
4
+ import * as Delegate_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Delegate_GWT.res.mjs";
5
+ import * as ProductDemand$CatalogPlugin from "../../src/ProductDemand/Aggregate/ProductDemand.res.mjs";
6
+ import * as Orders_Extension$CatalogPlugin from "../../src/Extension/Orders_Extension.res.mjs";
7
+ import * as Orders_ExtensionPoint$OrderingSpec from "@reventlessdev/online-shop-aggregates-ordering-spec/src/Orders_ExtensionPoint.res.mjs";
8
+
9
+ let include = Delegate_GWT$ReventlessGwt.FromExtension({
10
+ ExtensionPoint: {
11
+ name: Orders_ExtensionPoint$OrderingSpec.name,
12
+ moduleUrl: Orders_ExtensionPoint$OrderingSpec.moduleUrl,
13
+ commandSchema: Orders_ExtensionPoint$OrderingSpec.commandSchema,
14
+ eventSchema: Orders_ExtensionPoint$OrderingSpec.eventSchema,
15
+ directiveSchema: Orders_ExtensionPoint$OrderingSpec.directiveSchema
16
+ },
17
+ Delegate: {
18
+ Id: Id$Reventless.$$String,
19
+ name: ProductDemand$CatalogPlugin.name,
20
+ eventSchema: ProductDemand$CatalogPlugin.eventSchema,
21
+ errorSchema: ProductDemand$CatalogPlugin.errorSchema,
22
+ commandSchema: ProductDemand$CatalogPlugin.commandSchema,
23
+ moduleUrl: ProductDemand$CatalogPlugin.moduleUrl,
24
+ commandAuthorization: ProductDemand$CatalogPlugin.commandAuthorization
25
+ },
26
+ moduleUrl: Orders_Extension$CatalogPlugin.Mapping.moduleUrl,
27
+ delegateModuleUrl: Orders_Extension$CatalogPlugin.Mapping.delegateModuleUrl,
28
+ mapIncomingEvent: Orders_Extension$CatalogPlugin.Mapping.mapIncomingEvent,
29
+ mapOutgoingEvent: Orders_Extension$CatalogPlugin.Mapping.mapOutgoingEvent
30
+ });
31
+
32
+ let describe = include.describe;
33
+
34
+ let test = include.test;
35
+
36
+ let whenIncomingEvent = include.whenIncomingEvent;
37
+
38
+ let thenPublishesAggregateCommand = include.thenPublishesAggregateCommand;
39
+
40
+ describe("Orders Extension delegate", () => {
41
+ test("ItemOrdered records demand for the product", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
42
+ TAG: "ItemOrdered",
43
+ productId: "p1",
44
+ orderId: "o1",
45
+ customerId: "c1"
46
+ }), "p1", {
47
+ TAG: "Record",
48
+ orderId: "o1"
49
+ }));
50
+ test("ItemOrderCancelled revokes demand for the product", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
51
+ TAG: "ItemOrderCancelled",
52
+ productId: "p1",
53
+ orderId: "o1"
54
+ }), "p1", {
55
+ TAG: "Revoke",
56
+ orderId: "o1"
57
+ }));
58
+ });
59
+
60
+ let encCmd = include.encCmd;
61
+
62
+ let encEpCmd = include.encEpCmd;
63
+
64
+ let encDirective = include.encDirective;
65
+
66
+ let EvCore = include.EvCore;
67
+
68
+ let OutCore = include.OutCore;
69
+
70
+ let thenPublishesNothing = include.thenPublishesNothing;
71
+
72
+ let thenPublishesCommand = include.thenPublishesCommand;
73
+
74
+ let thenPublishesCommands = include.thenPublishesCommands;
75
+
76
+ let whenDelegateEvent = include.whenDelegateEvent;
77
+
78
+ let thenPublishesExtensionPointCommand = include.thenPublishesExtensionPointCommand;
79
+
80
+ let thenHandlesDirective = include.thenHandlesDirective;
81
+
82
+ let thenHandlesDirectives = include.thenHandlesDirectives;
83
+
84
+ let thenHandlesNoDirective = include.thenHandlesNoDirective;
85
+
86
+ export {
87
+ encCmd,
88
+ encEpCmd,
89
+ encDirective,
90
+ EvCore,
91
+ OutCore,
92
+ describe,
93
+ test,
94
+ thenPublishesNothing,
95
+ whenIncomingEvent,
96
+ thenPublishesCommand,
97
+ thenPublishesCommands,
98
+ thenPublishesAggregateCommand,
99
+ whenDelegateEvent,
100
+ thenPublishesExtensionPointCommand,
101
+ thenHandlesDirective,
102
+ thenHandlesDirectives,
103
+ thenHandlesNoDirective,
104
+ }
105
+ /* include Not a pure module */