@reventlessdev/online-shop-aggregates-ordering 3.0.0-alpha.244 → 3.0.0-alpha.246

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 (277) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/bs/.compiler.log +2 -2
  3. package/lib/bs/OrderingPlugin.cmi +0 -0
  4. package/lib/bs/OrderingPlugin.cmt +0 -0
  5. package/lib/bs/OrderingPlugin.mlmap +2 -0
  6. package/lib/bs/compiler-info.json +1 -1
  7. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmi +0 -0
  8. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmt +0 -0
  9. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.ast +0 -0
  10. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.res +2 -0
  11. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  12. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  13. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmi +0 -0
  14. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmt +0 -0
  15. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.ast +0 -0
  16. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.res +2 -0
  17. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  18. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  19. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +4 -4
  20. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmi +0 -0
  21. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmt +0 -0
  22. package/lib/bs/src/Customer/Aggregate/Customer.ast +0 -0
  23. package/lib/bs/src/Customer/Aggregate/Customer.res +2 -0
  24. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmi +0 -0
  25. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmt +0 -0
  26. package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmi +0 -0
  27. package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmj +0 -0
  28. package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmt +0 -0
  29. package/lib/bs/src/Customer/CustomerId.ast +0 -0
  30. package/lib/bs/src/Customer/CustomerId.res +4 -0
  31. package/lib/bs/src/Customer/CustomerId.res.mjs +29 -0
  32. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmi +0 -0
  33. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmt +0 -0
  34. package/lib/bs/src/Customer/ReadModel/Customers.ast +0 -0
  35. package/lib/bs/src/Customer/ReadModel/Customers.res +2 -0
  36. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmi +0 -0
  37. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmt +0 -0
  38. package/lib/bs/src/Customer/ReadModel/Customers_Projections.res.mjs +4 -4
  39. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
  40. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
  41. package/lib/bs/src/Extension/Products_Extension.ast +0 -0
  42. package/lib/bs/src/Extension/Products_Extension.res +6 -2
  43. package/lib/bs/src/Extension/Products_Extension.res.mjs +4 -3
  44. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  45. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
  46. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  47. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.ast +0 -0
  48. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res +23 -8
  49. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +28 -20
  50. package/lib/bs/src/LifecycleModel-OrderingPlugin.cmi +0 -0
  51. package/lib/bs/src/LifecycleModel-OrderingPlugin.cmt +0 -0
  52. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmi +0 -0
  53. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmt +0 -0
  54. package/lib/bs/src/Order/Aggregate/Order.ast +0 -0
  55. package/lib/bs/src/Order/Aggregate/Order.res +7 -3
  56. package/lib/bs/src/Order/Aggregate/Order.res.mjs +7 -6
  57. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmi +0 -0
  58. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmt +0 -0
  59. package/lib/bs/src/Order/Aggregate/Order_Behavior.ast +0 -0
  60. package/lib/bs/src/Order/Aggregate/Order_Behavior.res +1 -1
  61. package/lib/bs/src/Order/Aggregate/Order_Behavior.res.mjs +4 -2
  62. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmi +0 -0
  63. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -0
  64. package/lib/bs/src/Order/Aggregate/Order_Mappings.res.mjs +3 -3
  65. package/lib/bs/src/Order/OrderId-OrderingPlugin.cmi +0 -0
  66. package/lib/bs/src/Order/OrderId-OrderingPlugin.cmj +0 -0
  67. package/lib/bs/src/Order/OrderId-OrderingPlugin.cmt +0 -0
  68. package/lib/bs/src/Order/OrderId.ast +0 -0
  69. package/lib/bs/src/Order/OrderId.res +4 -0
  70. package/lib/bs/src/Order/OrderId.res.mjs +29 -0
  71. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmi +0 -0
  72. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmt +0 -0
  73. package/lib/bs/src/Order/ReadModel/Orders.ast +0 -0
  74. package/lib/bs/src/Order/ReadModel/Orders.res +4 -2
  75. package/lib/bs/src/Order/ReadModel/Orders.res.mjs +4 -2
  76. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmi +0 -0
  77. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
  78. package/lib/bs/src/Order/ReadModel/Orders_Projections.res.mjs +4 -4
  79. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  80. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  81. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.ast +0 -0
  82. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res +4 -1
  83. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res.mjs +4 -3
  84. package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
  85. package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
  86. package/lib/bs/src/Plugin.res.mjs +15 -13
  87. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
  88. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
  89. package/lib/bs/src/Task/OrderNotifications.res.mjs +3 -3
  90. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  91. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  92. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  93. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  94. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmi +0 -0
  95. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmt +0 -0
  96. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmi +0 -0
  97. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmt +0 -0
  98. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  99. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  100. package/lib/bs/tests/Extension/Products_Extension_GWT.ast +0 -0
  101. package/lib/bs/tests/Extension/Products_Extension_GWT.res +4 -2
  102. package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +7 -4
  103. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  104. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  105. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.ast +0 -0
  106. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +6 -2
  107. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +18 -7
  108. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  109. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
  110. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  111. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.ast +0 -0
  112. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res +6 -4
  113. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +19 -11
  114. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmi +0 -0
  115. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmt +0 -0
  116. package/lib/bs/tests/Order/Aggregate/Order_GWT.ast +0 -0
  117. package/lib/bs/tests/Order/Aggregate/Order_GWT.res +29 -24
  118. package/lib/bs/tests/Order/Aggregate/Order_GWT.res.mjs +55 -44
  119. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmi +0 -0
  120. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmt +0 -0
  121. package/lib/bs/tests/Order/ReadModel/Orders_GWT.ast +0 -0
  122. package/lib/bs/tests/Order/ReadModel/Orders_GWT.res +19 -14
  123. package/lib/bs/tests/Order/ReadModel/Orders_GWT.res.mjs +31 -20
  124. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmi +0 -0
  125. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmt +0 -0
  126. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  127. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  128. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.ast +0 -0
  129. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res +5 -2
  130. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +8 -6
  131. package/lib/ocaml/.compiler.log +2 -2
  132. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
  133. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
  134. package/lib/ocaml/AvailableProducts.ast +0 -0
  135. package/lib/ocaml/AvailableProducts.res +2 -0
  136. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  137. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  138. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  139. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  140. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmi +0 -0
  141. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmt +0 -0
  142. package/lib/ocaml/CatalogProduct.ast +0 -0
  143. package/lib/ocaml/CatalogProduct.res +2 -0
  144. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  145. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  146. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  147. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  148. package/lib/ocaml/Customer-OrderingPlugin.cmi +0 -0
  149. package/lib/ocaml/Customer-OrderingPlugin.cmt +0 -0
  150. package/lib/ocaml/Customer.ast +0 -0
  151. package/lib/ocaml/Customer.res +2 -0
  152. package/lib/ocaml/CustomerId-OrderingPlugin.cmi +0 -0
  153. package/lib/ocaml/CustomerId-OrderingPlugin.cmj +0 -0
  154. package/lib/ocaml/CustomerId-OrderingPlugin.cmt +0 -0
  155. package/lib/ocaml/CustomerId.ast +0 -0
  156. package/lib/ocaml/CustomerId.res +4 -0
  157. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmi +0 -0
  158. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmt +0 -0
  159. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmi +0 -0
  160. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmt +0 -0
  161. package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
  162. package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
  163. package/lib/ocaml/Customers.ast +0 -0
  164. package/lib/ocaml/Customers.res +2 -0
  165. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
  166. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
  167. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
  168. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
  169. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
  170. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
  171. package/lib/ocaml/LifecycleModel-OrderingPlugin.cmi +0 -0
  172. package/lib/ocaml/LifecycleModel-OrderingPlugin.cmt +0 -0
  173. package/lib/ocaml/Order-OrderingPlugin.cmi +0 -0
  174. package/lib/ocaml/Order-OrderingPlugin.cmt +0 -0
  175. package/lib/ocaml/Order.ast +0 -0
  176. package/lib/ocaml/Order.res +7 -3
  177. package/lib/ocaml/OrderId-OrderingPlugin.cmi +0 -0
  178. package/lib/ocaml/OrderId-OrderingPlugin.cmj +0 -0
  179. package/lib/ocaml/OrderId-OrderingPlugin.cmt +0 -0
  180. package/lib/ocaml/OrderId.ast +0 -0
  181. package/lib/ocaml/OrderId.res +4 -0
  182. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  183. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
  184. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  185. package/lib/ocaml/OrderMappings_GWT.ast +0 -0
  186. package/lib/ocaml/OrderMappings_GWT.res +6 -4
  187. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmi +0 -0
  188. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmt +0 -0
  189. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmi +0 -0
  190. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmt +0 -0
  191. package/lib/ocaml/Order_Behavior.ast +0 -0
  192. package/lib/ocaml/Order_Behavior.res +1 -1
  193. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  194. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  195. package/lib/ocaml/Order_EmailNotification.ast +0 -0
  196. package/lib/ocaml/Order_EmailNotification.res +4 -1
  197. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  198. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  199. package/lib/ocaml/Order_EmailNotification_GWT.ast +0 -0
  200. package/lib/ocaml/Order_EmailNotification_GWT.res +5 -2
  201. package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +0 -0
  202. package/lib/ocaml/Order_GWT-OrderingPlugin.cmt +0 -0
  203. package/lib/ocaml/Order_GWT.ast +0 -0
  204. package/lib/ocaml/Order_GWT.res +29 -24
  205. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmi +0 -0
  206. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmt +0 -0
  207. package/lib/ocaml/OrderingPlugin.cmi +0 -0
  208. package/lib/ocaml/OrderingPlugin.cmt +0 -0
  209. package/lib/ocaml/OrderingPlugin.mlmap +2 -0
  210. package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
  211. package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
  212. package/lib/ocaml/Orders.ast +0 -0
  213. package/lib/ocaml/Orders.res +4 -2
  214. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  215. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
  216. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  217. package/lib/ocaml/Orders_ExtensionPointMapping.ast +0 -0
  218. package/lib/ocaml/Orders_ExtensionPointMapping.res +23 -8
  219. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  220. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  221. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.ast +0 -0
  222. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.res +6 -2
  223. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
  224. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
  225. package/lib/ocaml/Orders_GWT.ast +0 -0
  226. package/lib/ocaml/Orders_GWT.res +19 -14
  227. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmi +0 -0
  228. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmt +0 -0
  229. package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
  230. package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
  231. package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
  232. package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
  233. package/lib/ocaml/Products_Extension.ast +0 -0
  234. package/lib/ocaml/Products_Extension.res +6 -2
  235. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  236. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  237. package/lib/ocaml/Products_Extension_GWT.ast +0 -0
  238. package/lib/ocaml/Products_Extension_GWT.res +4 -2
  239. package/package.json +8 -8
  240. package/src/CatalogProduct/Aggregate/CatalogProduct.res +2 -0
  241. package/src/CatalogProduct/ReadModel/AvailableProducts.res +2 -0
  242. package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +4 -4
  243. package/src/Customer/Aggregate/Customer.res +2 -0
  244. package/src/Customer/CustomerId.res +4 -0
  245. package/src/Customer/CustomerId.res.mjs +29 -0
  246. package/src/Customer/ReadModel/Customers.res +2 -0
  247. package/src/Customer/ReadModel/Customers_Projections.res.mjs +4 -4
  248. package/src/Extension/Products_Extension.res +6 -2
  249. package/src/Extension/Products_Extension.res.mjs +4 -3
  250. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +23 -8
  251. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +28 -20
  252. package/src/Order/Aggregate/Order.res +7 -3
  253. package/src/Order/Aggregate/Order.res.mjs +7 -6
  254. package/src/Order/Aggregate/Order_Behavior.res +1 -1
  255. package/src/Order/Aggregate/Order_Behavior.res.mjs +4 -2
  256. package/src/Order/Aggregate/Order_Mappings.res.mjs +3 -3
  257. package/src/Order/OrderId.res +4 -0
  258. package/src/Order/OrderId.res.mjs +29 -0
  259. package/src/Order/ReadModel/Orders.res +4 -2
  260. package/src/Order/ReadModel/Orders.res.mjs +4 -2
  261. package/src/Order/ReadModel/Orders_Projections.res.mjs +4 -4
  262. package/src/Order/SideEffect/Order_EmailNotification.res +4 -1
  263. package/src/Order/SideEffect/Order_EmailNotification.res.mjs +4 -3
  264. package/src/Plugin.res.mjs +15 -13
  265. package/src/Task/OrderNotifications.res.mjs +3 -3
  266. package/tests/Extension/Products_Extension_GWT.res +4 -2
  267. package/tests/Extension/Products_Extension_GWT.res.mjs +7 -4
  268. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +6 -2
  269. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +18 -7
  270. package/tests/Order/Aggregate/OrderMappings_GWT.res +6 -4
  271. package/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +19 -11
  272. package/tests/Order/Aggregate/Order_GWT.res +29 -24
  273. package/tests/Order/Aggregate/Order_GWT.res.mjs +55 -44
  274. package/tests/Order/ReadModel/Orders_GWT.res +19 -14
  275. package/tests/Order/ReadModel/Orders_GWT.res.mjs +31 -20
  276. package/tests/Order/SideEffect/Order_EmailNotification_GWT.res +5 -2
  277. package/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +8 -6
@@ -1,30 +1,35 @@
1
1
  @@reventless.gwt
2
2
 
3
+ // Ids are typed; the literals are made once, here.
4
+ let cust1 = CustomerId.make("cust-1")
5
+ let prod1 = CatalogSpec.ProductId.make("prod-1")
6
+ let prod2 = CatalogSpec.ProductId.make("prod-2")
7
+
3
8
  describe("Order Behavior", () => {
4
9
  test("Place on new aggregate produces Placed", () =>
5
10
  givenEvents([])
6
- ->whenCmd(Place({customerId: "cust-1", productIds: ["prod-1", "prod-2"]}))
7
- ->thenEvent(Placed({customerId: "cust-1", productIds: ["prod-1", "prod-2"]}))
11
+ ->whenCmd(Place({customerId: cust1, productIds: [prod1, prod2]}))
12
+ ->thenEvent(Placed({customerId: cust1, productIds: [prod1, prod2]}))
8
13
  )
9
14
 
10
15
  test("Place on existing order returns OrderAlreadyPlaced", () =>
11
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]})])
12
- ->whenCmd(Place({customerId: "cust-1", productIds: ["prod-1"]}))
16
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
17
+ ->whenCmd(Place({customerId: cust1, productIds: [prod1]}))
13
18
  ->thenError(OrderAlreadyPlaced)
14
19
  )
15
20
 
16
21
  test("Place on shipped order returns OrderAlreadyShipped", () =>
17
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]}), Shipped])
18
- ->whenCmd(Place({customerId: "cust-1", productIds: ["prod-1"]}))
22
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
23
+ ->whenCmd(Place({customerId: cust1, productIds: [prod1]}))
19
24
  ->thenError(OrderAlreadyShipped)
20
25
  )
21
26
 
22
27
  test("Place on cancelled order returns OrderAlreadyCancelled", () =>
23
28
  givenEvents([
24
- Placed({customerId: "cust-1", productIds: ["prod-1"]}),
25
- Cancelled({productIds: ["prod-1"]}),
29
+ Placed({customerId: cust1, productIds: [prod1]}),
30
+ Cancelled({productIds: [prod1]}),
26
31
  ])
27
- ->whenCmd(Place({customerId: "cust-1", productIds: ["prod-1"]}))
32
+ ->whenCmd(Place({customerId: cust1, productIds: [prod1]}))
28
33
  ->thenError(OrderAlreadyCancelled)
29
34
  )
30
35
 
@@ -35,21 +40,21 @@ describe("Order Behavior", () => {
35
40
  )
36
41
 
37
42
  test("Ship on placed order produces Shipped", () =>
38
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]})])
43
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
39
44
  ->whenCmd(Ship)
40
45
  ->thenEvent(Shipped)
41
46
  )
42
47
 
43
48
  test("Ship on shipped order produces no events (idempotent)", () =>
44
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]}), Shipped])
49
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
45
50
  ->whenCmd(Ship)
46
51
  ->thenNoEvent
47
52
  )
48
53
 
49
54
  test("Ship on cancelled order returns OrderAlreadyCancelled", () =>
50
55
  givenEvents([
51
- Placed({customerId: "cust-1", productIds: ["prod-1"]}),
52
- Cancelled({productIds: ["prod-1"]}),
56
+ Placed({customerId: cust1, productIds: [prod1]}),
57
+ Cancelled({productIds: [prod1]}),
53
58
  ])
54
59
  ->whenCmd(Ship)
55
60
  ->thenError(OrderAlreadyCancelled)
@@ -62,21 +67,21 @@ describe("Order Behavior", () => {
62
67
  )
63
68
 
64
69
  test("Cancel on placed order produces Cancelled", () =>
65
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]})])
70
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
66
71
  ->whenCmd(Cancel)
67
- ->thenEvent(Cancelled({productIds: ["prod-1"]}))
72
+ ->thenEvent(Cancelled({productIds: [prod1]}))
68
73
  )
69
74
 
70
75
  test("Cancel on shipped order returns OrderAlreadyShipped", () =>
71
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]}), Shipped])
76
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
72
77
  ->whenCmd(Cancel)
73
78
  ->thenError(OrderAlreadyShipped)
74
79
  )
75
80
 
76
81
  test("Cancel on cancelled order produces no events (idempotent)", () =>
77
82
  givenEvents([
78
- Placed({customerId: "cust-1", productIds: ["prod-1"]}),
79
- Cancelled({productIds: ["prod-1"]}),
83
+ Placed({customerId: cust1, productIds: [prod1]}),
84
+ Cancelled({productIds: [prod1]}),
80
85
  ])
81
86
  ->whenCmd(Cancel)
82
87
  ->thenNoEvent
@@ -89,21 +94,21 @@ describe("Order Behavior", () => {
89
94
  )
90
95
 
91
96
  test("Refund on placed order returns OrderNotCancelled", () =>
92
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]})])
97
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
93
98
  ->whenCmd(Refund({reason: "customer-changed-mind"}))
94
99
  ->thenError(OrderNotCancelled)
95
100
  )
96
101
 
97
102
  test("Refund on shipped order returns OrderNotCancelled", () =>
98
- givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]}), Shipped])
103
+ givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
99
104
  ->whenCmd(Refund({reason: "delivered-damaged"}))
100
105
  ->thenError(OrderNotCancelled)
101
106
  )
102
107
 
103
108
  test("Refund on cancelled order produces Refunded", () =>
104
109
  givenEvents([
105
- Placed({customerId: "cust-1", productIds: ["prod-1"]}),
106
- Cancelled({productIds: ["prod-1"]}),
110
+ Placed({customerId: cust1, productIds: [prod1]}),
111
+ Cancelled({productIds: [prod1]}),
107
112
  ])
108
113
  ->whenCmd(Refund({reason: "customer-changed-mind"}))
109
114
  ->thenEvent(Refunded({reason: "customer-changed-mind"}))
@@ -111,8 +116,8 @@ describe("Order Behavior", () => {
111
116
 
112
117
  test("Refund on already-refunded order produces no events (idempotent)", () =>
113
118
  givenEvents([
114
- Placed({customerId: "cust-1", productIds: ["prod-1"]}),
115
- Cancelled({productIds: ["prod-1"]}),
119
+ Placed({customerId: cust1, productIds: [prod1]}),
120
+ Cancelled({productIds: [prod1]}),
116
121
  Refunded({reason: "customer-changed-mind"}),
117
122
  ])
118
123
  ->whenCmd(Refund({reason: "customer-changed-mind"}))
@@ -1,6 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Order$OrderingPlugin from "../../../src/Order/Aggregate/Order.res.mjs";
4
+ import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
5
+ import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
4
6
  import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
5
7
  import * as Order_Behavior$OrderingPlugin from "../../../src/Order/Aggregate/Order_Behavior.res.mjs";
6
8
 
@@ -37,109 +39,115 @@ let thenNoEvent = include.thenNoEvent;
37
39
 
38
40
  let thenError = include.thenError;
39
41
 
42
+ let cust1 = CustomerId$OrderingPlugin.make("cust-1");
43
+
44
+ let prod1 = ProductId$CatalogSpec.make("prod-1");
45
+
46
+ let prod2 = ProductId$CatalogSpec.make("prod-2");
47
+
40
48
  describe("Order Behavior", () => {
41
49
  test("Place on new aggregate produces Placed", () => thenEvent(whenCmd(givenEvents([]), {
42
50
  TAG: "Place",
43
- customerId: "cust-1",
51
+ customerId: cust1,
44
52
  productIds: [
45
- "prod-1",
46
- "prod-2"
53
+ prod1,
54
+ prod2
47
55
  ]
48
56
  }), {
49
57
  TAG: "Placed",
50
- customerId: "cust-1",
58
+ customerId: cust1,
51
59
  productIds: [
52
- "prod-1",
53
- "prod-2"
60
+ prod1,
61
+ prod2
54
62
  ]
55
63
  }));
56
64
  test("Place on existing order returns OrderAlreadyPlaced", () => thenError(whenCmd(givenEvents([{
57
65
  TAG: "Placed",
58
- customerId: "cust-1",
59
- productIds: ["prod-1"]
66
+ customerId: cust1,
67
+ productIds: [prod1]
60
68
  }]), {
61
69
  TAG: "Place",
62
- customerId: "cust-1",
63
- productIds: ["prod-1"]
70
+ customerId: cust1,
71
+ productIds: [prod1]
64
72
  }), "OrderAlreadyPlaced"));
65
73
  test("Place on shipped order returns OrderAlreadyShipped", () => thenError(whenCmd(givenEvents([
66
74
  {
67
75
  TAG: "Placed",
68
- customerId: "cust-1",
69
- productIds: ["prod-1"]
76
+ customerId: cust1,
77
+ productIds: [prod1]
70
78
  },
71
79
  "Shipped"
72
80
  ]), {
73
81
  TAG: "Place",
74
- customerId: "cust-1",
75
- productIds: ["prod-1"]
82
+ customerId: cust1,
83
+ productIds: [prod1]
76
84
  }), "OrderAlreadyShipped"));
77
85
  test("Place on cancelled order returns OrderAlreadyCancelled", () => thenError(whenCmd(givenEvents([
78
86
  {
79
87
  TAG: "Placed",
80
- customerId: "cust-1",
81
- productIds: ["prod-1"]
88
+ customerId: cust1,
89
+ productIds: [prod1]
82
90
  },
83
91
  {
84
92
  TAG: "Cancelled",
85
- productIds: ["prod-1"]
93
+ productIds: [prod1]
86
94
  }
87
95
  ]), {
88
96
  TAG: "Place",
89
- customerId: "cust-1",
90
- productIds: ["prod-1"]
97
+ customerId: cust1,
98
+ productIds: [prod1]
91
99
  }), "OrderAlreadyCancelled"));
92
100
  test("Ship on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), "Ship"), "OrderNotFound"));
93
101
  test("Ship on placed order produces Shipped", () => thenEvent(whenCmd(givenEvents([{
94
102
  TAG: "Placed",
95
- customerId: "cust-1",
96
- productIds: ["prod-1"]
103
+ customerId: cust1,
104
+ productIds: [prod1]
97
105
  }]), "Ship"), "Shipped"));
98
106
  test("Ship on shipped order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
99
107
  {
100
108
  TAG: "Placed",
101
- customerId: "cust-1",
102
- productIds: ["prod-1"]
109
+ customerId: cust1,
110
+ productIds: [prod1]
103
111
  },
104
112
  "Shipped"
105
113
  ]), "Ship")));
106
114
  test("Ship on cancelled order returns OrderAlreadyCancelled", () => thenError(whenCmd(givenEvents([
107
115
  {
108
116
  TAG: "Placed",
109
- customerId: "cust-1",
110
- productIds: ["prod-1"]
117
+ customerId: cust1,
118
+ productIds: [prod1]
111
119
  },
112
120
  {
113
121
  TAG: "Cancelled",
114
- productIds: ["prod-1"]
122
+ productIds: [prod1]
115
123
  }
116
124
  ]), "Ship"), "OrderAlreadyCancelled"));
117
125
  test("Cancel on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), "Cancel"), "OrderNotFound"));
118
126
  test("Cancel on placed order produces Cancelled", () => thenEvent(whenCmd(givenEvents([{
119
127
  TAG: "Placed",
120
- customerId: "cust-1",
121
- productIds: ["prod-1"]
128
+ customerId: cust1,
129
+ productIds: [prod1]
122
130
  }]), "Cancel"), {
123
131
  TAG: "Cancelled",
124
- productIds: ["prod-1"]
132
+ productIds: [prod1]
125
133
  }));
126
134
  test("Cancel on shipped order returns OrderAlreadyShipped", () => thenError(whenCmd(givenEvents([
127
135
  {
128
136
  TAG: "Placed",
129
- customerId: "cust-1",
130
- productIds: ["prod-1"]
137
+ customerId: cust1,
138
+ productIds: [prod1]
131
139
  },
132
140
  "Shipped"
133
141
  ]), "Cancel"), "OrderAlreadyShipped"));
134
142
  test("Cancel on cancelled order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
135
143
  {
136
144
  TAG: "Placed",
137
- customerId: "cust-1",
138
- productIds: ["prod-1"]
145
+ customerId: cust1,
146
+ productIds: [prod1]
139
147
  },
140
148
  {
141
149
  TAG: "Cancelled",
142
- productIds: ["prod-1"]
150
+ productIds: [prod1]
143
151
  }
144
152
  ]), "Cancel")));
145
153
  test("Refund on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), {
@@ -148,8 +156,8 @@ describe("Order Behavior", () => {
148
156
  }), "OrderNotFound"));
149
157
  test("Refund on placed order returns OrderNotCancelled", () => thenError(whenCmd(givenEvents([{
150
158
  TAG: "Placed",
151
- customerId: "cust-1",
152
- productIds: ["prod-1"]
159
+ customerId: cust1,
160
+ productIds: [prod1]
153
161
  }]), {
154
162
  TAG: "Refund",
155
163
  reason: "customer-changed-mind"
@@ -157,8 +165,8 @@ describe("Order Behavior", () => {
157
165
  test("Refund on shipped order returns OrderNotCancelled", () => thenError(whenCmd(givenEvents([
158
166
  {
159
167
  TAG: "Placed",
160
- customerId: "cust-1",
161
- productIds: ["prod-1"]
168
+ customerId: cust1,
169
+ productIds: [prod1]
162
170
  },
163
171
  "Shipped"
164
172
  ]), {
@@ -168,12 +176,12 @@ describe("Order Behavior", () => {
168
176
  test("Refund on cancelled order produces Refunded", () => thenEvent(whenCmd(givenEvents([
169
177
  {
170
178
  TAG: "Placed",
171
- customerId: "cust-1",
172
- productIds: ["prod-1"]
179
+ customerId: cust1,
180
+ productIds: [prod1]
173
181
  },
174
182
  {
175
183
  TAG: "Cancelled",
176
- productIds: ["prod-1"]
184
+ productIds: [prod1]
177
185
  }
178
186
  ]), {
179
187
  TAG: "Refund",
@@ -185,12 +193,12 @@ describe("Order Behavior", () => {
185
193
  test("Refund on already-refunded order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
186
194
  {
187
195
  TAG: "Placed",
188
- customerId: "cust-1",
189
- productIds: ["prod-1"]
196
+ customerId: cust1,
197
+ productIds: [prod1]
190
198
  },
191
199
  {
192
200
  TAG: "Cancelled",
193
- productIds: ["prod-1"]
201
+ productIds: [prod1]
194
202
  },
195
203
  {
196
204
  TAG: "Refunded",
@@ -228,5 +236,8 @@ export {
228
236
  thenCompareEvents,
229
237
  thenEventsWithError,
230
238
  thenError,
239
+ cust1,
240
+ prod1,
241
+ prod2,
231
242
  }
232
243
  /* include Not a pure module */
@@ -1,45 +1,50 @@
1
1
  @@reventless.gwt(Orders_Projections.OrderMapping)
2
2
 
3
+ // Ids are typed; the literals are made once, here.
4
+ let cust1 = CustomerId.make("cust-1")
5
+ let prod1 = CatalogSpec.ProductId.make("prod-1")
6
+ let prod2 = CatalogSpec.ProductId.make("prod-2")
7
+
3
8
  describe("Orders ReadModel ← Order", () => {
4
9
  test("Placed sets initial read model state", () =>
5
10
  givenEvents([])
6
- ->whenEvent(Order.Placed({customerId: "cust-1", productIds: ["prod-1", "prod-2"]}))
11
+ ->whenEvent(Order.Placed({customerId: cust1, productIds: [prod1, prod2]}))
7
12
  ->thenState({
8
- Orders.customerId: "cust-1",
9
- productIds: ["prod-1", "prod-2"],
13
+ Orders.customerId: cust1,
14
+ productIds: [prod1, prod2],
10
15
  lifecycle: Placed,
11
16
  })
12
17
  )
13
18
 
14
19
  test("Shipped updates status", () =>
15
- givenEvents([Order.Placed({customerId: "cust-1", productIds: ["prod-1"]})])
20
+ givenEvents([Order.Placed({customerId: cust1, productIds: [prod1]})])
16
21
  ->whenEvent(Order.Shipped)
17
22
  ->thenState({
18
- Orders.customerId: "cust-1",
19
- productIds: ["prod-1"],
23
+ Orders.customerId: cust1,
24
+ productIds: [prod1],
20
25
  lifecycle: Shipped,
21
26
  })
22
27
  )
23
28
 
24
29
  test("Cancelled updates status", () =>
25
- givenEvents([Order.Placed({customerId: "cust-1", productIds: ["prod-1"]})])
26
- ->whenEvent(Order.Cancelled({productIds: ["prod-1"]}))
30
+ givenEvents([Order.Placed({customerId: cust1, productIds: [prod1]})])
31
+ ->whenEvent(Order.Cancelled({productIds: [prod1]}))
27
32
  ->thenState({
28
- Orders.customerId: "cust-1",
29
- productIds: ["prod-1"],
33
+ Orders.customerId: cust1,
34
+ productIds: [prod1],
30
35
  lifecycle: Cancelled,
31
36
  })
32
37
  )
33
38
 
34
39
  test("Refunded updates status", () =>
35
40
  givenEvents([
36
- Order.Placed({customerId: "cust-1", productIds: ["prod-1"]}),
37
- Order.Cancelled({productIds: ["prod-1"]}),
41
+ Order.Placed({customerId: cust1, productIds: [prod1]}),
42
+ Order.Cancelled({productIds: [prod1]}),
38
43
  ])
39
44
  ->whenEvent(Order.Refunded({reason: "customer-changed-mind"}))
40
45
  ->thenState({
41
- Orders.customerId: "cust-1",
42
- productIds: ["prod-1"],
46
+ Orders.customerId: cust1,
47
+ productIds: [prod1],
43
48
  lifecycle: Refunded,
44
49
  })
45
50
  )
@@ -1,5 +1,7 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
4
+ import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
3
5
  import * as Orders_Projections$OrderingPlugin from "../../../src/Order/ReadModel/Orders_Projections.res.mjs";
4
6
  import * as MultiSourceProjection_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/MultiSourceProjection_GWT.res.mjs";
5
7
 
@@ -15,59 +17,65 @@ let whenEvent = include.whenEvent;
15
17
 
16
18
  let thenState = include.thenState;
17
19
 
20
+ let cust1 = CustomerId$OrderingPlugin.make("cust-1");
21
+
22
+ let prod1 = ProductId$CatalogSpec.make("prod-1");
23
+
24
+ let prod2 = ProductId$CatalogSpec.make("prod-2");
25
+
18
26
  describe("Orders ReadModel ← Order", () => {
19
27
  test("Placed sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
20
28
  TAG: "Placed",
21
- customerId: "cust-1",
29
+ customerId: cust1,
22
30
  productIds: [
23
- "prod-1",
24
- "prod-2"
31
+ prod1,
32
+ prod2
25
33
  ]
26
34
  }), {
27
- customerId: "cust-1",
35
+ customerId: cust1,
28
36
  productIds: [
29
- "prod-1",
30
- "prod-2"
37
+ prod1,
38
+ prod2
31
39
  ],
32
40
  lifecycle: "Placed"
33
41
  }));
34
42
  test("Shipped updates status", undefined, () => thenState(whenEvent(givenEvents([{
35
43
  TAG: "Placed",
36
- customerId: "cust-1",
37
- productIds: ["prod-1"]
44
+ customerId: cust1,
45
+ productIds: [prod1]
38
46
  }]), "Shipped"), {
39
- customerId: "cust-1",
40
- productIds: ["prod-1"],
47
+ customerId: cust1,
48
+ productIds: [prod1],
41
49
  lifecycle: "Shipped"
42
50
  }));
43
51
  test("Cancelled updates status", undefined, () => thenState(whenEvent(givenEvents([{
44
52
  TAG: "Placed",
45
- customerId: "cust-1",
46
- productIds: ["prod-1"]
53
+ customerId: cust1,
54
+ productIds: [prod1]
47
55
  }]), {
48
56
  TAG: "Cancelled",
49
- productIds: ["prod-1"]
57
+ productIds: [prod1]
50
58
  }), {
51
- customerId: "cust-1",
52
- productIds: ["prod-1"],
59
+ customerId: cust1,
60
+ productIds: [prod1],
53
61
  lifecycle: "Cancelled"
54
62
  }));
55
63
  test("Refunded updates status", undefined, () => thenState(whenEvent(givenEvents([
56
64
  {
57
65
  TAG: "Placed",
58
- customerId: "cust-1",
59
- productIds: ["prod-1"]
66
+ customerId: cust1,
67
+ productIds: [prod1]
60
68
  },
61
69
  {
62
70
  TAG: "Cancelled",
63
- productIds: ["prod-1"]
71
+ productIds: [prod1]
64
72
  }
65
73
  ]), {
66
74
  TAG: "Refunded",
67
75
  reason: "customer-changed-mind"
68
76
  }), {
69
- customerId: "cust-1",
70
- productIds: ["prod-1"],
77
+ customerId: cust1,
78
+ productIds: [prod1],
71
79
  lifecycle: "Refunded"
72
80
  }));
73
81
  });
@@ -114,5 +122,8 @@ export {
114
122
  thenNoState,
115
123
  thenThrow,
116
124
  thenFail,
125
+ cust1,
126
+ prod1,
127
+ prod2,
117
128
  }
118
129
  /* include Not a pure module */
@@ -16,7 +16,10 @@ describe(name ++ " SideEffect", () => {
16
16
  EmailService_Mock.install()
17
17
  givenEventForId(
18
18
  Order.Id.makeFromString("o1"),
19
- Order.Placed({customerId: "alice@example.com", productIds: ["p1"]}),
19
+ Order.Placed({
20
+ customerId: CustomerId.make("alice@example.com"),
21
+ productIds: [CatalogSpec.ProductId.make("p1")],
22
+ }),
20
23
  )
21
24
  ->whenExecuted(EmailService_Mock.mock)
22
25
  ->thenExternalCalls([
@@ -33,7 +36,7 @@ describe(name ++ " SideEffect", () => {
33
36
 
34
37
  test("Cancelled is a no-op", () => {
35
38
  EmailService_Mock.install()
36
- givenEvent(Order.Cancelled({productIds: ["p1"]}))
39
+ givenEvent(Order.Cancelled({productIds: [CatalogSpec.ProductId.make("p1")]}))
37
40
  ->whenExecuted(EmailService_Mock.mock)
38
41
  ->thenNoExternalCalls
39
42
  })
@@ -1,6 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
3
+ import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
4
+ import * as OrderId$OrderingPlugin from "../../../src/Order/OrderId.res.mjs";
5
+ import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
4
6
  import * as SideEffect_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/SideEffect_GWT.res.mjs";
5
7
  import * as EmailService_Mock$OrderingPlugin from "./EmailService_Mock.res.mjs";
6
8
  import * as Order_EmailNotification$OrderingPlugin from "../../../src/Order/SideEffect/Order_EmailNotification.res.mjs";
@@ -8,7 +10,7 @@ import * as Order_EmailNotification$OrderingPlugin from "../../../src/Order/Side
8
10
  let include = SideEffect_GWT$ReventlessGwt.Make({
9
11
  Source: {
10
12
  name: Order_EmailNotification$OrderingPlugin.Source.name,
11
- Id: Id$Reventless.$$String,
13
+ Id: OrderId$OrderingPlugin,
12
14
  eventSchema: Order_EmailNotification$OrderingPlugin.Source.eventSchema
13
15
  },
14
16
  moduleUrl: Order_EmailNotification$OrderingPlugin.moduleUrl,
@@ -32,10 +34,10 @@ let thenExternalCalls = include.thenExternalCalls;
32
34
  describe(Order_EmailNotification$OrderingPlugin.name + " SideEffect", () => {
33
35
  test("Placed triggers a confirmation email", undefined, () => {
34
36
  EmailService_Mock$OrderingPlugin.install();
35
- return thenExternalCalls(whenExecuted(givenEventForId(Id$Reventless.$$String.makeFromString("o1"), {
37
+ return thenExternalCalls(whenExecuted(givenEventForId(OrderId$OrderingPlugin.makeFromString("o1"), {
36
38
  TAG: "Placed",
37
- customerId: "alice@example.com",
38
- productIds: ["p1"]
39
+ customerId: CustomerId$OrderingPlugin.make("alice@example.com"),
40
+ productIds: [ProductId$CatalogSpec.make("p1")]
39
41
  }), EmailService_Mock$OrderingPlugin.mock, undefined), [{
40
42
  TAG: "SendOrderConfirmation",
41
43
  email: "alice@example.com",
@@ -50,7 +52,7 @@ describe(Order_EmailNotification$OrderingPlugin.name + " SideEffect", () => {
50
52
  EmailService_Mock$OrderingPlugin.install();
51
53
  return thenNoExternalCalls(whenExecuted(givenEvent({
52
54
  TAG: "Cancelled",
53
- productIds: ["p1"]
55
+ productIds: [ProductId$CatalogSpec.make("p1")]
54
56
  }), EmailService_Mock$OrderingPlugin.mock, undefined));
55
57
  });
56
58
  });
@@ -1,2 +1,2 @@
1
- #Start(1789940154691)
2
- #Done(1789940160402)
1
+ #Start(1789994023811)
2
+ #Done(1789994029825)
Binary file
@@ -8,5 +8,7 @@
8
8
  @@reventless.spec
9
9
  @@reventless.visibility(Internal)
10
10
 
11
+ module Id = CatalogSpec.ProductId
12
+
11
13
  @schema
12
14
  type state = {name: string, price: float}
Binary file
@@ -4,6 +4,8 @@
4
4
 
5
5
  @@reventless.spec
6
6
 
7
+ module Id = CatalogSpec.ProductId
8
+
7
9
  @schema
8
10
  type command =
9
11
  | Sync({name: string, price: float})