@reventlessdev/online-shop-dcb-ordering 1.0.0-alpha.246 → 1.0.0-alpha.248

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 (446) hide show
  1. package/CHANGELOG.md +24 -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/StateChange/SyncCatalogProduct-OrderingPlugin.cmi +0 -0
  8. package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct-OrderingPlugin.cmt +0 -0
  9. package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct.ast +0 -0
  10. package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct.res +4 -4
  11. package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct.res.mjs +5 -4
  12. package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  13. package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  14. package/lib/bs/src/CatalogProduct/StateView/AvailableProducts-OrderingPlugin.cmi +0 -0
  15. package/lib/bs/src/CatalogProduct/StateView/AvailableProducts-OrderingPlugin.cmt +0 -0
  16. package/lib/bs/src/CatalogProduct/StateView/AvailableProducts.ast +0 -0
  17. package/lib/bs/src/CatalogProduct/StateView/AvailableProducts.res +6 -3
  18. package/lib/bs/src/CatalogProduct/StateView/AvailableProducts.res.mjs +7 -3
  19. package/lib/bs/src/CatalogProduct/StateView/AvailableProducts_Projection-OrderingPlugin.cmi +0 -0
  20. package/lib/bs/src/CatalogProduct/StateView/AvailableProducts_Projection-OrderingPlugin.cmt +0 -0
  21. package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmi +0 -0
  22. package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmj +0 -0
  23. package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmt +0 -0
  24. package/lib/bs/src/Customer/CustomerId.ast +0 -0
  25. package/lib/bs/src/Customer/CustomerId.res +4 -0
  26. package/lib/bs/src/Customer/CustomerId.res.mjs +29 -0
  27. package/lib/bs/src/Customer/StateChange/ChangeAddress-OrderingPlugin.cmi +0 -0
  28. package/lib/bs/src/Customer/StateChange/ChangeAddress-OrderingPlugin.cmt +0 -0
  29. package/lib/bs/src/Customer/StateChange/ChangeAddress.ast +0 -0
  30. package/lib/bs/src/Customer/StateChange/ChangeAddress.res +2 -2
  31. package/lib/bs/src/Customer/StateChange/ChangeAddress.res.mjs +3 -2
  32. package/lib/bs/src/Customer/StateChange/ChangeAddress_Behavior-OrderingPlugin.cmi +0 -0
  33. package/lib/bs/src/Customer/StateChange/ChangeAddress_Behavior-OrderingPlugin.cmt +0 -0
  34. package/lib/bs/src/Customer/StateChange/ChangeEmail-OrderingPlugin.cmi +0 -0
  35. package/lib/bs/src/Customer/StateChange/ChangeEmail-OrderingPlugin.cmt +0 -0
  36. package/lib/bs/src/Customer/StateChange/ChangeEmail.ast +0 -0
  37. package/lib/bs/src/Customer/StateChange/ChangeEmail.res +2 -2
  38. package/lib/bs/src/Customer/StateChange/ChangeEmail.res.mjs +3 -2
  39. package/lib/bs/src/Customer/StateChange/ChangeEmail_Behavior-OrderingPlugin.cmi +0 -0
  40. package/lib/bs/src/Customer/StateChange/ChangeEmail_Behavior-OrderingPlugin.cmt +0 -0
  41. package/lib/bs/src/Customer/StateChange/DeactivateCustomer-OrderingPlugin.cmi +0 -0
  42. package/lib/bs/src/Customer/StateChange/DeactivateCustomer-OrderingPlugin.cmt +0 -0
  43. package/lib/bs/src/Customer/StateChange/DeactivateCustomer.ast +0 -0
  44. package/lib/bs/src/Customer/StateChange/DeactivateCustomer.res +2 -2
  45. package/lib/bs/src/Customer/StateChange/DeactivateCustomer.res.mjs +3 -2
  46. package/lib/bs/src/Customer/StateChange/DeactivateCustomer_Behavior-OrderingPlugin.cmi +0 -0
  47. package/lib/bs/src/Customer/StateChange/DeactivateCustomer_Behavior-OrderingPlugin.cmt +0 -0
  48. package/lib/bs/src/Customer/StateChange/RegisterCustomer-OrderingPlugin.cmi +0 -0
  49. package/lib/bs/src/Customer/StateChange/RegisterCustomer-OrderingPlugin.cmt +0 -0
  50. package/lib/bs/src/Customer/StateChange/RegisterCustomer.ast +0 -0
  51. package/lib/bs/src/Customer/StateChange/RegisterCustomer.res +2 -2
  52. package/lib/bs/src/Customer/StateChange/RegisterCustomer.res.mjs +3 -2
  53. package/lib/bs/src/Customer/StateChange/RegisterCustomer_Behavior-OrderingPlugin.cmi +0 -0
  54. package/lib/bs/src/Customer/StateChange/RegisterCustomer_Behavior-OrderingPlugin.cmt +0 -0
  55. package/lib/bs/src/Customer/StateView/Customers-OrderingPlugin.cmi +0 -0
  56. package/lib/bs/src/Customer/StateView/Customers-OrderingPlugin.cmt +0 -0
  57. package/lib/bs/src/Customer/StateView/Customers.ast +0 -0
  58. package/lib/bs/src/Customer/StateView/Customers.res +8 -5
  59. package/lib/bs/src/Customer/StateView/Customers.res.mjs +9 -5
  60. package/lib/bs/src/Customer/StateView/Customers_Projection-OrderingPlugin.cmi +0 -0
  61. package/lib/bs/src/Customer/StateView/Customers_Projection-OrderingPlugin.cmt +0 -0
  62. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
  63. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
  64. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  65. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  66. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.ast +0 -0
  67. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res +29 -10
  68. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +32 -23
  69. package/lib/bs/src/LifecycleModel-OrderingPlugin.cmi +0 -0
  70. package/lib/bs/src/LifecycleModel-OrderingPlugin.cmt +0 -0
  71. package/lib/bs/src/Order/Automation/AutoShipOrder-OrderingPlugin.cmi +0 -0
  72. package/lib/bs/src/Order/Automation/AutoShipOrder-OrderingPlugin.cmt +0 -0
  73. package/lib/bs/src/Order/Automation/AutoShipOrder.ast +0 -0
  74. package/lib/bs/src/Order/Automation/AutoShipOrder.res +2 -2
  75. package/lib/bs/src/Order/Automation/AutoShipOrder.res.mjs +3 -2
  76. package/lib/bs/src/Order/Automation/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
  77. package/lib/bs/src/Order/Automation/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
  78. package/lib/bs/src/Order/Automation/AutoShipOrder_Automation.ast +0 -0
  79. package/lib/bs/src/Order/Automation/AutoShipOrder_Automation.res +8 -5
  80. package/lib/bs/src/Order/Automation/AutoShipOrder_Automation.res.mjs +7 -6
  81. package/lib/bs/src/Order/OrderId-OrderingPlugin.cmi +0 -0
  82. package/lib/bs/src/Order/OrderId-OrderingPlugin.cmj +0 -0
  83. package/lib/bs/src/Order/OrderId-OrderingPlugin.cmt +0 -0
  84. package/lib/bs/src/Order/OrderId.ast +0 -0
  85. package/lib/bs/src/Order/OrderId.res +4 -0
  86. package/lib/bs/src/Order/OrderId.res.mjs +29 -0
  87. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation-OrderingPlugin.cmi +0 -0
  88. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation-OrderingPlugin.cmt +0 -0
  89. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation.ast +0 -0
  90. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation.res +2 -2
  91. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation.res.mjs +6 -4
  92. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
  93. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
  94. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.ast +0 -0
  95. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res +5 -2
  96. package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res.mjs +4 -2
  97. package/lib/bs/src/Order/StateChange/CancelOrder-OrderingPlugin.cmi +0 -0
  98. package/lib/bs/src/Order/StateChange/CancelOrder-OrderingPlugin.cmt +0 -0
  99. package/lib/bs/src/Order/StateChange/CancelOrder.ast +0 -0
  100. package/lib/bs/src/Order/StateChange/CancelOrder.res +3 -3
  101. package/lib/bs/src/Order/StateChange/CancelOrder.res.mjs +6 -4
  102. package/lib/bs/src/Order/StateChange/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
  103. package/lib/bs/src/Order/StateChange/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
  104. package/lib/bs/src/Order/StateChange/CancelOrder_Behavior.ast +0 -0
  105. package/lib/bs/src/Order/StateChange/CancelOrder_Behavior.res +6 -1
  106. package/lib/bs/src/Order/StateChange/PlaceOrder-OrderingPlugin.cmi +0 -0
  107. package/lib/bs/src/Order/StateChange/PlaceOrder-OrderingPlugin.cmt +0 -0
  108. package/lib/bs/src/Order/StateChange/PlaceOrder.ast +0 -0
  109. package/lib/bs/src/Order/StateChange/PlaceOrder.res +12 -7
  110. package/lib/bs/src/Order/StateChange/PlaceOrder.res.mjs +12 -9
  111. package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
  112. package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
  113. package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior.ast +0 -0
  114. package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior.res +1 -1
  115. package/lib/bs/src/Order/StateChange/ShipOrder-OrderingPlugin.cmi +0 -0
  116. package/lib/bs/src/Order/StateChange/ShipOrder-OrderingPlugin.cmt +0 -0
  117. package/lib/bs/src/Order/StateChange/ShipOrder.ast +0 -0
  118. package/lib/bs/src/Order/StateChange/ShipOrder.res +2 -2
  119. package/lib/bs/src/Order/StateChange/ShipOrder.res.mjs +3 -2
  120. package/lib/bs/src/Order/StateChange/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
  121. package/lib/bs/src/Order/StateChange/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
  122. package/lib/bs/src/Order/StateView/Orders-OrderingPlugin.cmi +0 -0
  123. package/lib/bs/src/Order/StateView/Orders-OrderingPlugin.cmt +0 -0
  124. package/lib/bs/src/Order/StateView/Orders.ast +0 -0
  125. package/lib/bs/src/Order/StateView/Orders.res +13 -6
  126. package/lib/bs/src/Order/StateView/Orders.res.mjs +14 -8
  127. package/lib/bs/src/Order/StateView/Orders_Projection-OrderingPlugin.cmi +0 -0
  128. package/lib/bs/src/Order/StateView/Orders_Projection-OrderingPlugin.cmt +0 -0
  129. package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
  130. package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
  131. package/lib/bs/src/Plugin.res.mjs +6 -8
  132. package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  133. package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  134. package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.ast +0 -0
  135. package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res +8 -6
  136. package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +10 -6
  137. package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  138. package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  139. package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.ast +0 -0
  140. package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.res +7 -5
  141. package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.res.mjs +10 -5
  142. package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
  143. package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
  144. package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.ast +0 -0
  145. package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.res +7 -5
  146. package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.res.mjs +9 -5
  147. package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
  148. package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
  149. package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.ast +0 -0
  150. package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.res +7 -5
  151. package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.res.mjs +9 -5
  152. package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
  153. package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
  154. package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.ast +0 -0
  155. package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.res +6 -4
  156. package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.res.mjs +8 -4
  157. package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
  158. package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
  159. package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.ast +0 -0
  160. package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.res +7 -3
  161. package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.res.mjs +7 -3
  162. package/lib/bs/tests/Customer/StateView/Customers_GWT-OrderingPlugin.cmi +0 -0
  163. package/lib/bs/tests/Customer/StateView/Customers_GWT-OrderingPlugin.cmt +0 -0
  164. package/lib/bs/tests/Customer/StateView/Customers_GWT.ast +0 -0
  165. package/lib/bs/tests/Customer/StateView/Customers_GWT.res +21 -11
  166. package/lib/bs/tests/Customer/StateView/Customers_GWT.res.mjs +16 -11
  167. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  168. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  169. package/lib/bs/tests/Extension/Products_Extension_GWT.ast +0 -0
  170. package/lib/bs/tests/Extension/Products_Extension_GWT.res +8 -4
  171. package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +8 -4
  172. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  173. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  174. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.ast +0 -0
  175. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +10 -2
  176. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +19 -7
  177. package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
  178. package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
  179. package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.ast +0 -0
  180. package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.res +9 -7
  181. package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.res.mjs +11 -7
  182. package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
  183. package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
  184. package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.ast +0 -0
  185. package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res +7 -4
  186. package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res.mjs +16 -8
  187. package/lib/bs/tests/Order/StateChange/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
  188. package/lib/bs/tests/Order/StateChange/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
  189. package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.ast +0 -0
  190. package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.res +11 -8
  191. package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.res.mjs +19 -11
  192. package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
  193. package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
  194. package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.ast +0 -0
  195. package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.res +19 -13
  196. package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +42 -30
  197. package/lib/bs/tests/Order/StateChange/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
  198. package/lib/bs/tests/Order/StateChange/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
  199. package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.ast +0 -0
  200. package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.res +7 -5
  201. package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.res.mjs +9 -5
  202. package/lib/bs/tests/Order/StateView/Orders_GWT-OrderingPlugin.cmi +0 -0
  203. package/lib/bs/tests/Order/StateView/Orders_GWT-OrderingPlugin.cmt +0 -0
  204. package/lib/bs/tests/Order/StateView/Orders_GWT.ast +0 -0
  205. package/lib/bs/tests/Order/StateView/Orders_GWT.res +19 -8
  206. package/lib/bs/tests/Order/StateView/Orders_GWT.res.mjs +35 -22
  207. package/lib/ocaml/.compiler.log +2 -2
  208. package/lib/ocaml/AutoShipOrder-OrderingPlugin.cmi +0 -0
  209. package/lib/ocaml/AutoShipOrder-OrderingPlugin.cmt +0 -0
  210. package/lib/ocaml/AutoShipOrder.ast +0 -0
  211. package/lib/ocaml/AutoShipOrder.res +2 -2
  212. package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
  213. package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
  214. package/lib/ocaml/AutoShipOrder_Automation.ast +0 -0
  215. package/lib/ocaml/AutoShipOrder_Automation.res +8 -5
  216. package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
  217. package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
  218. package/lib/ocaml/AutoShipOrder_GWT.ast +0 -0
  219. package/lib/ocaml/AutoShipOrder_GWT.res +9 -7
  220. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
  221. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
  222. package/lib/ocaml/AvailableProducts.ast +0 -0
  223. package/lib/ocaml/AvailableProducts.res +6 -3
  224. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  225. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  226. package/lib/ocaml/AvailableProducts_GWT.ast +0 -0
  227. package/lib/ocaml/AvailableProducts_GWT.res +7 -5
  228. package/lib/ocaml/AvailableProducts_Projection-OrderingPlugin.cmi +0 -0
  229. package/lib/ocaml/AvailableProducts_Projection-OrderingPlugin.cmt +0 -0
  230. package/lib/ocaml/CancelOrder-OrderingPlugin.cmi +0 -0
  231. package/lib/ocaml/CancelOrder-OrderingPlugin.cmt +0 -0
  232. package/lib/ocaml/CancelOrder.ast +0 -0
  233. package/lib/ocaml/CancelOrder.res +3 -3
  234. package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
  235. package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
  236. package/lib/ocaml/CancelOrder_Behavior.ast +0 -0
  237. package/lib/ocaml/CancelOrder_Behavior.res +6 -1
  238. package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
  239. package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
  240. package/lib/ocaml/CancelOrder_GWT.ast +0 -0
  241. package/lib/ocaml/CancelOrder_GWT.res +11 -8
  242. package/lib/ocaml/ChangeAddress-OrderingPlugin.cmi +0 -0
  243. package/lib/ocaml/ChangeAddress-OrderingPlugin.cmt +0 -0
  244. package/lib/ocaml/ChangeAddress.ast +0 -0
  245. package/lib/ocaml/ChangeAddress.res +2 -2
  246. package/lib/ocaml/ChangeAddress_Behavior-OrderingPlugin.cmi +0 -0
  247. package/lib/ocaml/ChangeAddress_Behavior-OrderingPlugin.cmt +0 -0
  248. package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
  249. package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
  250. package/lib/ocaml/ChangeAddress_GWT.ast +0 -0
  251. package/lib/ocaml/ChangeAddress_GWT.res +7 -5
  252. package/lib/ocaml/ChangeEmail-OrderingPlugin.cmi +0 -0
  253. package/lib/ocaml/ChangeEmail-OrderingPlugin.cmt +0 -0
  254. package/lib/ocaml/ChangeEmail.ast +0 -0
  255. package/lib/ocaml/ChangeEmail.res +2 -2
  256. package/lib/ocaml/ChangeEmail_Behavior-OrderingPlugin.cmi +0 -0
  257. package/lib/ocaml/ChangeEmail_Behavior-OrderingPlugin.cmt +0 -0
  258. package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
  259. package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
  260. package/lib/ocaml/ChangeEmail_GWT.ast +0 -0
  261. package/lib/ocaml/ChangeEmail_GWT.res +7 -5
  262. package/lib/ocaml/CustomerId-OrderingPlugin.cmi +0 -0
  263. package/lib/ocaml/CustomerId-OrderingPlugin.cmj +0 -0
  264. package/lib/ocaml/CustomerId-OrderingPlugin.cmt +0 -0
  265. package/lib/ocaml/CustomerId.ast +0 -0
  266. package/lib/ocaml/CustomerId.res +4 -0
  267. package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
  268. package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
  269. package/lib/ocaml/Customers.ast +0 -0
  270. package/lib/ocaml/Customers.res +8 -5
  271. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
  272. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
  273. package/lib/ocaml/Customers_GWT.ast +0 -0
  274. package/lib/ocaml/Customers_GWT.res +21 -11
  275. package/lib/ocaml/Customers_Projection-OrderingPlugin.cmi +0 -0
  276. package/lib/ocaml/Customers_Projection-OrderingPlugin.cmt +0 -0
  277. package/lib/ocaml/DeactivateCustomer-OrderingPlugin.cmi +0 -0
  278. package/lib/ocaml/DeactivateCustomer-OrderingPlugin.cmt +0 -0
  279. package/lib/ocaml/DeactivateCustomer.ast +0 -0
  280. package/lib/ocaml/DeactivateCustomer.res +2 -2
  281. package/lib/ocaml/DeactivateCustomer_Behavior-OrderingPlugin.cmi +0 -0
  282. package/lib/ocaml/DeactivateCustomer_Behavior-OrderingPlugin.cmt +0 -0
  283. package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
  284. package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
  285. package/lib/ocaml/DeactivateCustomer_GWT.ast +0 -0
  286. package/lib/ocaml/DeactivateCustomer_GWT.res +6 -4
  287. package/lib/ocaml/LifecycleModel-OrderingPlugin.cmi +0 -0
  288. package/lib/ocaml/LifecycleModel-OrderingPlugin.cmt +0 -0
  289. package/lib/ocaml/OrderId-OrderingPlugin.cmi +0 -0
  290. package/lib/ocaml/OrderId-OrderingPlugin.cmj +0 -0
  291. package/lib/ocaml/OrderId-OrderingPlugin.cmt +0 -0
  292. package/lib/ocaml/OrderId.ast +0 -0
  293. package/lib/ocaml/OrderId.res +4 -0
  294. package/lib/ocaml/OrderingPlugin.cmi +0 -0
  295. package/lib/ocaml/OrderingPlugin.cmt +0 -0
  296. package/lib/ocaml/OrderingPlugin.mlmap +2 -0
  297. package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
  298. package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
  299. package/lib/ocaml/Orders.ast +0 -0
  300. package/lib/ocaml/Orders.res +13 -6
  301. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  302. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  303. package/lib/ocaml/Orders_ExtensionPointMapping.ast +0 -0
  304. package/lib/ocaml/Orders_ExtensionPointMapping.res +29 -10
  305. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  306. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  307. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.ast +0 -0
  308. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.res +10 -2
  309. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
  310. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
  311. package/lib/ocaml/Orders_GWT.ast +0 -0
  312. package/lib/ocaml/Orders_GWT.res +19 -8
  313. package/lib/ocaml/Orders_Projection-OrderingPlugin.cmi +0 -0
  314. package/lib/ocaml/Orders_Projection-OrderingPlugin.cmt +0 -0
  315. package/lib/ocaml/PlaceOrder-OrderingPlugin.cmi +0 -0
  316. package/lib/ocaml/PlaceOrder-OrderingPlugin.cmt +0 -0
  317. package/lib/ocaml/PlaceOrder.ast +0 -0
  318. package/lib/ocaml/PlaceOrder.res +12 -7
  319. package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
  320. package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
  321. package/lib/ocaml/PlaceOrder_Behavior.ast +0 -0
  322. package/lib/ocaml/PlaceOrder_Behavior.res +1 -1
  323. package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
  324. package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
  325. package/lib/ocaml/PlaceOrder_GWT.ast +0 -0
  326. package/lib/ocaml/PlaceOrder_GWT.res +19 -13
  327. package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
  328. package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
  329. package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
  330. package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
  331. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  332. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  333. package/lib/ocaml/Products_Extension_GWT.ast +0 -0
  334. package/lib/ocaml/Products_Extension_GWT.res +8 -4
  335. package/lib/ocaml/RegisterCustomer-OrderingPlugin.cmi +0 -0
  336. package/lib/ocaml/RegisterCustomer-OrderingPlugin.cmt +0 -0
  337. package/lib/ocaml/RegisterCustomer.ast +0 -0
  338. package/lib/ocaml/RegisterCustomer.res +2 -2
  339. package/lib/ocaml/RegisterCustomer_Behavior-OrderingPlugin.cmi +0 -0
  340. package/lib/ocaml/RegisterCustomer_Behavior-OrderingPlugin.cmt +0 -0
  341. package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
  342. package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
  343. package/lib/ocaml/RegisterCustomer_GWT.ast +0 -0
  344. package/lib/ocaml/RegisterCustomer_GWT.res +7 -3
  345. package/lib/ocaml/SendOrderConfirmation-OrderingPlugin.cmi +0 -0
  346. package/lib/ocaml/SendOrderConfirmation-OrderingPlugin.cmt +0 -0
  347. package/lib/ocaml/SendOrderConfirmation.ast +0 -0
  348. package/lib/ocaml/SendOrderConfirmation.res +2 -2
  349. package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
  350. package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
  351. package/lib/ocaml/SendOrderConfirmation_GWT.ast +0 -0
  352. package/lib/ocaml/SendOrderConfirmation_GWT.res +7 -4
  353. package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
  354. package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
  355. package/lib/ocaml/SendOrderConfirmation_Translation.ast +0 -0
  356. package/lib/ocaml/SendOrderConfirmation_Translation.res +5 -2
  357. package/lib/ocaml/ShipOrder-OrderingPlugin.cmi +0 -0
  358. package/lib/ocaml/ShipOrder-OrderingPlugin.cmt +0 -0
  359. package/lib/ocaml/ShipOrder.ast +0 -0
  360. package/lib/ocaml/ShipOrder.res +2 -2
  361. package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
  362. package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
  363. package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
  364. package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
  365. package/lib/ocaml/ShipOrder_GWT.ast +0 -0
  366. package/lib/ocaml/ShipOrder_GWT.res +7 -5
  367. package/lib/ocaml/SyncCatalogProduct-OrderingPlugin.cmi +0 -0
  368. package/lib/ocaml/SyncCatalogProduct-OrderingPlugin.cmt +0 -0
  369. package/lib/ocaml/SyncCatalogProduct.ast +0 -0
  370. package/lib/ocaml/SyncCatalogProduct.res +4 -4
  371. package/lib/ocaml/SyncCatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  372. package/lib/ocaml/SyncCatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  373. package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  374. package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  375. package/lib/ocaml/SyncCatalogProduct_GWT.ast +0 -0
  376. package/lib/ocaml/SyncCatalogProduct_GWT.res +8 -6
  377. package/package.json +8 -8
  378. package/src/CatalogProduct/StateChange/SyncCatalogProduct.res +4 -4
  379. package/src/CatalogProduct/StateChange/SyncCatalogProduct.res.mjs +5 -4
  380. package/src/CatalogProduct/StateView/AvailableProducts.res +6 -3
  381. package/src/CatalogProduct/StateView/AvailableProducts.res.mjs +7 -3
  382. package/src/Customer/CustomerId.res +4 -0
  383. package/src/Customer/CustomerId.res.mjs +29 -0
  384. package/src/Customer/StateChange/ChangeAddress.res +2 -2
  385. package/src/Customer/StateChange/ChangeAddress.res.mjs +3 -2
  386. package/src/Customer/StateChange/ChangeEmail.res +2 -2
  387. package/src/Customer/StateChange/ChangeEmail.res.mjs +3 -2
  388. package/src/Customer/StateChange/DeactivateCustomer.res +2 -2
  389. package/src/Customer/StateChange/DeactivateCustomer.res.mjs +3 -2
  390. package/src/Customer/StateChange/RegisterCustomer.res +2 -2
  391. package/src/Customer/StateChange/RegisterCustomer.res.mjs +3 -2
  392. package/src/Customer/StateView/Customers.res +8 -5
  393. package/src/Customer/StateView/Customers.res.mjs +9 -5
  394. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +29 -10
  395. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +32 -23
  396. package/src/Order/Automation/AutoShipOrder.res +2 -2
  397. package/src/Order/Automation/AutoShipOrder.res.mjs +3 -2
  398. package/src/Order/Automation/AutoShipOrder_Automation.res +8 -5
  399. package/src/Order/Automation/AutoShipOrder_Automation.res.mjs +7 -6
  400. package/src/Order/OrderId.res +4 -0
  401. package/src/Order/OrderId.res.mjs +29 -0
  402. package/src/Order/OutboundTranslation/SendOrderConfirmation.res +2 -2
  403. package/src/Order/OutboundTranslation/SendOrderConfirmation.res.mjs +6 -4
  404. package/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res +5 -2
  405. package/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res.mjs +4 -2
  406. package/src/Order/StateChange/CancelOrder.res +3 -3
  407. package/src/Order/StateChange/CancelOrder.res.mjs +6 -4
  408. package/src/Order/StateChange/CancelOrder_Behavior.res +6 -1
  409. package/src/Order/StateChange/PlaceOrder.res +12 -7
  410. package/src/Order/StateChange/PlaceOrder.res.mjs +12 -9
  411. package/src/Order/StateChange/PlaceOrder_Behavior.res +1 -1
  412. package/src/Order/StateChange/ShipOrder.res +2 -2
  413. package/src/Order/StateChange/ShipOrder.res.mjs +3 -2
  414. package/src/Order/StateView/Orders.res +13 -6
  415. package/src/Order/StateView/Orders.res.mjs +14 -8
  416. package/src/Plugin.res.mjs +6 -8
  417. package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res +8 -6
  418. package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +10 -6
  419. package/tests/CatalogProduct/StateView/AvailableProducts_GWT.res +7 -5
  420. package/tests/CatalogProduct/StateView/AvailableProducts_GWT.res.mjs +10 -5
  421. package/tests/Customer/StateChange/ChangeAddress_GWT.res +7 -5
  422. package/tests/Customer/StateChange/ChangeAddress_GWT.res.mjs +9 -5
  423. package/tests/Customer/StateChange/ChangeEmail_GWT.res +7 -5
  424. package/tests/Customer/StateChange/ChangeEmail_GWT.res.mjs +9 -5
  425. package/tests/Customer/StateChange/DeactivateCustomer_GWT.res +6 -4
  426. package/tests/Customer/StateChange/DeactivateCustomer_GWT.res.mjs +8 -4
  427. package/tests/Customer/StateChange/RegisterCustomer_GWT.res +7 -3
  428. package/tests/Customer/StateChange/RegisterCustomer_GWT.res.mjs +7 -3
  429. package/tests/Customer/StateView/Customers_GWT.res +21 -11
  430. package/tests/Customer/StateView/Customers_GWT.res.mjs +16 -11
  431. package/tests/Extension/Products_Extension_GWT.res +8 -4
  432. package/tests/Extension/Products_Extension_GWT.res.mjs +8 -4
  433. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +10 -2
  434. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +19 -7
  435. package/tests/Order/Automation/AutoShipOrder_GWT.res +9 -7
  436. package/tests/Order/Automation/AutoShipOrder_GWT.res.mjs +11 -7
  437. package/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res +7 -4
  438. package/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res.mjs +16 -8
  439. package/tests/Order/StateChange/CancelOrder_GWT.res +11 -8
  440. package/tests/Order/StateChange/CancelOrder_GWT.res.mjs +19 -11
  441. package/tests/Order/StateChange/PlaceOrder_GWT.res +19 -13
  442. package/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +42 -30
  443. package/tests/Order/StateChange/ShipOrder_GWT.res +7 -5
  444. package/tests/Order/StateChange/ShipOrder_GWT.res.mjs +9 -5
  445. package/tests/Order/StateView/Orders_GWT.res +19 -8
  446. package/tests/Order/StateView/Orders_GWT.res.mjs +35 -22
@@ -1,39 +1,49 @@
1
1
  @@reventless.gwt
2
2
 
3
+ let cid = CustomerId.make
4
+
3
5
  describe("Customers StateViewSlice", () => {
4
6
  test("CustomerRegistered creates a row", () =>
5
7
  givenEvents([])
6
- ->whenEvent(CustomerRegistered({customerId: "c1", email: "alice@x.y", address: "123 Main"}))
8
+ ->whenEvent(
9
+ CustomerRegistered({customerId: cid("c1"), email: "alice@x.y", address: "123 Main"}),
10
+ )
7
11
  ->thenStateWithId(
8
12
  "c1",
9
- {customerId: "c1", email: "alice@x.y", address: "123 Main", deactivated: false},
13
+ {customerId: cid("c1"), email: "alice@x.y", address: "123 Main", deactivated: false},
10
14
  )
11
15
  )
12
16
 
13
17
  test("EmailChanged updates the email", () =>
14
- givenEvents([CustomerRegistered({customerId: "c1", email: "alice@x.y", address: "123 Main"})])
15
- ->whenEvent(EmailChanged({customerId: "c1", email: "alice2@x.y"}))
18
+ givenEvents([
19
+ CustomerRegistered({customerId: cid("c1"), email: "alice@x.y", address: "123 Main"}),
20
+ ])
21
+ ->whenEvent(EmailChanged({customerId: cid("c1"), email: "alice2@x.y"}))
16
22
  ->thenStateWithId(
17
23
  "c1",
18
- {customerId: "c1", email: "alice2@x.y", address: "123 Main", deactivated: false},
24
+ {customerId: cid("c1"), email: "alice2@x.y", address: "123 Main", deactivated: false},
19
25
  )
20
26
  )
21
27
 
22
28
  test("AddressChanged updates the address", () =>
23
- givenEvents([CustomerRegistered({customerId: "c1", email: "alice@x.y", address: "123 Main"})])
24
- ->whenEvent(AddressChanged({customerId: "c1", address: "789 Pine"}))
29
+ givenEvents([
30
+ CustomerRegistered({customerId: cid("c1"), email: "alice@x.y", address: "123 Main"}),
31
+ ])
32
+ ->whenEvent(AddressChanged({customerId: cid("c1"), address: "789 Pine"}))
25
33
  ->thenStateWithId(
26
34
  "c1",
27
- {customerId: "c1", email: "alice@x.y", address: "789 Pine", deactivated: false},
35
+ {customerId: cid("c1"), email: "alice@x.y", address: "789 Pine", deactivated: false},
28
36
  )
29
37
  )
30
38
 
31
39
  test("CustomerDeactivated sets deactivated flag", () =>
32
- givenEvents([CustomerRegistered({customerId: "c1", email: "alice@x.y", address: "123 Main"})])
33
- ->whenEvent(CustomerDeactivated({customerId: "c1"}))
40
+ givenEvents([
41
+ CustomerRegistered({customerId: cid("c1"), email: "alice@x.y", address: "123 Main"}),
42
+ ])
43
+ ->whenEvent(CustomerDeactivated({customerId: cid("c1")}))
34
44
  ->thenStateWithId(
35
45
  "c1",
36
- {customerId: "c1", email: "alice@x.y", address: "123 Main", deactivated: true},
46
+ {customerId: cid("c1"), email: "alice@x.y", address: "123 Main", deactivated: true},
37
47
  )
38
48
  )
39
49
  })
Binary file
@@ -8,10 +8,10 @@ type consumedEvent =
8
8
  | CustomerDeactivated
9
9
 
10
10
  @schema
11
- type command = DeactivateCustomer({customerId: string})
11
+ type command = DeactivateCustomer({customerId: CustomerId.t})
12
12
 
13
13
  @schema
14
14
  type error = CustomerNotFound
15
15
 
16
16
  @schema
17
- type event = CustomerDeactivated({customerId: string})
17
+ type event = CustomerDeactivated({customerId: CustomerId.t})
@@ -1,21 +1,23 @@
1
1
  @@reventless.gwt
2
2
 
3
+ let cid = CustomerId.make
4
+
3
5
  describe("DeactivateCustomer StateChangeSlice", () => {
4
6
  test("non-existent customer returns CustomerNotFound", () =>
5
7
  givenEvents([])
6
- ->whenCmd(DeactivateCustomer({customerId: "c1"}))
8
+ ->whenCmd(DeactivateCustomer({customerId: cid("c1")}))
7
9
  ->thenError(CustomerNotFound)
8
10
  )
9
11
 
10
12
  test("existing customer produces CustomerDeactivated", () =>
11
13
  givenEvents([CustomerRegistered])
12
- ->whenCmd(DeactivateCustomer({customerId: "c1"}))
13
- ->thenEvent(CustomerDeactivated({customerId: "c1"}))
14
+ ->whenCmd(DeactivateCustomer({customerId: cid("c1")}))
15
+ ->thenEvent(CustomerDeactivated({customerId: cid("c1")}))
14
16
  )
15
17
 
16
18
  test("already deactivated customer produces no events (idempotent)", () =>
17
19
  givenEvents([CustomerRegistered, CustomerDeactivated])
18
- ->whenCmd(DeactivateCustomer({customerId: "c1"}))
20
+ ->whenCmd(DeactivateCustomer({customerId: cid("c1")}))
19
21
  ->thenNoEvent
20
22
  )
21
23
  })
Binary file
@@ -0,0 +1,4 @@
1
+ // An order's id: the partition its slices decide about, and the key of its rows.
2
+ include Reventless.Id.Make({
3
+ let key = "orderId"
4
+ })
Binary file
Binary file
@@ -14,6 +14,7 @@ ChangeAddress_GWT
14
14
  ChangeEmail
15
15
  ChangeEmail_Behavior
16
16
  ChangeEmail_GWT
17
+ CustomerId
17
18
  Customers
18
19
  Customers_GWT
19
20
  Customers_Projection
@@ -22,6 +23,7 @@ DeactivateCustomer_Behavior
22
23
  DeactivateCustomer_GWT
23
24
  EmailService
24
25
  LifecycleModel
26
+ OrderId
25
27
  Orders
26
28
  Orders_ExtensionPointMapping
27
29
  Orders_ExtensionPointMapping_GWT
Binary file
Binary file
Binary file
@@ -2,6 +2,9 @@
2
2
  // Projects order events from the shared ordering event log into an Orders read model.
3
3
  @@reventless.spec
4
4
 
5
+ // Rows are keyed by this identity.
6
+ module Key = OrderId
7
+
5
8
  @schema
6
9
  type lifecycle =
7
10
  | Placed
@@ -10,9 +13,9 @@ type lifecycle =
10
13
 
11
14
  @schema
12
15
  type state = {
13
- orderId: string,
14
- customerId: string,
15
- productIds: array<string>,
16
+ orderId: OrderId.t,
17
+ customerId: CustomerId.t,
18
+ productIds: array<CatalogSpec.ProductId.t>,
16
19
  // No annotation: the field name is the declaration. `@lifecycle` exists for
17
20
  // records whose lifecycle field is honestly called something else.
18
21
  lifecycle: lifecycle,
@@ -20,6 +23,10 @@ type state = {
20
23
 
21
24
  @schema
22
25
  type consumedEvent =
23
- | OrderPlaced({orderId: string, customerId: string, productIds: array<string>})
24
- | OrderShipped({orderId: string})
25
- | OrderCancelled({orderId: string})
26
+ | OrderPlaced({
27
+ orderId: OrderId.t,
28
+ customerId: CustomerId.t,
29
+ productIds: array<CatalogSpec.ProductId.t>,
30
+ })
31
+ | OrderShipped({orderId: OrderId.t})
32
+ | OrderCancelled({orderId: OrderId.t})
@@ -9,24 +9,43 @@ module Delegate = {
9
9
  let name = "OrderingDcbEventLog"
10
10
  @schema
11
11
  type event =
12
- | OrderPlaced({orderId: string, customerId: string, productIds: array<string>})
13
- | OrderCancelled({orderId: string, productIds: array<string>})
12
+ | OrderPlaced({
13
+ orderId: OrderId.t,
14
+ customerId: CustomerId.t,
15
+ productIds: array<CatalogSpec.ProductId.t>,
16
+ })
17
+ | OrderCancelled({orderId: OrderId.t, productIds: array<CatalogSpec.ProductId.t>})
14
18
  }
15
19
 
16
20
  let mapIncomingCommand = (_id, _command, _meta) => []
17
21
 
18
22
  let mapOutgoingEvent = Some(
19
23
  (_id, event, _meta, _queryEngine) =>
24
+ // The published contract carries plain strings: a consumer outside this
25
+ // plugin has no OrderId or CustomerId type to hold them in.
20
26
  switch event {
21
27
  | Delegate.OrderPlaced({orderId, customerId, productIds}) =>
22
- productIds->Array.map(productId => PublishEvent(
23
- productId,
24
- OrderingSpec.Orders_ExtensionPoint.ItemOrdered({productId, orderId, customerId}),
25
- ))
28
+ productIds->Array.map(productId => {
29
+ let productId = productId->CatalogSpec.ProductId.toString
30
+ PublishEvent(
31
+ productId,
32
+ OrderingSpec.Orders_ExtensionPoint.ItemOrdered({
33
+ productId,
34
+ orderId: orderId->OrderId.toString,
35
+ customerId: customerId->CustomerId.toString,
36
+ }),
37
+ )
38
+ })
26
39
  | Delegate.OrderCancelled({orderId, productIds}) =>
27
- productIds->Array.map(productId => PublishEvent(
28
- productId,
29
- OrderingSpec.Orders_ExtensionPoint.ItemOrderCancelled({productId, orderId}),
30
- ))
40
+ productIds->Array.map(productId => {
41
+ let productId = productId->CatalogSpec.ProductId.toString
42
+ PublishEvent(
43
+ productId,
44
+ OrderingSpec.Orders_ExtensionPoint.ItemOrderCancelled({
45
+ productId,
46
+ orderId: orderId->OrderId.toString,
47
+ }),
48
+ )
49
+ })
31
50
  },
32
51
  )
@@ -2,10 +2,18 @@
2
2
  // into one public per-product event each (one-to-many fan-out).
3
3
  @@reventless.gwt
4
4
 
5
+ let cid = CustomerId.make
6
+ let oid = OrderId.make
7
+ let pid = CatalogSpec.ProductId.make
8
+
5
9
  describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
6
10
  test("OrderPlaced fans out to one ItemOrdered per product", () =>
7
11
  whenDelegateEvent(
8
- Delegate.OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1", "p2"]}),
12
+ Delegate.OrderPlaced({
13
+ orderId: oid("o1"),
14
+ customerId: cid("c1"),
15
+ productIds: [pid("p1"), pid("p2")],
16
+ }),
9
17
  )->thenPublishesEvents([
10
18
  ("p1", ExtensionPoint.ItemOrdered({productId: "p1", orderId: "o1", customerId: "c1"})),
11
19
  ("p2", ExtensionPoint.ItemOrdered({productId: "p2", orderId: "o1", customerId: "c1"})),
@@ -14,7 +22,7 @@ describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
14
22
 
15
23
  test("OrderCancelled fans out to one ItemOrderCancelled per product", () =>
16
24
  whenDelegateEvent(
17
- Delegate.OrderCancelled({orderId: "o1", productIds: ["p1", "p2"]}),
25
+ Delegate.OrderCancelled({orderId: oid("o1"), productIds: [pid("p1"), pid("p2")]}),
18
26
  )->thenPublishesEvents([
19
27
  ("p1", ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "o1"})),
20
28
  ("p2", ExtensionPoint.ItemOrderCancelled({productId: "p2", orderId: "o1"})),
Binary file
@@ -1,30 +1,41 @@
1
1
  @@reventless.gwt
2
2
 
3
+ let cid = CustomerId.make
4
+ let oid = OrderId.make
5
+ let pid = CatalogSpec.ProductId.make
6
+
3
7
  describe("Orders StateViewSlice", () => {
4
8
  test("OrderPlaced creates a row with status Placed", () =>
5
9
  givenEvents([])
6
- ->whenEvent(OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1", "p2"]}))
10
+ ->whenEvent(
11
+ OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1"), pid("p2")]}),
12
+ )
7
13
  ->thenStateWithId(
8
14
  "o1",
9
- {orderId: "o1", customerId: "c1", productIds: ["p1", "p2"], lifecycle: Placed},
15
+ {
16
+ orderId: oid("o1"),
17
+ customerId: cid("c1"),
18
+ productIds: [pid("p1"), pid("p2")],
19
+ lifecycle: Placed,
20
+ },
10
21
  )
11
22
  )
12
23
 
13
24
  test("OrderShipped updates status to Shipped", () =>
14
- givenEvents([OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]})])
15
- ->whenEvent(OrderShipped({orderId: "o1"}))
25
+ givenEvents([OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]})])
26
+ ->whenEvent(OrderShipped({orderId: oid("o1")}))
16
27
  ->thenStateWithId(
17
28
  "o1",
18
- {orderId: "o1", customerId: "c1", productIds: ["p1"], lifecycle: Shipped},
29
+ {orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")], lifecycle: Shipped},
19
30
  )
20
31
  )
21
32
 
22
33
  test("OrderCancelled updates status to Cancelled", () =>
23
- givenEvents([OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]})])
24
- ->whenEvent(OrderCancelled({orderId: "o1"}))
34
+ givenEvents([OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]})])
35
+ ->whenEvent(OrderCancelled({orderId: oid("o1")}))
25
36
  ->thenStateWithId(
26
37
  "o1",
27
- {orderId: "o1", customerId: "c1", productIds: ["p1"], lifecycle: Cancelled},
38
+ {orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")], lifecycle: Cancelled},
28
39
  )
29
40
  )
30
41
  })
Binary file
@@ -6,21 +6,26 @@
6
6
 
7
7
  @schema
8
8
  type consumedEvent =
9
- | OrderPlaced({orderId: string})
10
- | CatalogProductSynced({productId: string})
9
+ | OrderPlaced({orderId: OrderId.t})
10
+ | CatalogProductSynced({productId: CatalogSpec.ProductId.t})
11
11
 
12
12
  @schema
13
13
  type command =
14
14
  | PlaceOrder({
15
- orderId: string,
16
- customerId: string,
17
- @ref("AvailableProducts") productIds: array<string>,
15
+ orderId: OrderId.t,
16
+ customerId: CustomerId.t,
17
+ @ref("AvailableProducts") productIds: array<CatalogSpec.ProductId.t>,
18
18
  })
19
19
 
20
20
  @schema
21
21
  type error =
22
22
  | OrderAlreadyPlaced
23
- | ProductsNotAvailable({missing: array<string>})
23
+ | ProductsNotAvailable({missing: array<CatalogSpec.ProductId.t>})
24
24
 
25
25
  @schema
26
- type event = OrderPlaced({orderId: string, customerId: string, productIds: array<string>})
26
+ type event =
27
+ | OrderPlaced({
28
+ orderId: OrderId.t,
29
+ customerId: CustomerId.t,
30
+ productIds: array<CatalogSpec.ProductId.t>,
31
+ })
Binary file
@@ -3,7 +3,7 @@
3
3
  // Stored as immutable arrays (rather than `Set.t`) so each fold yields a fresh
4
4
  // state — `evolve` returns a new record instead of mutating a shared one. This
5
5
  // keeps successive `decide` calls (and unit tests) hermetic.
6
- type state = {placedOrderIds: array<string>, availableProductIds: array<string>}
6
+ type state = {placedOrderIds: array<OrderId.t>, availableProductIds: array<CatalogSpec.ProductId.t>}
7
7
 
8
8
  let initialState = {placedOrderIds: [], availableProductIds: []}
9
9
 
Binary file
@@ -1,33 +1,39 @@
1
1
  @@reventless.gwt
2
2
 
3
+ let cid = CustomerId.make
4
+ let oid = OrderId.make
5
+ let pid = CatalogSpec.ProductId.make
6
+
3
7
  describe("PlaceOrder StateChangeSlice", () => {
4
8
  test("requires referenced products to be synced first", () =>
5
9
  givenEvents([])
6
- ->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
7
- ->thenError(ProductsNotAvailable({missing: ["p1"]}))
10
+ ->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
11
+ ->thenError(ProductsNotAvailable({missing: [pid("p1")]}))
8
12
  )
9
13
 
10
14
  test("placement succeeds when products are available", () =>
11
- givenEvents([CatalogProductSynced({productId: "p1"})])
12
- ->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
13
- ->thenEvent(OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
15
+ givenEvents([CatalogProductSynced({productId: pid("p1")})])
16
+ ->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
17
+ ->thenEvent(OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
14
18
  )
15
19
 
16
20
  test("partial product availability returns ProductsNotAvailable with missing list", () =>
17
- givenEvents([CatalogProductSynced({productId: "p1"})])
18
- ->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1", "p2"]}))
19
- ->thenError(ProductsNotAvailable({missing: ["p2"]}))
21
+ givenEvents([CatalogProductSynced({productId: pid("p1")})])
22
+ ->whenCmd(
23
+ PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1"), pid("p2")]}),
24
+ )
25
+ ->thenError(ProductsNotAvailable({missing: [pid("p2")]}))
20
26
  )
21
27
 
22
28
  test("re-placing the same orderId returns OrderAlreadyPlaced", () =>
23
- givenEvents([CatalogProductSynced({productId: "p1"}), OrderPlaced({orderId: "o1"})])
24
- ->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
29
+ givenEvents([CatalogProductSynced({productId: pid("p1")}), OrderPlaced({orderId: oid("o1")})])
30
+ ->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
25
31
  ->thenError(OrderAlreadyPlaced)
26
32
  )
27
33
 
28
34
  test("a sibling OrderPlaced for a different orderId does not block placement", () =>
29
- givenEvents([CatalogProductSynced({productId: "p1"}), OrderPlaced({orderId: "o2"})])
30
- ->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
31
- ->thenEvent(OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
35
+ givenEvents([CatalogProductSynced({productId: pid("p1")}), OrderPlaced({orderId: oid("o2")})])
36
+ ->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
37
+ ->thenEvent(OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
32
38
  )
33
39
  })
Binary file
Binary file
@@ -2,6 +2,8 @@
2
2
  // SyncCatalogProduct commands on Ordering's local shadow slice.
3
3
  @@reventless.gwt
4
4
 
5
+ let pid = CatalogSpec.ProductId.make
6
+
5
7
  // `Mapping` is brought into scope by the PPX `open Products_Extension`; opening
6
8
  // it surfaces the extension point's events and the delegate's commands.
7
9
  open Mapping
@@ -9,13 +11,15 @@ open Mapping
9
11
  describe("Products Extension delegate", () => {
10
12
  test("ProductBecameAvailable issues SyncNewProduct", () =>
11
13
  whenIncomingEvent(
12
- ExtensionPoint.ProductBecameAvailable({productId: "p1", name: "Book", price: 9.99}),
13
- )->thenPublishesCommand(Delegate.SyncNewProduct({productId: "p1", name: "Book", price: 9.99}))
14
+ ExtensionPoint.ProductBecameAvailable({productId: pid("p1"), name: "Book", price: 9.99}),
15
+ )->thenPublishesCommand(
16
+ Delegate.SyncNewProduct({productId: pid("p1"), name: "Book", price: 9.99}),
17
+ )
14
18
  )
15
19
 
16
20
  test("ProductPriceChanged issues ChangeSyncedPrice", () =>
17
21
  whenIncomingEvent(
18
- ExtensionPoint.ProductPriceChanged({productId: "p1", price: 7.5}),
19
- )->thenPublishesCommand(Delegate.ChangeSyncedPrice({productId: "p1", price: 7.5}))
22
+ ExtensionPoint.ProductPriceChanged({productId: pid("p1"), price: 7.5}),
23
+ )->thenPublishesCommand(Delegate.ChangeSyncedPrice({productId: pid("p1"), price: 7.5}))
20
24
  )
21
25
  })
Binary file
@@ -6,10 +6,10 @@
6
6
  type consumedEvent = CustomerRegistered
7
7
 
8
8
  @schema
9
- type command = RegisterCustomer({customerId: string, email: string, address: string})
9
+ type command = RegisterCustomer({customerId: CustomerId.t, email: string, address: string})
10
10
 
11
11
  @schema
12
12
  type error = CustomerAlreadyRegistered
13
13
 
14
14
  @schema
15
- type event = CustomerRegistered({customerId: string, email: string, address: string})
15
+ type event = CustomerRegistered({customerId: CustomerId.t, email: string, address: string})
Binary file
@@ -1,15 +1,19 @@
1
1
  @@reventless.gwt
2
2
 
3
+ let cid = CustomerId.make
4
+
3
5
  describe("RegisterCustomer StateChangeSlice", () => {
4
6
  test("empty event log produces CustomerRegistered", () =>
5
7
  givenEvents([])
6
- ->whenCmd(RegisterCustomer({customerId: "c1", email: "alice@x.y", address: "123 Main"}))
7
- ->thenEvent(CustomerRegistered({customerId: "c1", email: "alice@x.y", address: "123 Main"}))
8
+ ->whenCmd(RegisterCustomer({customerId: cid("c1"), email: "alice@x.y", address: "123 Main"}))
9
+ ->thenEvent(
10
+ CustomerRegistered({customerId: cid("c1"), email: "alice@x.y", address: "123 Main"}),
11
+ )
8
12
  )
9
13
 
10
14
  test("existing customer returns CustomerAlreadyRegistered", () =>
11
15
  givenEvents([CustomerRegistered])
12
- ->whenCmd(RegisterCustomer({customerId: "c1", email: "bob@x.y", address: "456 Oak"}))
16
+ ->whenCmd(RegisterCustomer({customerId: cid("c1"), email: "bob@x.y", address: "456 Oak"}))
13
17
  ->thenError(CustomerAlreadyRegistered)
14
18
  )
15
19
  })
Binary file