@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
Binary file
@@ -3,6 +3,8 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ module Id = CustomerId
7
+
6
8
  // The command is where an address is first accepted, so it is where the type
7
9
  // belongs — a value that reaches the log is already permanent. The events below
8
10
  // stay plain `string`: they record what was accepted, and re-validating history
Binary file
@@ -0,0 +1,4 @@
1
+ // A customer's id: the Customer stream, the Customers rows, and an order's buyer.
2
+ include Reventless.Id.Make({
3
+ let key = "customerId"
4
+ })
Binary file
@@ -3,6 +3,8 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ module Id = CustomerId
7
+
6
8
  // Marked on the query side too, where it is what makes the field render as a
7
9
  // mailto link instead of a text box: the AutoUI reads the semantic off this
8
10
  // state schema, not off the command's.
Binary file
Binary file
Binary file
@@ -3,18 +3,22 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ module Id = OrderId
7
+
6
8
  @schema
7
9
  type command =
8
- | Place({customerId: string, @ref("AvailableProducts") @noDcbTag productIds: array<string>})
10
+ // Both references are derived from the types: AvailableProducts is the one view
11
+ // here keyed by ProductId, and Customers the one keyed by CustomerId.
12
+ | Place({customerId: CustomerId.t, productIds: array<CatalogSpec.ProductId.t>})
9
13
  | Ship
10
14
  | Cancel
11
15
  | Refund({reason: string})
12
16
 
13
17
  @schema
14
18
  type event =
15
- | Placed({customerId: string, productIds: array<string>})
19
+ | Placed({customerId: CustomerId.t, productIds: array<CatalogSpec.ProductId.t>})
16
20
  | Shipped
17
- | Cancelled({productIds: array<string>})
21
+ | Cancelled({productIds: array<CatalogSpec.ProductId.t>})
18
22
  | Refunded({reason: string})
19
23
 
20
24
  @schema
Binary file
@@ -0,0 +1,4 @@
1
+ // An order's id: the Order stream and the Orders rows are keyed by it.
2
+ include Reventless.Id.Make({
3
+ let key = "orderId"
4
+ })
Binary file
@@ -17,13 +17,15 @@ module AutoShipGwtMapping = {
17
17
 
18
18
  include ReventlessGwt.Mapping_GWT.Make(AutoShipGwtMapping)
19
19
 
20
- let placedEvent = Order.Placed({customerId: "cust-1", productIds: ["prod-1"]})
20
+ let cust1 = CustomerId.make("cust-1")
21
+ let prod1 = CatalogSpec.ProductId.make("prod-1")
22
+ let placedEvent = Order.Placed({customerId: cust1, productIds: [prod1]})
21
23
 
22
24
  describe("Order auto-ship mapping (Placed → Ship)", () => {
23
25
  test("Place → AutoShipMapping issues Ship → target emits Shipped", () =>
24
26
  givenSourceEvents([])
25
27
  ->andTargetEvents([("order-1", [placedEvent])])
26
- ->whenSourceCmd("order-1", Place({customerId: "cust-1", productIds: ["prod-1"]}))
28
+ ->whenSourceCmd("order-1", Place({customerId: cust1, productIds: [prod1]}))
27
29
  ->thenTargetEvent("order-1", Order.Shipped)
28
30
  )
29
31
 
@@ -42,8 +44,8 @@ describe("Order auto-ship mapping (Placed → Ship)", () => {
42
44
  )
43
45
 
44
46
  test("Refund command does not fire the mapping (only Placed events do)", () =>
45
- givenSourceEvents([placedEvent, Order.Cancelled({productIds: ["prod-1"]})])
46
- ->andTargetEvents([("order-1", [placedEvent, Order.Cancelled({productIds: ["prod-1"]})])])
47
+ givenSourceEvents([placedEvent, Order.Cancelled({productIds: [prod1]})])
48
+ ->andTargetEvents([("order-1", [placedEvent, Order.Cancelled({productIds: [prod1]})])])
47
49
  ->whenSourceCmd("order-1", Refund({reason: "customer-changed-mind"}))
48
50
  ->thenNoTargetEvent
49
51
  )
Binary file
@@ -6,7 +6,7 @@
6
6
  @schema
7
7
  type state =
8
8
  | NotCreated
9
- | Placed({customerId: string, productIds: array<string>})
9
+ | Placed({customerId: CustomerId.t, productIds: array<CatalogSpec.ProductId.t>})
10
10
  | Shipped
11
11
  | Cancelled
12
12
  | Refunded
@@ -10,6 +10,9 @@ module Source = {
10
10
  let execute = async (orderId, _meta, event, _queryEngine) =>
11
11
  switch event {
12
12
  | Order.Placed({customerId}) =>
13
- await EmailService.sendOrderConfirmation(~email=customerId, ~orderId=orderId->Order.Id.toString)
13
+ await EmailService.sendOrderConfirmation(
14
+ ~email=customerId->CustomerId.toString,
15
+ ~orderId=orderId->Order.Id.toString,
16
+ )
14
17
  | _ => ()
15
18
  }
@@ -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
  })
Binary file
@@ -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"}))
Binary file
Binary file
@@ -6,6 +6,7 @@ CatalogProduct
6
6
  CatalogProduct_Behavior
7
7
  CatalogProduct_GWT
8
8
  Customer
9
+ CustomerId
9
10
  Customer_Behavior
10
11
  Customer_GWT
11
12
  Customers
@@ -15,6 +16,7 @@ EmailService
15
16
  EmailService_Mock
16
17
  LifecycleModel
17
18
  Order
19
+ OrderId
18
20
  OrderMappings_GWT
19
21
  OrderNotifications
20
22
  Order_Behavior
Binary file
Binary file
Binary file
@@ -3,6 +3,8 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ module Id = OrderId
7
+
6
8
  @schema
7
9
  type lifecycle =
8
10
  | Placed
@@ -12,8 +14,8 @@ type lifecycle =
12
14
 
13
15
  @schema
14
16
  type state = {
15
- customerId: string,
16
- productIds: array<string>,
17
+ customerId: CustomerId.t,
18
+ productIds: array<CatalogSpec.ProductId.t>,
17
19
  // No annotation: the field name is the declaration. `@lifecycle` exists for
18
20
  // records whose lifecycle field is honestly called something else.
19
21
  lifecycle: lifecycle,
@@ -10,16 +10,31 @@ let mapIncomingCommand = (_id, _command, _meta) => []
10
10
  let mapOutgoingEvent = Some(
11
11
  (_id, event, _meta, _queryEngine) =>
12
12
  switch event {
13
+ // The published contract carries plain strings: a consumer outside this
14
+ // plugin has no OrderId or CustomerId type to hold them in.
13
15
  | Order.Placed({customerId, productIds}) =>
14
- productIds->Array.map(productId => PublishEvent(
15
- productId,
16
- OrderingSpec.Orders_ExtensionPoint.ItemOrdered({productId, orderId: _id, customerId}),
17
- ))
16
+ productIds->Array.map(productId => {
17
+ let productId = productId->CatalogSpec.ProductId.toString
18
+ PublishEvent(
19
+ productId,
20
+ OrderingSpec.Orders_ExtensionPoint.ItemOrdered({
21
+ productId,
22
+ orderId: _id,
23
+ customerId: customerId->CustomerId.toString,
24
+ }),
25
+ )
26
+ })
18
27
  | Order.Cancelled({productIds}) =>
19
- productIds->Array.map(productId => PublishEvent(
20
- productId,
21
- OrderingSpec.Orders_ExtensionPoint.ItemOrderCancelled({productId, orderId: _id}),
22
- ))
28
+ productIds->Array.map(productId => {
29
+ let productId = productId->CatalogSpec.ProductId.toString
30
+ PublishEvent(
31
+ productId,
32
+ OrderingSpec.Orders_ExtensionPoint.ItemOrderCancelled({
33
+ productId,
34
+ orderId: _id,
35
+ }),
36
+ )
37
+ })
23
38
  | _ => []
24
39
  },
25
40
  )
@@ -2,10 +2,14 @@
2
2
  // into one public per-product event each (one-to-many fan-out).
3
3
  @@reventless.gwt
4
4
 
5
+ let c1 = CustomerId.make("c1")
6
+ let p1 = CatalogSpec.ProductId.make("p1")
7
+ let p2 = CatalogSpec.ProductId.make("p2")
8
+
5
9
  describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
6
10
  test("Placed fans out to one ItemOrdered per product", () =>
7
11
  whenDelegateEvent(
8
- Delegate.Placed({customerId: "c1", productIds: ["p1", "p2"]}),
12
+ Delegate.Placed({customerId: c1, productIds: [p1, p2]}),
9
13
  )->thenPublishesEvents([
10
14
  ("p1", ExtensionPoint.ItemOrdered({productId: "p1", orderId: "gwt-id", customerId: "c1"})),
11
15
  ("p2", ExtensionPoint.ItemOrdered({productId: "p2", orderId: "gwt-id", customerId: "c1"})),
@@ -13,7 +17,7 @@ describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
13
17
  )
14
18
 
15
19
  test("Cancelled fans out to one ItemOrderCancelled per product", () =>
16
- whenDelegateEvent(Delegate.Cancelled({productIds: ["p1", "p2"]}))->thenPublishesEvents([
20
+ whenDelegateEvent(Delegate.Cancelled({productIds: [p1, p2]}))->thenPublishesEvents([
17
21
  ("p1", ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "gwt-id"})),
18
22
  ("p2", ExtensionPoint.ItemOrderCancelled({productId: "p2", orderId: "gwt-id"})),
19
23
  ])
Binary file
@@ -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
  )
Binary file
Binary file
Binary file