@reventlessdev/online-shop-aggregates-ordering 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 (408) hide show
  1. package/CHANGELOG.md +846 -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/OrderingPlugin.cmi +0 -0
  6. package/lib/bs/OrderingPlugin.cmj +0 -0
  7. package/lib/bs/OrderingPlugin.cmt +0 -0
  8. package/lib/bs/OrderingPlugin.mlmap +31 -0
  9. package/lib/bs/build.ninja +0 -0
  10. package/lib/bs/compiler-info.json +8 -0
  11. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmi +0 -0
  12. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmj +0 -0
  13. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmt +0 -0
  14. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.ast +0 -0
  15. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.res +18 -0
  16. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.res.mjs +50 -0
  17. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  18. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmj +0 -0
  19. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  20. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.ast +0 -0
  21. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res +27 -0
  22. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res.mjs +87 -0
  23. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmi +0 -0
  24. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmj +0 -0
  25. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmt +0 -0
  26. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.ast +0 -0
  27. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.res +13 -0
  28. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.res.mjs +53 -0
  29. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  30. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmj +0 -0
  31. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  32. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.ast +0 -0
  33. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res +20 -0
  34. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +65 -0
  35. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmi +0 -0
  36. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmj +0 -0
  37. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmt +0 -0
  38. package/lib/bs/src/Customer/Aggregate/Customer.ast +0 -0
  39. package/lib/bs/src/Customer/Aggregate/Customer.res +24 -0
  40. package/lib/bs/src/Customer/Aggregate/Customer.res.mjs +64 -0
  41. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmi +0 -0
  42. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmj +0 -0
  43. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmt +0 -0
  44. package/lib/bs/src/Customer/Aggregate/Customer_Behavior.ast +0 -0
  45. package/lib/bs/src/Customer/Aggregate/Customer_Behavior.res +41 -0
  46. package/lib/bs/src/Customer/Aggregate/Customer_Behavior.res.mjs +143 -0
  47. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmi +0 -0
  48. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmj +0 -0
  49. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmt +0 -0
  50. package/lib/bs/src/Customer/ReadModel/Customers.ast +0 -0
  51. package/lib/bs/src/Customer/ReadModel/Customers.res +12 -0
  52. package/lib/bs/src/Customer/ReadModel/Customers.res.mjs +36 -0
  53. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmi +0 -0
  54. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmj +0 -0
  55. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmt +0 -0
  56. package/lib/bs/src/Customer/ReadModel/Customers_Projections.ast +0 -0
  57. package/lib/bs/src/Customer/ReadModel/Customers_Projections.res +21 -0
  58. package/lib/bs/src/Customer/ReadModel/Customers_Projections.res.mjs +91 -0
  59. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
  60. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmj +0 -0
  61. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
  62. package/lib/bs/src/Extension/Products_Extension.ast +0 -0
  63. package/lib/bs/src/Extension/Products_Extension.res +23 -0
  64. package/lib/bs/src/Extension/Products_Extension.res.mjs +43 -0
  65. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  66. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
  67. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  68. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.ast +0 -0
  69. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res +28 -0
  70. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +59 -0
  71. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmi +0 -0
  72. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmj +0 -0
  73. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmt +0 -0
  74. package/lib/bs/src/Order/Aggregate/Order.ast +0 -0
  75. package/lib/bs/src/Order/Aggregate/Order.res +27 -0
  76. package/lib/bs/src/Order/Aggregate/Order.res.mjs +81 -0
  77. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmi +0 -0
  78. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmj +0 -0
  79. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmt +0 -0
  80. package/lib/bs/src/Order/Aggregate/Order_Behavior.ast +0 -0
  81. package/lib/bs/src/Order/Aggregate/Order_Behavior.res +52 -0
  82. package/lib/bs/src/Order/Aggregate/Order_Behavior.res.mjs +193 -0
  83. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmi +0 -0
  84. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmj +0 -0
  85. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -0
  86. package/lib/bs/src/Order/Aggregate/Order_Mappings.ast +0 -0
  87. package/lib/bs/src/Order/Aggregate/Order_Mappings.res +15 -0
  88. package/lib/bs/src/Order/Aggregate/Order_Mappings.res.mjs +55 -0
  89. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmi +0 -0
  90. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmj +0 -0
  91. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmt +0 -0
  92. package/lib/bs/src/Order/ReadModel/Orders.ast +0 -0
  93. package/lib/bs/src/Order/ReadModel/Orders.res +19 -0
  94. package/lib/bs/src/Order/ReadModel/Orders.res.mjs +62 -0
  95. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmi +0 -0
  96. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmj +0 -0
  97. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
  98. package/lib/bs/src/Order/ReadModel/Orders_Projections.ast +0 -0
  99. package/lib/bs/src/Order/ReadModel/Orders_Projections.res +31 -0
  100. package/lib/bs/src/Order/ReadModel/Orders_Projections.res.mjs +89 -0
  101. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  102. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmj +0 -0
  103. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  104. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.ast +0 -0
  105. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res +18 -0
  106. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res.mjs +34 -0
  107. package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
  108. package/lib/bs/src/Plugin-OrderingPlugin.cmj +0 -0
  109. package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
  110. package/lib/bs/src/Plugin.ast +0 -0
  111. package/lib/bs/src/Plugin.res +65 -0
  112. package/lib/bs/src/Plugin.res.mjs +223 -0
  113. package/lib/bs/src/Service/EmailService-OrderingPlugin.cmi +0 -0
  114. package/lib/bs/src/Service/EmailService-OrderingPlugin.cmj +0 -0
  115. package/lib/bs/src/Service/EmailService-OrderingPlugin.cmt +0 -0
  116. package/lib/bs/src/Service/EmailService.ast +0 -0
  117. package/lib/bs/src/Service/EmailService.res +22 -0
  118. package/lib/bs/src/Service/EmailService.res.mjs +23 -0
  119. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
  120. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmj +0 -0
  121. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
  122. package/lib/bs/src/Task/OrderNotifications.ast +0 -0
  123. package/lib/bs/src/Task/OrderNotifications.res +8 -0
  124. package/lib/bs/src/Task/OrderNotifications.res.mjs +29 -0
  125. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  126. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmj +0 -0
  127. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  128. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.ast +0 -0
  129. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res +27 -0
  130. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res.mjs +102 -0
  131. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  132. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmj +0 -0
  133. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  134. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.ast +0 -0
  135. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res +15 -0
  136. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res.mjs +83 -0
  137. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmi +0 -0
  138. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmj +0 -0
  139. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmt +0 -0
  140. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.ast +0 -0
  141. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res +90 -0
  142. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res.mjs +170 -0
  143. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmi +0 -0
  144. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmj +0 -0
  145. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmt +0 -0
  146. package/lib/bs/tests/Customer/ReadModel/Customers_GWT.ast +0 -0
  147. package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res +27 -0
  148. package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res.mjs +106 -0
  149. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  150. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmj +0 -0
  151. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  152. package/lib/bs/tests/Extension/Products_Extension_GWT.ast +0 -0
  153. package/lib/bs/tests/Extension/Products_Extension_GWT.res +21 -0
  154. package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +106 -0
  155. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  156. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmj +0 -0
  157. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  158. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.ast +0 -0
  159. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +33 -0
  160. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +143 -0
  161. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  162. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
  163. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  164. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.ast +0 -0
  165. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res +52 -0
  166. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +162 -0
  167. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmi +0 -0
  168. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmj +0 -0
  169. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmt +0 -0
  170. package/lib/bs/tests/Order/Aggregate/Order_GWT.ast +0 -0
  171. package/lib/bs/tests/Order/Aggregate/Order_GWT.res +121 -0
  172. package/lib/bs/tests/Order/Aggregate/Order_GWT.res.mjs +231 -0
  173. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmi +0 -0
  174. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmj +0 -0
  175. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmt +0 -0
  176. package/lib/bs/tests/Order/ReadModel/Orders_GWT.ast +0 -0
  177. package/lib/bs/tests/Order/ReadModel/Orders_GWT.res +46 -0
  178. package/lib/bs/tests/Order/ReadModel/Orders_GWT.res.mjs +118 -0
  179. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmi +0 -0
  180. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmj +0 -0
  181. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmt +0 -0
  182. package/lib/bs/tests/Order/SideEffect/EmailService_Mock.ast +0 -0
  183. package/lib/bs/tests/Order/SideEffect/EmailService_Mock.res +31 -0
  184. package/lib/bs/tests/Order/SideEffect/EmailService_Mock.res.mjs +56 -0
  185. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  186. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmj +0 -0
  187. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  188. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.ast +0 -0
  189. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res +37 -0
  190. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +76 -0
  191. package/lib/ocaml/.compiler.log +2 -0
  192. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
  193. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmj +0 -0
  194. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
  195. package/lib/ocaml/AvailableProducts.ast +0 -0
  196. package/lib/ocaml/AvailableProducts.res +13 -0
  197. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  198. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmj +0 -0
  199. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  200. package/lib/ocaml/AvailableProducts_GWT.ast +0 -0
  201. package/lib/ocaml/AvailableProducts_GWT.res +15 -0
  202. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  203. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmj +0 -0
  204. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  205. package/lib/ocaml/AvailableProducts_Projections.ast +0 -0
  206. package/lib/ocaml/AvailableProducts_Projections.res +20 -0
  207. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmi +0 -0
  208. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmj +0 -0
  209. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmt +0 -0
  210. package/lib/ocaml/CatalogProduct.ast +0 -0
  211. package/lib/ocaml/CatalogProduct.res +18 -0
  212. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  213. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmj +0 -0
  214. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  215. package/lib/ocaml/CatalogProduct_Behavior.ast +0 -0
  216. package/lib/ocaml/CatalogProduct_Behavior.res +27 -0
  217. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  218. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmj +0 -0
  219. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  220. package/lib/ocaml/CatalogProduct_GWT.ast +0 -0
  221. package/lib/ocaml/CatalogProduct_GWT.res +27 -0
  222. package/lib/ocaml/Customer-OrderingPlugin.cmi +0 -0
  223. package/lib/ocaml/Customer-OrderingPlugin.cmj +0 -0
  224. package/lib/ocaml/Customer-OrderingPlugin.cmt +0 -0
  225. package/lib/ocaml/Customer.ast +0 -0
  226. package/lib/ocaml/Customer.res +24 -0
  227. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmi +0 -0
  228. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmj +0 -0
  229. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmt +0 -0
  230. package/lib/ocaml/Customer_Behavior.ast +0 -0
  231. package/lib/ocaml/Customer_Behavior.res +41 -0
  232. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmi +0 -0
  233. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmj +0 -0
  234. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmt +0 -0
  235. package/lib/ocaml/Customer_GWT.ast +0 -0
  236. package/lib/ocaml/Customer_GWT.res +90 -0
  237. package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
  238. package/lib/ocaml/Customers-OrderingPlugin.cmj +0 -0
  239. package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
  240. package/lib/ocaml/Customers.ast +0 -0
  241. package/lib/ocaml/Customers.res +12 -0
  242. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
  243. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmj +0 -0
  244. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
  245. package/lib/ocaml/Customers_GWT.ast +0 -0
  246. package/lib/ocaml/Customers_GWT.res +27 -0
  247. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
  248. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmj +0 -0
  249. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
  250. package/lib/ocaml/Customers_Projections.ast +0 -0
  251. package/lib/ocaml/Customers_Projections.res +21 -0
  252. package/lib/ocaml/EmailService-OrderingPlugin.cmi +0 -0
  253. package/lib/ocaml/EmailService-OrderingPlugin.cmj +0 -0
  254. package/lib/ocaml/EmailService-OrderingPlugin.cmt +0 -0
  255. package/lib/ocaml/EmailService.ast +0 -0
  256. package/lib/ocaml/EmailService.res +22 -0
  257. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
  258. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmj +0 -0
  259. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
  260. package/lib/ocaml/EmailService_Mock.ast +0 -0
  261. package/lib/ocaml/EmailService_Mock.res +31 -0
  262. package/lib/ocaml/Order-OrderingPlugin.cmi +0 -0
  263. package/lib/ocaml/Order-OrderingPlugin.cmj +0 -0
  264. package/lib/ocaml/Order-OrderingPlugin.cmt +0 -0
  265. package/lib/ocaml/Order.ast +0 -0
  266. package/lib/ocaml/Order.res +27 -0
  267. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  268. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
  269. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  270. package/lib/ocaml/OrderMappings_GWT.ast +0 -0
  271. package/lib/ocaml/OrderMappings_GWT.res +52 -0
  272. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmi +0 -0
  273. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmj +0 -0
  274. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmt +0 -0
  275. package/lib/ocaml/OrderNotifications.ast +0 -0
  276. package/lib/ocaml/OrderNotifications.res +8 -0
  277. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmi +0 -0
  278. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmj +0 -0
  279. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmt +0 -0
  280. package/lib/ocaml/Order_Behavior.ast +0 -0
  281. package/lib/ocaml/Order_Behavior.res +52 -0
  282. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  283. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmj +0 -0
  284. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  285. package/lib/ocaml/Order_EmailNotification.ast +0 -0
  286. package/lib/ocaml/Order_EmailNotification.res +18 -0
  287. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  288. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmj +0 -0
  289. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  290. package/lib/ocaml/Order_EmailNotification_GWT.ast +0 -0
  291. package/lib/ocaml/Order_EmailNotification_GWT.res +37 -0
  292. package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +0 -0
  293. package/lib/ocaml/Order_GWT-OrderingPlugin.cmj +0 -0
  294. package/lib/ocaml/Order_GWT-OrderingPlugin.cmt +0 -0
  295. package/lib/ocaml/Order_GWT.ast +0 -0
  296. package/lib/ocaml/Order_GWT.res +121 -0
  297. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmi +0 -0
  298. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmj +0 -0
  299. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmt +0 -0
  300. package/lib/ocaml/Order_Mappings.ast +0 -0
  301. package/lib/ocaml/Order_Mappings.res +15 -0
  302. package/lib/ocaml/OrderingPlugin.cmi +0 -0
  303. package/lib/ocaml/OrderingPlugin.cmj +0 -0
  304. package/lib/ocaml/OrderingPlugin.cmt +0 -0
  305. package/lib/ocaml/OrderingPlugin.mlmap +31 -0
  306. package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
  307. package/lib/ocaml/Orders-OrderingPlugin.cmj +0 -0
  308. package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
  309. package/lib/ocaml/Orders.ast +0 -0
  310. package/lib/ocaml/Orders.res +19 -0
  311. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  312. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
  313. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  314. package/lib/ocaml/Orders_ExtensionPointMapping.ast +0 -0
  315. package/lib/ocaml/Orders_ExtensionPointMapping.res +28 -0
  316. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  317. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmj +0 -0
  318. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  319. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.ast +0 -0
  320. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.res +33 -0
  321. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
  322. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmj +0 -0
  323. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
  324. package/lib/ocaml/Orders_GWT.ast +0 -0
  325. package/lib/ocaml/Orders_GWT.res +46 -0
  326. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmi +0 -0
  327. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmj +0 -0
  328. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmt +0 -0
  329. package/lib/ocaml/Orders_Projections.ast +0 -0
  330. package/lib/ocaml/Orders_Projections.res +31 -0
  331. package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
  332. package/lib/ocaml/Plugin-OrderingPlugin.cmj +0 -0
  333. package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
  334. package/lib/ocaml/Plugin.ast +0 -0
  335. package/lib/ocaml/Plugin.res +65 -0
  336. package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
  337. package/lib/ocaml/Products_Extension-OrderingPlugin.cmj +0 -0
  338. package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
  339. package/lib/ocaml/Products_Extension.ast +0 -0
  340. package/lib/ocaml/Products_Extension.res +23 -0
  341. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  342. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmj +0 -0
  343. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  344. package/lib/ocaml/Products_Extension_GWT.ast +0 -0
  345. package/lib/ocaml/Products_Extension_GWT.res +21 -0
  346. package/package.json +52 -0
  347. package/rescript.json +39 -0
  348. package/src/CatalogProduct/Aggregate/CatalogProduct.res +18 -0
  349. package/src/CatalogProduct/Aggregate/CatalogProduct.res.mjs +50 -0
  350. package/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res +27 -0
  351. package/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res.mjs +87 -0
  352. package/src/CatalogProduct/ReadModel/AvailableProducts.res +13 -0
  353. package/src/CatalogProduct/ReadModel/AvailableProducts.res.mjs +53 -0
  354. package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res +20 -0
  355. package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +65 -0
  356. package/src/Customer/Aggregate/Customer.res +24 -0
  357. package/src/Customer/Aggregate/Customer.res.mjs +64 -0
  358. package/src/Customer/Aggregate/Customer_Behavior.res +41 -0
  359. package/src/Customer/Aggregate/Customer_Behavior.res.mjs +143 -0
  360. package/src/Customer/ReadModel/Customers.res +12 -0
  361. package/src/Customer/ReadModel/Customers.res.mjs +36 -0
  362. package/src/Customer/ReadModel/Customers_Projections.res +21 -0
  363. package/src/Customer/ReadModel/Customers_Projections.res.mjs +91 -0
  364. package/src/Extension/Products_Extension.res +23 -0
  365. package/src/Extension/Products_Extension.res.mjs +43 -0
  366. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +28 -0
  367. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +59 -0
  368. package/src/Order/Aggregate/Order.res +27 -0
  369. package/src/Order/Aggregate/Order.res.mjs +81 -0
  370. package/src/Order/Aggregate/Order_Behavior.res +52 -0
  371. package/src/Order/Aggregate/Order_Behavior.res.mjs +193 -0
  372. package/src/Order/Aggregate/Order_Mappings.res +15 -0
  373. package/src/Order/Aggregate/Order_Mappings.res.mjs +55 -0
  374. package/src/Order/ReadModel/Orders.res +19 -0
  375. package/src/Order/ReadModel/Orders.res.mjs +62 -0
  376. package/src/Order/ReadModel/Orders_Projections.res +31 -0
  377. package/src/Order/ReadModel/Orders_Projections.res.mjs +89 -0
  378. package/src/Order/SideEffect/Order_EmailNotification.res +18 -0
  379. package/src/Order/SideEffect/Order_EmailNotification.res.mjs +34 -0
  380. package/src/Plugin.res +65 -0
  381. package/src/Plugin.res.mjs +223 -0
  382. package/src/Service/EmailService.res +22 -0
  383. package/src/Service/EmailService.res.mjs +23 -0
  384. package/src/Task/OrderNotifications.res +8 -0
  385. package/src/Task/OrderNotifications.res.mjs +29 -0
  386. package/src/plugin.json +1 -0
  387. package/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res +27 -0
  388. package/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res.mjs +102 -0
  389. package/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res +15 -0
  390. package/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res.mjs +83 -0
  391. package/tests/Customer/Aggregate/Customer_GWT.res +90 -0
  392. package/tests/Customer/Aggregate/Customer_GWT.res.mjs +170 -0
  393. package/tests/Customer/ReadModel/Customers_GWT.res +27 -0
  394. package/tests/Customer/ReadModel/Customers_GWT.res.mjs +106 -0
  395. package/tests/Extension/Products_Extension_GWT.res +21 -0
  396. package/tests/Extension/Products_Extension_GWT.res.mjs +106 -0
  397. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +33 -0
  398. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +143 -0
  399. package/tests/Order/Aggregate/OrderMappings_GWT.res +52 -0
  400. package/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +162 -0
  401. package/tests/Order/Aggregate/Order_GWT.res +121 -0
  402. package/tests/Order/Aggregate/Order_GWT.res.mjs +231 -0
  403. package/tests/Order/ReadModel/Orders_GWT.res +46 -0
  404. package/tests/Order/ReadModel/Orders_GWT.res.mjs +118 -0
  405. package/tests/Order/SideEffect/EmailService_Mock.res +31 -0
  406. package/tests/Order/SideEffect/EmailService_Mock.res.mjs +56 -0
  407. package/tests/Order/SideEffect/Order_EmailNotification_GWT.res +37 -0
  408. package/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +76 -0
@@ -0,0 +1,231 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Order$OrderingPlugin from "../../../src/Order/Aggregate/Order.res.mjs";
4
+ import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
5
+ import * as Order_Behavior$OrderingPlugin from "../../../src/Order/Aggregate/Order_Behavior.res.mjs";
6
+
7
+ let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
8
+ name: Order$OrderingPlugin.name,
9
+ commandSchema: Order$OrderingPlugin.commandSchema,
10
+ eventSchema: Order$OrderingPlugin.eventSchema,
11
+ errorSchema: Order$OrderingPlugin.errorSchema
12
+ })({
13
+ Spec: {
14
+ name: Order$OrderingPlugin.name,
15
+ commandSchema: Order$OrderingPlugin.commandSchema,
16
+ eventSchema: Order$OrderingPlugin.eventSchema,
17
+ errorSchema: Order$OrderingPlugin.errorSchema
18
+ },
19
+ initialState: Order_Behavior$OrderingPlugin.initialState,
20
+ evolve: Order_Behavior$OrderingPlugin.evolve,
21
+ decide: Order_Behavior$OrderingPlugin.decide,
22
+ moduleUrl: Order_Behavior$OrderingPlugin.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("Order Behavior", () => {
40
+ test("Place on new aggregate produces Placed", () => thenEvent(whenCmd(givenEvents([]), {
41
+ TAG: "Place",
42
+ customerId: "cust-1",
43
+ productIds: [
44
+ "prod-1",
45
+ "prod-2"
46
+ ]
47
+ }), {
48
+ TAG: "Placed",
49
+ customerId: "cust-1",
50
+ productIds: [
51
+ "prod-1",
52
+ "prod-2"
53
+ ]
54
+ }));
55
+ test("Place on existing order returns OrderAlreadyPlaced", () => thenError(whenCmd(givenEvents([{
56
+ TAG: "Placed",
57
+ customerId: "cust-1",
58
+ productIds: ["prod-1"]
59
+ }]), {
60
+ TAG: "Place",
61
+ customerId: "cust-1",
62
+ productIds: ["prod-1"]
63
+ }), "OrderAlreadyPlaced"));
64
+ test("Place on shipped order returns OrderAlreadyShipped", () => thenError(whenCmd(givenEvents([
65
+ {
66
+ TAG: "Placed",
67
+ customerId: "cust-1",
68
+ productIds: ["prod-1"]
69
+ },
70
+ "Shipped"
71
+ ]), {
72
+ TAG: "Place",
73
+ customerId: "cust-1",
74
+ productIds: ["prod-1"]
75
+ }), "OrderAlreadyShipped"));
76
+ test("Place on cancelled order returns OrderAlreadyCancelled", () => thenError(whenCmd(givenEvents([
77
+ {
78
+ TAG: "Placed",
79
+ customerId: "cust-1",
80
+ productIds: ["prod-1"]
81
+ },
82
+ {
83
+ TAG: "Cancelled",
84
+ productIds: ["prod-1"]
85
+ }
86
+ ]), {
87
+ TAG: "Place",
88
+ customerId: "cust-1",
89
+ productIds: ["prod-1"]
90
+ }), "OrderAlreadyCancelled"));
91
+ test("Ship on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), "Ship"), "OrderNotFound"));
92
+ test("Ship on placed order produces Shipped", () => thenEvent(whenCmd(givenEvents([{
93
+ TAG: "Placed",
94
+ customerId: "cust-1",
95
+ productIds: ["prod-1"]
96
+ }]), "Ship"), "Shipped"));
97
+ test("Ship on shipped order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
98
+ {
99
+ TAG: "Placed",
100
+ customerId: "cust-1",
101
+ productIds: ["prod-1"]
102
+ },
103
+ "Shipped"
104
+ ]), "Ship")));
105
+ test("Ship on cancelled order returns OrderAlreadyCancelled", () => thenError(whenCmd(givenEvents([
106
+ {
107
+ TAG: "Placed",
108
+ customerId: "cust-1",
109
+ productIds: ["prod-1"]
110
+ },
111
+ {
112
+ TAG: "Cancelled",
113
+ productIds: ["prod-1"]
114
+ }
115
+ ]), "Ship"), "OrderAlreadyCancelled"));
116
+ test("Cancel on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), "Cancel"), "OrderNotFound"));
117
+ test("Cancel on placed order produces Cancelled", () => thenEvent(whenCmd(givenEvents([{
118
+ TAG: "Placed",
119
+ customerId: "cust-1",
120
+ productIds: ["prod-1"]
121
+ }]), "Cancel"), {
122
+ TAG: "Cancelled",
123
+ productIds: ["prod-1"]
124
+ }));
125
+ test("Cancel on shipped order returns OrderAlreadyShipped", () => thenError(whenCmd(givenEvents([
126
+ {
127
+ TAG: "Placed",
128
+ customerId: "cust-1",
129
+ productIds: ["prod-1"]
130
+ },
131
+ "Shipped"
132
+ ]), "Cancel"), "OrderAlreadyShipped"));
133
+ test("Cancel on cancelled order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
134
+ {
135
+ TAG: "Placed",
136
+ customerId: "cust-1",
137
+ productIds: ["prod-1"]
138
+ },
139
+ {
140
+ TAG: "Cancelled",
141
+ productIds: ["prod-1"]
142
+ }
143
+ ]), "Cancel")));
144
+ test("Refund on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), {
145
+ TAG: "Refund",
146
+ reason: "lost-in-transit"
147
+ }), "OrderNotFound"));
148
+ test("Refund on placed order returns OrderNotCancelled", () => thenError(whenCmd(givenEvents([{
149
+ TAG: "Placed",
150
+ customerId: "cust-1",
151
+ productIds: ["prod-1"]
152
+ }]), {
153
+ TAG: "Refund",
154
+ reason: "customer-changed-mind"
155
+ }), "OrderNotCancelled"));
156
+ test("Refund on shipped order returns OrderNotCancelled", () => thenError(whenCmd(givenEvents([
157
+ {
158
+ TAG: "Placed",
159
+ customerId: "cust-1",
160
+ productIds: ["prod-1"]
161
+ },
162
+ "Shipped"
163
+ ]), {
164
+ TAG: "Refund",
165
+ reason: "delivered-damaged"
166
+ }), "OrderNotCancelled"));
167
+ test("Refund on cancelled order produces Refunded", () => thenEvent(whenCmd(givenEvents([
168
+ {
169
+ TAG: "Placed",
170
+ customerId: "cust-1",
171
+ productIds: ["prod-1"]
172
+ },
173
+ {
174
+ TAG: "Cancelled",
175
+ productIds: ["prod-1"]
176
+ }
177
+ ]), {
178
+ TAG: "Refund",
179
+ reason: "customer-changed-mind"
180
+ }), {
181
+ TAG: "Refunded",
182
+ reason: "customer-changed-mind"
183
+ }));
184
+ test("Refund on already-refunded order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
185
+ {
186
+ TAG: "Placed",
187
+ customerId: "cust-1",
188
+ productIds: ["prod-1"]
189
+ },
190
+ {
191
+ TAG: "Cancelled",
192
+ productIds: ["prod-1"]
193
+ },
194
+ {
195
+ TAG: "Refunded",
196
+ reason: "customer-changed-mind"
197
+ }
198
+ ]), {
199
+ TAG: "Refund",
200
+ reason: "customer-changed-mind"
201
+ })));
202
+ });
203
+
204
+ let Spec = include.Spec;
205
+
206
+ let thenCompareEvent = include.thenCompareEvent;
207
+
208
+ let thenEventWithError = include.thenEventWithError;
209
+
210
+ let thenEvents = include.thenEvents;
211
+
212
+ let thenCompareEvents = include.thenCompareEvents;
213
+
214
+ let thenEventsWithError = include.thenEventsWithError;
215
+
216
+ export {
217
+ Spec,
218
+ describe,
219
+ test,
220
+ givenEvents,
221
+ whenCmd,
222
+ thenEvent,
223
+ thenCompareEvent,
224
+ thenNoEvent,
225
+ thenEventWithError,
226
+ thenEvents,
227
+ thenCompareEvents,
228
+ thenEventsWithError,
229
+ thenError,
230
+ }
231
+ /* include Not a pure module */
@@ -0,0 +1,46 @@
1
+ @@reventless.gwt(Orders_Projections.OrderMapping)
2
+
3
+ describe("Orders ReadModel ← Order", () => {
4
+ test("Placed sets initial read model state", () =>
5
+ givenEvents([])
6
+ ->whenEvent(Order.Placed({customerId: "cust-1", productIds: ["prod-1", "prod-2"]}))
7
+ ->thenState({
8
+ Orders.customerId: "cust-1",
9
+ productIds: ["prod-1", "prod-2"],
10
+ status: Placed,
11
+ })
12
+ )
13
+
14
+ test("Shipped updates status", () =>
15
+ givenEvents([Order.Placed({customerId: "cust-1", productIds: ["prod-1"]})])
16
+ ->whenEvent(Order.Shipped)
17
+ ->thenState({
18
+ Orders.customerId: "cust-1",
19
+ productIds: ["prod-1"],
20
+ status: Shipped,
21
+ })
22
+ )
23
+
24
+ test("Cancelled updates status", () =>
25
+ givenEvents([Order.Placed({customerId: "cust-1", productIds: ["prod-1"]})])
26
+ ->whenEvent(Order.Cancelled({productIds: ["prod-1"]}))
27
+ ->thenState({
28
+ Orders.customerId: "cust-1",
29
+ productIds: ["prod-1"],
30
+ status: Cancelled,
31
+ })
32
+ )
33
+
34
+ test("Refunded updates status", () =>
35
+ givenEvents([
36
+ Order.Placed({customerId: "cust-1", productIds: ["prod-1"]}),
37
+ Order.Cancelled({productIds: ["prod-1"]}),
38
+ ])
39
+ ->whenEvent(Order.Refunded({reason: "customer-changed-mind"}))
40
+ ->thenState({
41
+ Orders.customerId: "cust-1",
42
+ productIds: ["prod-1"],
43
+ status: Refunded,
44
+ })
45
+ )
46
+ })
@@ -0,0 +1,118 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Orders_Projections$OrderingPlugin from "../../../src/Order/ReadModel/Orders_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(Orders_Projections$OrderingPlugin.OrderMapping);
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("Orders ReadModel ← Order", () => {
19
+ test("Placed sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
20
+ TAG: "Placed",
21
+ customerId: "cust-1",
22
+ productIds: [
23
+ "prod-1",
24
+ "prod-2"
25
+ ]
26
+ }), {
27
+ customerId: "cust-1",
28
+ productIds: [
29
+ "prod-1",
30
+ "prod-2"
31
+ ],
32
+ status: "Placed"
33
+ }));
34
+ test("Shipped updates status", undefined, () => thenState(whenEvent(givenEvents([{
35
+ TAG: "Placed",
36
+ customerId: "cust-1",
37
+ productIds: ["prod-1"]
38
+ }]), "Shipped"), {
39
+ customerId: "cust-1",
40
+ productIds: ["prod-1"],
41
+ status: "Shipped"
42
+ }));
43
+ test("Cancelled updates status", undefined, () => thenState(whenEvent(givenEvents([{
44
+ TAG: "Placed",
45
+ customerId: "cust-1",
46
+ productIds: ["prod-1"]
47
+ }]), {
48
+ TAG: "Cancelled",
49
+ productIds: ["prod-1"]
50
+ }), {
51
+ customerId: "cust-1",
52
+ productIds: ["prod-1"],
53
+ status: "Cancelled"
54
+ }));
55
+ test("Refunded updates status", undefined, () => thenState(whenEvent(givenEvents([
56
+ {
57
+ TAG: "Placed",
58
+ customerId: "cust-1",
59
+ productIds: ["prod-1"]
60
+ },
61
+ {
62
+ TAG: "Cancelled",
63
+ productIds: ["prod-1"]
64
+ }
65
+ ]), {
66
+ TAG: "Refunded",
67
+ reason: "customer-changed-mind"
68
+ }), {
69
+ customerId: "cust-1",
70
+ productIds: ["prod-1"],
71
+ status: "Refunded"
72
+ }));
73
+ });
74
+
75
+ let describeWithId = include.describeWithId;
76
+
77
+ let givenEventsWithTime = include.givenEventsWithTime;
78
+
79
+ let whenEvents = include.whenEvents;
80
+
81
+ let whenEventWithTime = include.whenEventWithTime;
82
+
83
+ let whenEventsWithTime = include.whenEventsWithTime;
84
+
85
+ let thenStates = include.thenStates;
86
+
87
+ let thenStatesWithId = include.thenStatesWithId;
88
+
89
+ let thenAllStates = include.thenAllStates;
90
+
91
+ let thenStateWithId = include.thenStateWithId;
92
+
93
+ let thenNoState = include.thenNoState;
94
+
95
+ let thenThrow = include.thenThrow;
96
+
97
+ let thenFail = include.thenFail;
98
+
99
+ export {
100
+ describe,
101
+ describeWithId,
102
+ test,
103
+ givenEvents,
104
+ givenEventsWithTime,
105
+ whenEvent,
106
+ whenEvents,
107
+ whenEventWithTime,
108
+ whenEventsWithTime,
109
+ thenStates,
110
+ thenStatesWithId,
111
+ thenAllStates,
112
+ thenState,
113
+ thenStateWithId,
114
+ thenNoState,
115
+ thenThrow,
116
+ thenFail,
117
+ }
118
+ /* include Not a pure module */
@@ -0,0 +1,31 @@
1
+ // Recording mock for `EmailService` (Option C of the `sideeffect-gwt` plan).
2
+ // `install()` swaps `EmailService.current` to a backend that records every
3
+ // call into a ref. `SideEffect_GWT` reads the recorded calls back via `mock`
4
+ // and renders assertions against them.
5
+ //
6
+ // Production code never sees this file — it lives under `tests/` and only
7
+ // loads when the test runner imports it.
8
+
9
+ @schema
10
+ type call = SendOrderConfirmation({email: string, orderId: string})
11
+
12
+ let calls: ref<array<call>> = ref([])
13
+
14
+ let reset = () => calls := []
15
+
16
+ let recordingBackend: EmailService.backend = {
17
+ sendOrderConfirmation: async (~email, ~orderId) => {
18
+ calls := calls.contents->Array.concat([SendOrderConfirmation({email, orderId})])
19
+ },
20
+ }
21
+
22
+ // Swap the live backend and clear any prior recordings. Call from `beforeEach`.
23
+ let install = () => {
24
+ EmailService.current := recordingBackend
25
+ reset()
26
+ }
27
+
28
+ let mock: ReventlessGwt.SideEffect_GWT.mock<call> = {
29
+ snapshot: () => calls.contents,
30
+ encode: c => c->S.reverseConvertToJsonOrThrow(callSchema),
31
+ }
@@ -0,0 +1,56 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as S from "sury/src/S.res.mjs";
4
+ import * as EmailService$OrderingPlugin from "../../../src/Service/EmailService.res.mjs";
5
+
6
+ let callSchema = S.schema(s => ({
7
+ TAG: "SendOrderConfirmation",
8
+ email: s.m(S.string),
9
+ orderId: s.m(S.string)
10
+ }));
11
+
12
+ let calls = {
13
+ contents: []
14
+ };
15
+
16
+ function reset() {
17
+ calls.contents = [];
18
+ }
19
+
20
+ let recordingBackend = {
21
+ sendOrderConfirmation: async (email, orderId) => {
22
+ calls.contents = calls.contents.concat([{
23
+ TAG: "SendOrderConfirmation",
24
+ email: email,
25
+ orderId: orderId
26
+ }]);
27
+ }
28
+ };
29
+
30
+ function install() {
31
+ EmailService$OrderingPlugin.current.contents = recordingBackend;
32
+ calls.contents = [];
33
+ }
34
+
35
+ function mock_snapshot() {
36
+ return calls.contents;
37
+ }
38
+
39
+ function mock_encode(c) {
40
+ return S.reverseConvertToJsonOrThrow(c, callSchema);
41
+ }
42
+
43
+ let mock = {
44
+ snapshot: mock_snapshot,
45
+ encode: mock_encode
46
+ };
47
+
48
+ export {
49
+ callSchema,
50
+ calls,
51
+ reset,
52
+ recordingBackend,
53
+ install,
54
+ mock,
55
+ }
56
+ /* callSchema Not a pure module */
@@ -0,0 +1,37 @@
1
+ // GWT for the aggregate-style egress `Order_EmailNotification`. Mirrors the
2
+ // hybrid example's DCB-side `SendOrderConfirmation_GWT` (OutboundTranslation).
3
+ // The folder `SideEffect/` is what the PPX uses to infer the DSL kind.
4
+
5
+ @@reventless.gwt
6
+
7
+ // Each test installs the recording backend at the start of its pipeline; the
8
+ // install also resets the recorded-calls ref, so tests stay isolated without
9
+ // pulling rescript-jest's `beforeEach` into the example's dependencies.
10
+
11
+ describe("Order_EmailNotification SideEffect", () => {
12
+ test("Placed triggers a confirmation email", () => {
13
+ EmailService_Mock.install()
14
+ givenEventForId(
15
+ Order.Id.makeFromString("o1"),
16
+ Order.Placed({customerId: "alice@example.com", productIds: ["p1"]}),
17
+ )
18
+ ->whenExecuted(EmailService_Mock.mock)
19
+ ->thenExternalCalls([
20
+ EmailService_Mock.SendOrderConfirmation({email: "alice@example.com", orderId: "o1"}),
21
+ ])
22
+ })
23
+
24
+ test("Shipped is a no-op", () => {
25
+ EmailService_Mock.install()
26
+ givenEvent(Order.Shipped)
27
+ ->whenExecuted(EmailService_Mock.mock)
28
+ ->thenNoExternalCalls
29
+ })
30
+
31
+ test("Cancelled is a no-op", () => {
32
+ EmailService_Mock.install()
33
+ givenEvent(Order.Cancelled({productIds: ["p1"]}))
34
+ ->whenExecuted(EmailService_Mock.mock)
35
+ ->thenNoExternalCalls
36
+ })
37
+ })
@@ -0,0 +1,76 @@
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 SideEffect_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/SideEffect_GWT.res.mjs";
5
+ import * as EmailService_Mock$OrderingPlugin from "./EmailService_Mock.res.mjs";
6
+ import * as Order_EmailNotification$OrderingPlugin from "../../../src/Order/SideEffect/Order_EmailNotification.res.mjs";
7
+
8
+ let include = SideEffect_GWT$ReventlessGwt.Make({
9
+ Source: {
10
+ name: Order_EmailNotification$OrderingPlugin.Source.name,
11
+ Id: Id$Reventless.$$String,
12
+ eventSchema: Order_EmailNotification$OrderingPlugin.Source.eventSchema
13
+ },
14
+ moduleUrl: Order_EmailNotification$OrderingPlugin.moduleUrl,
15
+ execute: Order_EmailNotification$OrderingPlugin.execute
16
+ });
17
+
18
+ let describe = include.describe;
19
+
20
+ let test = include.test;
21
+
22
+ let givenEvent = include.givenEvent;
23
+
24
+ let givenEventForId = include.givenEventForId;
25
+
26
+ let whenExecuted = include.whenExecuted;
27
+
28
+ let thenNoExternalCalls = include.thenNoExternalCalls;
29
+
30
+ let thenExternalCalls = include.thenExternalCalls;
31
+
32
+ describe("Order_EmailNotification SideEffect", () => {
33
+ test("Placed triggers a confirmation email", undefined, () => {
34
+ EmailService_Mock$OrderingPlugin.install();
35
+ return thenExternalCalls(whenExecuted(givenEventForId(Id$Reventless.$$String.makeFromString("o1"), {
36
+ TAG: "Placed",
37
+ customerId: "alice@example.com",
38
+ productIds: ["p1"]
39
+ }), EmailService_Mock$OrderingPlugin.mock, undefined), [{
40
+ TAG: "SendOrderConfirmation",
41
+ email: "alice@example.com",
42
+ orderId: "o1"
43
+ }]);
44
+ });
45
+ test("Shipped is a no-op", undefined, () => {
46
+ EmailService_Mock$OrderingPlugin.install();
47
+ return thenNoExternalCalls(whenExecuted(givenEvent("Shipped"), EmailService_Mock$OrderingPlugin.mock, undefined));
48
+ });
49
+ test("Cancelled is a no-op", undefined, () => {
50
+ EmailService_Mock$OrderingPlugin.install();
51
+ return thenNoExternalCalls(whenExecuted(givenEvent({
52
+ TAG: "Cancelled",
53
+ productIds: ["p1"]
54
+ }), EmailService_Mock$OrderingPlugin.mock, undefined));
55
+ });
56
+ });
57
+
58
+ let SE = include.SE;
59
+
60
+ let givenMeta = include.givenMeta;
61
+
62
+ let thenExternalCallCount = include.thenExternalCallCount;
63
+
64
+ export {
65
+ SE,
66
+ describe,
67
+ test,
68
+ givenEvent,
69
+ givenEventForId,
70
+ givenMeta,
71
+ whenExecuted,
72
+ thenNoExternalCalls,
73
+ thenExternalCalls,
74
+ thenExternalCallCount,
75
+ }
76
+ /* include Not a pure module */
@@ -0,0 +1,2 @@
1
+ #Start(1782549919675)
2
+ #Done(1782549921006)
Binary file
@@ -0,0 +1,13 @@
1
+ // AvailableProducts read model specification.
2
+ // Answers "which products can I order?" directly from the Ordering plugin —
3
+ // a denormalised mirror of Catalog.Products kept locally so Ordering doesn't
4
+ // need a cross-plugin call on every place-order request. Hidden from AutoUI
5
+ // because the user-facing product list lives in the Catalog plugin; this one
6
+ // exists purely as a lookup target.
7
+
8
+ @@reventless.spec
9
+ @@reventless.visibility(Internal)
10
+
11
+ @schema
12
+ type state = {name: string, price: float}
13
+
@@ -0,0 +1,15 @@
1
+ @@reventless.gwt(AvailableProducts_Projections.CatalogProductMapping)
2
+
3
+ describe("AvailableProducts ReadModel ← CatalogProduct", () => {
4
+ test("Synced sets initial read model state", () =>
5
+ givenEvents([])
6
+ ->whenEvent(CatalogProduct.Synced({name: "Laptop", price: 999.99}))
7
+ ->thenState({AvailableProducts.name: "Laptop", price: 999.99})
8
+ )
9
+
10
+ test("PriceUpdated updates the price", () =>
11
+ givenEvents([CatalogProduct.Synced({name: "Laptop", price: 999.99})])
12
+ ->whenEvent(CatalogProduct.PriceUpdated({price: 899.99}))
13
+ ->thenState({AvailableProducts.name: "Laptop", price: 899.99})
14
+ )
15
+ })