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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/CHANGELOG.md +846 -0
  2. package/LICENSE +202 -0
  3. package/__mocks__/emptyModule.js +1 -0
  4. package/lib/bs/.compiler.log +2 -0
  5. package/lib/bs/OrderingPlugin.cmi +0 -0
  6. package/lib/bs/OrderingPlugin.cmj +0 -0
  7. package/lib/bs/OrderingPlugin.cmt +0 -0
  8. package/lib/bs/OrderingPlugin.mlmap +31 -0
  9. package/lib/bs/build.ninja +0 -0
  10. package/lib/bs/compiler-info.json +8 -0
  11. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmi +0 -0
  12. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmj +0 -0
  13. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmt +0 -0
  14. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.ast +0 -0
  15. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.res +18 -0
  16. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.res.mjs +50 -0
  17. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  18. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmj +0 -0
  19. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  20. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.ast +0 -0
  21. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res +27 -0
  22. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res.mjs +87 -0
  23. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmi +0 -0
  24. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmj +0 -0
  25. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmt +0 -0
  26. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.ast +0 -0
  27. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.res +13 -0
  28. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.res.mjs +53 -0
  29. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  30. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmj +0 -0
  31. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  32. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.ast +0 -0
  33. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res +20 -0
  34. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +65 -0
  35. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmi +0 -0
  36. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmj +0 -0
  37. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmt +0 -0
  38. package/lib/bs/src/Customer/Aggregate/Customer.ast +0 -0
  39. package/lib/bs/src/Customer/Aggregate/Customer.res +24 -0
  40. package/lib/bs/src/Customer/Aggregate/Customer.res.mjs +64 -0
  41. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmi +0 -0
  42. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmj +0 -0
  43. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmt +0 -0
  44. package/lib/bs/src/Customer/Aggregate/Customer_Behavior.ast +0 -0
  45. package/lib/bs/src/Customer/Aggregate/Customer_Behavior.res +41 -0
  46. package/lib/bs/src/Customer/Aggregate/Customer_Behavior.res.mjs +143 -0
  47. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmi +0 -0
  48. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmj +0 -0
  49. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmt +0 -0
  50. package/lib/bs/src/Customer/ReadModel/Customers.ast +0 -0
  51. package/lib/bs/src/Customer/ReadModel/Customers.res +12 -0
  52. package/lib/bs/src/Customer/ReadModel/Customers.res.mjs +36 -0
  53. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmi +0 -0
  54. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmj +0 -0
  55. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmt +0 -0
  56. package/lib/bs/src/Customer/ReadModel/Customers_Projections.ast +0 -0
  57. package/lib/bs/src/Customer/ReadModel/Customers_Projections.res +21 -0
  58. package/lib/bs/src/Customer/ReadModel/Customers_Projections.res.mjs +91 -0
  59. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
  60. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmj +0 -0
  61. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
  62. package/lib/bs/src/Extension/Products_Extension.ast +0 -0
  63. package/lib/bs/src/Extension/Products_Extension.res +23 -0
  64. package/lib/bs/src/Extension/Products_Extension.res.mjs +43 -0
  65. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  66. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
  67. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  68. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.ast +0 -0
  69. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res +28 -0
  70. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +59 -0
  71. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmi +0 -0
  72. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmj +0 -0
  73. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmt +0 -0
  74. package/lib/bs/src/Order/Aggregate/Order.ast +0 -0
  75. package/lib/bs/src/Order/Aggregate/Order.res +27 -0
  76. package/lib/bs/src/Order/Aggregate/Order.res.mjs +81 -0
  77. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmi +0 -0
  78. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmj +0 -0
  79. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmt +0 -0
  80. package/lib/bs/src/Order/Aggregate/Order_Behavior.ast +0 -0
  81. package/lib/bs/src/Order/Aggregate/Order_Behavior.res +52 -0
  82. package/lib/bs/src/Order/Aggregate/Order_Behavior.res.mjs +193 -0
  83. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmi +0 -0
  84. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmj +0 -0
  85. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -0
  86. package/lib/bs/src/Order/Aggregate/Order_Mappings.ast +0 -0
  87. package/lib/bs/src/Order/Aggregate/Order_Mappings.res +15 -0
  88. package/lib/bs/src/Order/Aggregate/Order_Mappings.res.mjs +55 -0
  89. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmi +0 -0
  90. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmj +0 -0
  91. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmt +0 -0
  92. package/lib/bs/src/Order/ReadModel/Orders.ast +0 -0
  93. package/lib/bs/src/Order/ReadModel/Orders.res +19 -0
  94. package/lib/bs/src/Order/ReadModel/Orders.res.mjs +62 -0
  95. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmi +0 -0
  96. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmj +0 -0
  97. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
  98. package/lib/bs/src/Order/ReadModel/Orders_Projections.ast +0 -0
  99. package/lib/bs/src/Order/ReadModel/Orders_Projections.res +31 -0
  100. package/lib/bs/src/Order/ReadModel/Orders_Projections.res.mjs +89 -0
  101. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  102. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmj +0 -0
  103. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  104. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.ast +0 -0
  105. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res +18 -0
  106. package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res.mjs +34 -0
  107. package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
  108. package/lib/bs/src/Plugin-OrderingPlugin.cmj +0 -0
  109. package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
  110. package/lib/bs/src/Plugin.ast +0 -0
  111. package/lib/bs/src/Plugin.res +65 -0
  112. package/lib/bs/src/Plugin.res.mjs +223 -0
  113. package/lib/bs/src/Service/EmailService-OrderingPlugin.cmi +0 -0
  114. package/lib/bs/src/Service/EmailService-OrderingPlugin.cmj +0 -0
  115. package/lib/bs/src/Service/EmailService-OrderingPlugin.cmt +0 -0
  116. package/lib/bs/src/Service/EmailService.ast +0 -0
  117. package/lib/bs/src/Service/EmailService.res +22 -0
  118. package/lib/bs/src/Service/EmailService.res.mjs +23 -0
  119. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
  120. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmj +0 -0
  121. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
  122. package/lib/bs/src/Task/OrderNotifications.ast +0 -0
  123. package/lib/bs/src/Task/OrderNotifications.res +8 -0
  124. package/lib/bs/src/Task/OrderNotifications.res.mjs +29 -0
  125. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  126. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmj +0 -0
  127. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  128. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.ast +0 -0
  129. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res +27 -0
  130. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res.mjs +102 -0
  131. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  132. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmj +0 -0
  133. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  134. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.ast +0 -0
  135. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res +15 -0
  136. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res.mjs +83 -0
  137. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmi +0 -0
  138. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmj +0 -0
  139. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmt +0 -0
  140. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.ast +0 -0
  141. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res +90 -0
  142. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res.mjs +170 -0
  143. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmi +0 -0
  144. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmj +0 -0
  145. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmt +0 -0
  146. package/lib/bs/tests/Customer/ReadModel/Customers_GWT.ast +0 -0
  147. package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res +27 -0
  148. package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res.mjs +106 -0
  149. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  150. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmj +0 -0
  151. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  152. package/lib/bs/tests/Extension/Products_Extension_GWT.ast +0 -0
  153. package/lib/bs/tests/Extension/Products_Extension_GWT.res +21 -0
  154. package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +106 -0
  155. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  156. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmj +0 -0
  157. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  158. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.ast +0 -0
  159. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +33 -0
  160. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +143 -0
  161. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  162. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
  163. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  164. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.ast +0 -0
  165. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res +52 -0
  166. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +162 -0
  167. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmi +0 -0
  168. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmj +0 -0
  169. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmt +0 -0
  170. package/lib/bs/tests/Order/Aggregate/Order_GWT.ast +0 -0
  171. package/lib/bs/tests/Order/Aggregate/Order_GWT.res +121 -0
  172. package/lib/bs/tests/Order/Aggregate/Order_GWT.res.mjs +231 -0
  173. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmi +0 -0
  174. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmj +0 -0
  175. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmt +0 -0
  176. package/lib/bs/tests/Order/ReadModel/Orders_GWT.ast +0 -0
  177. package/lib/bs/tests/Order/ReadModel/Orders_GWT.res +46 -0
  178. package/lib/bs/tests/Order/ReadModel/Orders_GWT.res.mjs +118 -0
  179. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmi +0 -0
  180. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmj +0 -0
  181. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmt +0 -0
  182. package/lib/bs/tests/Order/SideEffect/EmailService_Mock.ast +0 -0
  183. package/lib/bs/tests/Order/SideEffect/EmailService_Mock.res +31 -0
  184. package/lib/bs/tests/Order/SideEffect/EmailService_Mock.res.mjs +56 -0
  185. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  186. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmj +0 -0
  187. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  188. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.ast +0 -0
  189. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res +37 -0
  190. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +76 -0
  191. package/lib/ocaml/.compiler.log +2 -0
  192. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
  193. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmj +0 -0
  194. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
  195. package/lib/ocaml/AvailableProducts.ast +0 -0
  196. package/lib/ocaml/AvailableProducts.res +13 -0
  197. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  198. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmj +0 -0
  199. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  200. package/lib/ocaml/AvailableProducts_GWT.ast +0 -0
  201. package/lib/ocaml/AvailableProducts_GWT.res +15 -0
  202. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  203. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmj +0 -0
  204. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  205. package/lib/ocaml/AvailableProducts_Projections.ast +0 -0
  206. package/lib/ocaml/AvailableProducts_Projections.res +20 -0
  207. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmi +0 -0
  208. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmj +0 -0
  209. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmt +0 -0
  210. package/lib/ocaml/CatalogProduct.ast +0 -0
  211. package/lib/ocaml/CatalogProduct.res +18 -0
  212. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  213. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmj +0 -0
  214. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  215. package/lib/ocaml/CatalogProduct_Behavior.ast +0 -0
  216. package/lib/ocaml/CatalogProduct_Behavior.res +27 -0
  217. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  218. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmj +0 -0
  219. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  220. package/lib/ocaml/CatalogProduct_GWT.ast +0 -0
  221. package/lib/ocaml/CatalogProduct_GWT.res +27 -0
  222. package/lib/ocaml/Customer-OrderingPlugin.cmi +0 -0
  223. package/lib/ocaml/Customer-OrderingPlugin.cmj +0 -0
  224. package/lib/ocaml/Customer-OrderingPlugin.cmt +0 -0
  225. package/lib/ocaml/Customer.ast +0 -0
  226. package/lib/ocaml/Customer.res +24 -0
  227. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmi +0 -0
  228. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmj +0 -0
  229. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmt +0 -0
  230. package/lib/ocaml/Customer_Behavior.ast +0 -0
  231. package/lib/ocaml/Customer_Behavior.res +41 -0
  232. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmi +0 -0
  233. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmj +0 -0
  234. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmt +0 -0
  235. package/lib/ocaml/Customer_GWT.ast +0 -0
  236. package/lib/ocaml/Customer_GWT.res +90 -0
  237. package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
  238. package/lib/ocaml/Customers-OrderingPlugin.cmj +0 -0
  239. package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
  240. package/lib/ocaml/Customers.ast +0 -0
  241. package/lib/ocaml/Customers.res +12 -0
  242. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
  243. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmj +0 -0
  244. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
  245. package/lib/ocaml/Customers_GWT.ast +0 -0
  246. package/lib/ocaml/Customers_GWT.res +27 -0
  247. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
  248. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmj +0 -0
  249. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
  250. package/lib/ocaml/Customers_Projections.ast +0 -0
  251. package/lib/ocaml/Customers_Projections.res +21 -0
  252. package/lib/ocaml/EmailService-OrderingPlugin.cmi +0 -0
  253. package/lib/ocaml/EmailService-OrderingPlugin.cmj +0 -0
  254. package/lib/ocaml/EmailService-OrderingPlugin.cmt +0 -0
  255. package/lib/ocaml/EmailService.ast +0 -0
  256. package/lib/ocaml/EmailService.res +22 -0
  257. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
  258. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmj +0 -0
  259. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
  260. package/lib/ocaml/EmailService_Mock.ast +0 -0
  261. package/lib/ocaml/EmailService_Mock.res +31 -0
  262. package/lib/ocaml/Order-OrderingPlugin.cmi +0 -0
  263. package/lib/ocaml/Order-OrderingPlugin.cmj +0 -0
  264. package/lib/ocaml/Order-OrderingPlugin.cmt +0 -0
  265. package/lib/ocaml/Order.ast +0 -0
  266. package/lib/ocaml/Order.res +27 -0
  267. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  268. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
  269. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  270. package/lib/ocaml/OrderMappings_GWT.ast +0 -0
  271. package/lib/ocaml/OrderMappings_GWT.res +52 -0
  272. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmi +0 -0
  273. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmj +0 -0
  274. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmt +0 -0
  275. package/lib/ocaml/OrderNotifications.ast +0 -0
  276. package/lib/ocaml/OrderNotifications.res +8 -0
  277. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmi +0 -0
  278. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmj +0 -0
  279. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmt +0 -0
  280. package/lib/ocaml/Order_Behavior.ast +0 -0
  281. package/lib/ocaml/Order_Behavior.res +52 -0
  282. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  283. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmj +0 -0
  284. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  285. package/lib/ocaml/Order_EmailNotification.ast +0 -0
  286. package/lib/ocaml/Order_EmailNotification.res +18 -0
  287. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  288. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmj +0 -0
  289. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  290. package/lib/ocaml/Order_EmailNotification_GWT.ast +0 -0
  291. package/lib/ocaml/Order_EmailNotification_GWT.res +37 -0
  292. package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +0 -0
  293. package/lib/ocaml/Order_GWT-OrderingPlugin.cmj +0 -0
  294. package/lib/ocaml/Order_GWT-OrderingPlugin.cmt +0 -0
  295. package/lib/ocaml/Order_GWT.ast +0 -0
  296. package/lib/ocaml/Order_GWT.res +121 -0
  297. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmi +0 -0
  298. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmj +0 -0
  299. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmt +0 -0
  300. package/lib/ocaml/Order_Mappings.ast +0 -0
  301. package/lib/ocaml/Order_Mappings.res +15 -0
  302. package/lib/ocaml/OrderingPlugin.cmi +0 -0
  303. package/lib/ocaml/OrderingPlugin.cmj +0 -0
  304. package/lib/ocaml/OrderingPlugin.cmt +0 -0
  305. package/lib/ocaml/OrderingPlugin.mlmap +31 -0
  306. package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
  307. package/lib/ocaml/Orders-OrderingPlugin.cmj +0 -0
  308. package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
  309. package/lib/ocaml/Orders.ast +0 -0
  310. package/lib/ocaml/Orders.res +19 -0
  311. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  312. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
  313. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  314. package/lib/ocaml/Orders_ExtensionPointMapping.ast +0 -0
  315. package/lib/ocaml/Orders_ExtensionPointMapping.res +28 -0
  316. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  317. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmj +0 -0
  318. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  319. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.ast +0 -0
  320. package/lib/ocaml/Orders_ExtensionPointMapping_GWT.res +33 -0
  321. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
  322. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmj +0 -0
  323. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
  324. package/lib/ocaml/Orders_GWT.ast +0 -0
  325. package/lib/ocaml/Orders_GWT.res +46 -0
  326. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmi +0 -0
  327. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmj +0 -0
  328. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmt +0 -0
  329. package/lib/ocaml/Orders_Projections.ast +0 -0
  330. package/lib/ocaml/Orders_Projections.res +31 -0
  331. package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
  332. package/lib/ocaml/Plugin-OrderingPlugin.cmj +0 -0
  333. package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
  334. package/lib/ocaml/Plugin.ast +0 -0
  335. package/lib/ocaml/Plugin.res +65 -0
  336. package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
  337. package/lib/ocaml/Products_Extension-OrderingPlugin.cmj +0 -0
  338. package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
  339. package/lib/ocaml/Products_Extension.ast +0 -0
  340. package/lib/ocaml/Products_Extension.res +23 -0
  341. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  342. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmj +0 -0
  343. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  344. package/lib/ocaml/Products_Extension_GWT.ast +0 -0
  345. package/lib/ocaml/Products_Extension_GWT.res +21 -0
  346. package/package.json +52 -0
  347. package/rescript.json +39 -0
  348. package/src/CatalogProduct/Aggregate/CatalogProduct.res +18 -0
  349. package/src/CatalogProduct/Aggregate/CatalogProduct.res.mjs +50 -0
  350. package/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res +27 -0
  351. package/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res.mjs +87 -0
  352. package/src/CatalogProduct/ReadModel/AvailableProducts.res +13 -0
  353. package/src/CatalogProduct/ReadModel/AvailableProducts.res.mjs +53 -0
  354. package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res +20 -0
  355. package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +65 -0
  356. package/src/Customer/Aggregate/Customer.res +24 -0
  357. package/src/Customer/Aggregate/Customer.res.mjs +64 -0
  358. package/src/Customer/Aggregate/Customer_Behavior.res +41 -0
  359. package/src/Customer/Aggregate/Customer_Behavior.res.mjs +143 -0
  360. package/src/Customer/ReadModel/Customers.res +12 -0
  361. package/src/Customer/ReadModel/Customers.res.mjs +36 -0
  362. package/src/Customer/ReadModel/Customers_Projections.res +21 -0
  363. package/src/Customer/ReadModel/Customers_Projections.res.mjs +91 -0
  364. package/src/Extension/Products_Extension.res +23 -0
  365. package/src/Extension/Products_Extension.res.mjs +43 -0
  366. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +28 -0
  367. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +59 -0
  368. package/src/Order/Aggregate/Order.res +27 -0
  369. package/src/Order/Aggregate/Order.res.mjs +81 -0
  370. package/src/Order/Aggregate/Order_Behavior.res +52 -0
  371. package/src/Order/Aggregate/Order_Behavior.res.mjs +193 -0
  372. package/src/Order/Aggregate/Order_Mappings.res +15 -0
  373. package/src/Order/Aggregate/Order_Mappings.res.mjs +55 -0
  374. package/src/Order/ReadModel/Orders.res +19 -0
  375. package/src/Order/ReadModel/Orders.res.mjs +62 -0
  376. package/src/Order/ReadModel/Orders_Projections.res +31 -0
  377. package/src/Order/ReadModel/Orders_Projections.res.mjs +89 -0
  378. package/src/Order/SideEffect/Order_EmailNotification.res +18 -0
  379. package/src/Order/SideEffect/Order_EmailNotification.res.mjs +34 -0
  380. package/src/Plugin.res +65 -0
  381. package/src/Plugin.res.mjs +223 -0
  382. package/src/Service/EmailService.res +22 -0
  383. package/src/Service/EmailService.res.mjs +23 -0
  384. package/src/Task/OrderNotifications.res +8 -0
  385. package/src/Task/OrderNotifications.res.mjs +29 -0
  386. package/src/plugin.json +1 -0
  387. package/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res +27 -0
  388. package/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res.mjs +102 -0
  389. package/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res +15 -0
  390. package/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res.mjs +83 -0
  391. package/tests/Customer/Aggregate/Customer_GWT.res +90 -0
  392. package/tests/Customer/Aggregate/Customer_GWT.res.mjs +170 -0
  393. package/tests/Customer/ReadModel/Customers_GWT.res +27 -0
  394. package/tests/Customer/ReadModel/Customers_GWT.res.mjs +106 -0
  395. package/tests/Extension/Products_Extension_GWT.res +21 -0
  396. package/tests/Extension/Products_Extension_GWT.res.mjs +106 -0
  397. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +33 -0
  398. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +143 -0
  399. package/tests/Order/Aggregate/OrderMappings_GWT.res +52 -0
  400. package/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +162 -0
  401. package/tests/Order/Aggregate/Order_GWT.res +121 -0
  402. package/tests/Order/Aggregate/Order_GWT.res.mjs +231 -0
  403. package/tests/Order/ReadModel/Orders_GWT.res +46 -0
  404. package/tests/Order/ReadModel/Orders_GWT.res.mjs +118 -0
  405. package/tests/Order/SideEffect/EmailService_Mock.res +31 -0
  406. package/tests/Order/SideEffect/EmailService_Mock.res.mjs +56 -0
  407. package/tests/Order/SideEffect/Order_EmailNotification_GWT.res +37 -0
  408. package/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +76 -0
@@ -0,0 +1,143 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
4
+ import * as Order$OrderingPlugin from "../../src/Order/Aggregate/Order.res.mjs";
5
+ import * as Delegate_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Delegate_GWT.res.mjs";
6
+ import * as Orders_ExtensionPoint$OrderingSpec from "@reventlessdev/online-shop-aggregates-ordering-spec/src/Orders_ExtensionPoint.res.mjs";
7
+ import * as Orders_ExtensionPointMapping$OrderingPlugin from "../../src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs";
8
+
9
+ let include = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
10
+ ExtensionPoint: {
11
+ name: Orders_ExtensionPoint$OrderingSpec.name,
12
+ moduleUrl: Orders_ExtensionPoint$OrderingSpec.moduleUrl,
13
+ commandSchema: Orders_ExtensionPoint$OrderingSpec.commandSchema,
14
+ eventSchema: Orders_ExtensionPoint$OrderingSpec.eventSchema,
15
+ directiveSchema: Orders_ExtensionPoint$OrderingSpec.directiveSchema
16
+ },
17
+ Delegate: {
18
+ Id: Id$Reventless.$$String,
19
+ name: Order$OrderingPlugin.name,
20
+ eventSchema: Order$OrderingPlugin.eventSchema,
21
+ errorSchema: Order$OrderingPlugin.errorSchema,
22
+ commandSchema: Order$OrderingPlugin.commandSchema,
23
+ moduleUrl: Order$OrderingPlugin.moduleUrl,
24
+ commandAuthorization: Order$OrderingPlugin.commandAuthorization
25
+ },
26
+ moduleUrl: Orders_ExtensionPointMapping$OrderingPlugin.moduleUrl,
27
+ mapIncomingCommand: Orders_ExtensionPointMapping$OrderingPlugin.mapIncomingCommand,
28
+ mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent
29
+ });
30
+
31
+ let describe = include.describe;
32
+
33
+ let test = include.test;
34
+
35
+ let thenPublishesNothing = include.thenPublishesNothing;
36
+
37
+ let whenDelegateEvent = include.whenDelegateEvent;
38
+
39
+ let thenPublishesEvents = include.thenPublishesEvents;
40
+
41
+ describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
42
+ test("Placed fans out to one ItemOrdered per product", undefined, () => thenPublishesEvents(whenDelegateEvent({
43
+ TAG: "Placed",
44
+ customerId: "c1",
45
+ productIds: [
46
+ "p1",
47
+ "p2"
48
+ ]
49
+ }), [
50
+ [
51
+ "p1",
52
+ {
53
+ TAG: "ItemOrdered",
54
+ productId: "p1",
55
+ orderId: "gwt-id",
56
+ customerId: "c1"
57
+ }
58
+ ],
59
+ [
60
+ "p2",
61
+ {
62
+ TAG: "ItemOrdered",
63
+ productId: "p2",
64
+ orderId: "gwt-id",
65
+ customerId: "c1"
66
+ }
67
+ ]
68
+ ]));
69
+ test("Cancelled fans out to one ItemOrderCancelled per product", undefined, () => thenPublishesEvents(whenDelegateEvent({
70
+ TAG: "Cancelled",
71
+ productIds: [
72
+ "p1",
73
+ "p2"
74
+ ]
75
+ }), [
76
+ [
77
+ "p1",
78
+ {
79
+ TAG: "ItemOrderCancelled",
80
+ productId: "p1",
81
+ orderId: "gwt-id"
82
+ }
83
+ ],
84
+ [
85
+ "p2",
86
+ {
87
+ TAG: "ItemOrderCancelled",
88
+ productId: "p2",
89
+ orderId: "gwt-id"
90
+ }
91
+ ]
92
+ ]));
93
+ test("Shipped publishes nothing", undefined, () => thenPublishesNothing(whenDelegateEvent("Shipped")));
94
+ test("Refunded publishes nothing", undefined, () => thenPublishesNothing(whenDelegateEvent({
95
+ TAG: "Refunded",
96
+ reason: "customer-changed-mind"
97
+ })));
98
+ });
99
+
100
+ let encEvent = include.encEvent;
101
+
102
+ let encCommand = include.encCommand;
103
+
104
+ let encDirective = include.encDirective;
105
+
106
+ let EvCore = include.EvCore;
107
+
108
+ let CmdCore = include.CmdCore;
109
+
110
+ let thenPublishesEvent = include.thenPublishesEvent;
111
+
112
+ let whenIncomingCommand = include.whenIncomingCommand;
113
+
114
+ let thenPublishesCommand = include.thenPublishesCommand;
115
+
116
+ let thenPublishesCommands = include.thenPublishesCommands;
117
+
118
+ let thenHandlesDirective = include.thenHandlesDirective;
119
+
120
+ let thenHandlesDirectives = include.thenHandlesDirectives;
121
+
122
+ let thenHandlesNoDirective = include.thenHandlesNoDirective;
123
+
124
+ export {
125
+ encEvent,
126
+ encCommand,
127
+ encDirective,
128
+ EvCore,
129
+ CmdCore,
130
+ describe,
131
+ test,
132
+ thenPublishesNothing,
133
+ whenDelegateEvent,
134
+ thenPublishesEvent,
135
+ thenPublishesEvents,
136
+ whenIncomingCommand,
137
+ thenPublishesCommand,
138
+ thenPublishesCommands,
139
+ thenHandlesDirective,
140
+ thenHandlesDirectives,
141
+ thenHandlesNoDirective,
142
+ }
143
+ /* include Not a pure module */
@@ -0,0 +1,52 @@
1
+ // `Mapping_GWT` exercises Order's self-mapping (auto-ship on placement).
2
+ // Bare `@@reventless.gwt` would derive the Behavior DSL from the Aggregate
3
+ // folder; the cross-pattern Mapping DSL is wired explicitly instead.
4
+ //
5
+ // Self-mappings need the target's per-id history pre-seeded with the
6
+ // source-emitted event, since Mapping_GWT models source and target as
7
+ // independent aggregates even when they're the same one in production.
8
+
9
+ module OrderSource = ReventlessGwt.Mapping_GWT.FromBehavior(Order, Order_Behavior)
10
+ module OrderTarget = ReventlessGwt.Mapping_GWT.FromBehavior(Order, Order_Behavior)
11
+
12
+ module AutoShipGwtMapping = {
13
+ module Source = OrderSource
14
+ module Target = OrderTarget
15
+ let map = Order_Mappings.AutoShipMapping.map
16
+ }
17
+
18
+ include ReventlessGwt.Mapping_GWT.Make(AutoShipGwtMapping)
19
+
20
+ let placedEvent = Order.Placed({customerId: "cust-1", productIds: ["prod-1"]})
21
+
22
+ describe("Order auto-ship mapping (Placed → Ship)", () => {
23
+ test("Place → AutoShipMapping issues Ship → target emits Shipped", () =>
24
+ givenSourceEvents([])
25
+ ->andTargetEvents([("order-1", [placedEvent])])
26
+ ->whenSourceCmd("order-1", Place({customerId: "cust-1", productIds: ["prod-1"]}))
27
+ ->thenTargetEvent("order-1", Order.Shipped)
28
+ )
29
+
30
+ test("Ship command does not fire the mapping (only Placed events do)", () =>
31
+ givenSourceEvents([placedEvent])
32
+ ->andTargetEvents([("order-1", [placedEvent])])
33
+ ->whenSourceCmd("order-1", Ship)
34
+ ->thenNoTargetEvent
35
+ )
36
+
37
+ test("Cancel command does not fire the mapping", () =>
38
+ givenSourceEvents([placedEvent])
39
+ ->andTargetEvents([("order-1", [placedEvent])])
40
+ ->whenSourceCmd("order-1", Cancel)
41
+ ->thenNoTargetEvent
42
+ )
43
+
44
+ test("Refund command does not fire the mapping (only Placed events do)", () =>
45
+ givenSourceEvents([placedEvent, Order.Cancelled({productIds: ["prod-1"]})])
46
+ ->andTargetEvents([
47
+ ("order-1", [placedEvent, Order.Cancelled({productIds: ["prod-1"]})]),
48
+ ])
49
+ ->whenSourceCmd("order-1", Refund({reason: "customer-changed-mind"}))
50
+ ->thenNoTargetEvent
51
+ )
52
+ })
@@ -0,0 +1,162 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
4
+ import * as Order$OrderingPlugin from "../../../src/Order/Aggregate/Order.res.mjs";
5
+ import * as Mapping_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Mapping_GWT.res.mjs";
6
+ import * as Order_Behavior$OrderingPlugin from "../../../src/Order/Aggregate/Order_Behavior.res.mjs";
7
+ import * as Order_Mappings$OrderingPlugin from "../../../src/Order/Aggregate/Order_Mappings.res.mjs";
8
+
9
+ let OrderSource = Mapping_GWT$ReventlessGwt.FromBehavior({
10
+ Id: Id$Reventless.$$String,
11
+ name: Order$OrderingPlugin.name,
12
+ eventSchema: Order$OrderingPlugin.eventSchema,
13
+ errorSchema: Order$OrderingPlugin.errorSchema,
14
+ commandSchema: Order$OrderingPlugin.commandSchema,
15
+ moduleUrl: Order$OrderingPlugin.moduleUrl,
16
+ commandAuthorization: Order$OrderingPlugin.commandAuthorization
17
+ })({
18
+ Spec: {
19
+ Id: Id$Reventless.$$String,
20
+ name: Order$OrderingPlugin.name,
21
+ eventSchema: Order$OrderingPlugin.eventSchema,
22
+ errorSchema: Order$OrderingPlugin.errorSchema,
23
+ commandSchema: Order$OrderingPlugin.commandSchema,
24
+ moduleUrl: Order$OrderingPlugin.moduleUrl,
25
+ commandAuthorization: Order$OrderingPlugin.commandAuthorization
26
+ },
27
+ initialState: Order_Behavior$OrderingPlugin.initialState,
28
+ evolve: Order_Behavior$OrderingPlugin.evolve,
29
+ decide: Order_Behavior$OrderingPlugin.decide,
30
+ moduleUrl: Order_Behavior$OrderingPlugin.moduleUrl
31
+ });
32
+
33
+ let OrderTarget = Mapping_GWT$ReventlessGwt.FromBehavior({
34
+ Id: Id$Reventless.$$String,
35
+ name: Order$OrderingPlugin.name,
36
+ eventSchema: Order$OrderingPlugin.eventSchema,
37
+ errorSchema: Order$OrderingPlugin.errorSchema,
38
+ commandSchema: Order$OrderingPlugin.commandSchema,
39
+ moduleUrl: Order$OrderingPlugin.moduleUrl,
40
+ commandAuthorization: Order$OrderingPlugin.commandAuthorization
41
+ })({
42
+ Spec: {
43
+ Id: Id$Reventless.$$String,
44
+ name: Order$OrderingPlugin.name,
45
+ eventSchema: Order$OrderingPlugin.eventSchema,
46
+ errorSchema: Order$OrderingPlugin.errorSchema,
47
+ commandSchema: Order$OrderingPlugin.commandSchema,
48
+ moduleUrl: Order$OrderingPlugin.moduleUrl,
49
+ commandAuthorization: Order$OrderingPlugin.commandAuthorization
50
+ },
51
+ initialState: Order_Behavior$OrderingPlugin.initialState,
52
+ evolve: Order_Behavior$OrderingPlugin.evolve,
53
+ decide: Order_Behavior$OrderingPlugin.decide,
54
+ moduleUrl: Order_Behavior$OrderingPlugin.moduleUrl
55
+ });
56
+
57
+ let map = Order_Mappings$OrderingPlugin.AutoShipMapping.map;
58
+
59
+ let AutoShipGwtMapping = {
60
+ Source: undefined,
61
+ Target: undefined,
62
+ map: map
63
+ };
64
+
65
+ let include = Mapping_GWT$ReventlessGwt.Make({
66
+ Source: OrderSource,
67
+ Target: OrderTarget,
68
+ map: map
69
+ });
70
+
71
+ let describe = include.describe;
72
+
73
+ let test = include.test;
74
+
75
+ let givenSourceEvents = include.givenSourceEvents;
76
+
77
+ let andTargetEvents = include.andTargetEvents;
78
+
79
+ let whenSourceCmd = include.whenSourceCmd;
80
+
81
+ let thenTargetEvent = include.thenTargetEvent;
82
+
83
+ let thenNoTargetEvent = include.thenNoTargetEvent;
84
+
85
+ let placedEvent_1 = ["prod-1"];
86
+
87
+ let placedEvent = {
88
+ TAG: "Placed",
89
+ customerId: "cust-1",
90
+ productIds: placedEvent_1
91
+ };
92
+
93
+ describe("Order auto-ship mapping (Placed → Ship)", () => {
94
+ test("Place → AutoShipMapping issues Ship → target emits Shipped", undefined, () => thenTargetEvent(whenSourceCmd(andTargetEvents(givenSourceEvents([]), [[
95
+ "order-1",
96
+ [placedEvent]
97
+ ]]), "order-1", {
98
+ TAG: "Place",
99
+ customerId: "cust-1",
100
+ productIds: ["prod-1"]
101
+ }), "order-1", "Shipped"));
102
+ test("Ship command does not fire the mapping (only Placed events do)", undefined, () => thenNoTargetEvent(whenSourceCmd(andTargetEvents(givenSourceEvents([placedEvent]), [[
103
+ "order-1",
104
+ [placedEvent]
105
+ ]]), "order-1", "Ship")));
106
+ test("Cancel command does not fire the mapping", undefined, () => thenNoTargetEvent(whenSourceCmd(andTargetEvents(givenSourceEvents([placedEvent]), [[
107
+ "order-1",
108
+ [placedEvent]
109
+ ]]), "order-1", "Cancel")));
110
+ test("Refund command does not fire the mapping (only Placed events do)", undefined, () => thenNoTargetEvent(whenSourceCmd(andTargetEvents(givenSourceEvents([
111
+ placedEvent,
112
+ {
113
+ TAG: "Cancelled",
114
+ productIds: ["prod-1"]
115
+ }
116
+ ]), [[
117
+ "order-1",
118
+ [
119
+ placedEvent,
120
+ {
121
+ TAG: "Cancelled",
122
+ productIds: ["prod-1"]
123
+ }
124
+ ]
125
+ ]]), "order-1", {
126
+ TAG: "Refund",
127
+ reason: "customer-changed-mind"
128
+ })));
129
+ });
130
+
131
+ let Source = include.Source;
132
+
133
+ let Target = include.Target;
134
+
135
+ let thenTargetEvents = include.thenTargetEvents;
136
+
137
+ let thenSourceError = include.thenSourceError;
138
+
139
+ let thenTargetError = include.thenTargetError;
140
+
141
+ let thenTargetEventsWithError = include.thenTargetEventsWithError;
142
+
143
+ export {
144
+ OrderSource,
145
+ OrderTarget,
146
+ AutoShipGwtMapping,
147
+ Source,
148
+ Target,
149
+ describe,
150
+ test,
151
+ givenSourceEvents,
152
+ andTargetEvents,
153
+ whenSourceCmd,
154
+ thenTargetEvents,
155
+ thenTargetEvent,
156
+ thenNoTargetEvent,
157
+ thenSourceError,
158
+ thenTargetError,
159
+ thenTargetEventsWithError,
160
+ placedEvent,
161
+ }
162
+ /* OrderSource Not a pure module */
@@ -0,0 +1,121 @@
1
+ @@reventless.gwt
2
+
3
+ describe("Order Behavior", () => {
4
+ test("Place on new aggregate produces Placed", () =>
5
+ givenEvents([])
6
+ ->whenCmd(Place({customerId: "cust-1", productIds: ["prod-1", "prod-2"]}))
7
+ ->thenEvent(Placed({customerId: "cust-1", productIds: ["prod-1", "prod-2"]}))
8
+ )
9
+
10
+ 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"]}))
13
+ ->thenError(OrderAlreadyPlaced)
14
+ )
15
+
16
+ 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"]}))
19
+ ->thenError(OrderAlreadyShipped)
20
+ )
21
+
22
+ test("Place on cancelled order returns OrderAlreadyCancelled", () =>
23
+ givenEvents([
24
+ Placed({customerId: "cust-1", productIds: ["prod-1"]}),
25
+ Cancelled({productIds: ["prod-1"]}),
26
+ ])
27
+ ->whenCmd(Place({customerId: "cust-1", productIds: ["prod-1"]}))
28
+ ->thenError(OrderAlreadyCancelled)
29
+ )
30
+
31
+ test("Ship on non-existent order returns OrderNotFound", () =>
32
+ givenEvents([])
33
+ ->whenCmd(Ship)
34
+ ->thenError(OrderNotFound)
35
+ )
36
+
37
+ test("Ship on placed order produces Shipped", () =>
38
+ givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]})])
39
+ ->whenCmd(Ship)
40
+ ->thenEvent(Shipped)
41
+ )
42
+
43
+ test("Ship on shipped order produces no events (idempotent)", () =>
44
+ givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]}), Shipped])
45
+ ->whenCmd(Ship)
46
+ ->thenNoEvent
47
+ )
48
+
49
+ test("Ship on cancelled order returns OrderAlreadyCancelled", () =>
50
+ givenEvents([
51
+ Placed({customerId: "cust-1", productIds: ["prod-1"]}),
52
+ Cancelled({productIds: ["prod-1"]}),
53
+ ])
54
+ ->whenCmd(Ship)
55
+ ->thenError(OrderAlreadyCancelled)
56
+ )
57
+
58
+ test("Cancel on non-existent order returns OrderNotFound", () =>
59
+ givenEvents([])
60
+ ->whenCmd(Cancel)
61
+ ->thenError(OrderNotFound)
62
+ )
63
+
64
+ test("Cancel on placed order produces Cancelled", () =>
65
+ givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]})])
66
+ ->whenCmd(Cancel)
67
+ ->thenEvent(Cancelled({productIds: ["prod-1"]}))
68
+ )
69
+
70
+ test("Cancel on shipped order returns OrderAlreadyShipped", () =>
71
+ givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]}), Shipped])
72
+ ->whenCmd(Cancel)
73
+ ->thenError(OrderAlreadyShipped)
74
+ )
75
+
76
+ test("Cancel on cancelled order produces no events (idempotent)", () =>
77
+ givenEvents([
78
+ Placed({customerId: "cust-1", productIds: ["prod-1"]}),
79
+ Cancelled({productIds: ["prod-1"]}),
80
+ ])
81
+ ->whenCmd(Cancel)
82
+ ->thenNoEvent
83
+ )
84
+
85
+ test("Refund on non-existent order returns OrderNotFound", () =>
86
+ givenEvents([])
87
+ ->whenCmd(Refund({reason: "lost-in-transit"}))
88
+ ->thenError(OrderNotFound)
89
+ )
90
+
91
+ test("Refund on placed order returns OrderNotCancelled", () =>
92
+ givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]})])
93
+ ->whenCmd(Refund({reason: "customer-changed-mind"}))
94
+ ->thenError(OrderNotCancelled)
95
+ )
96
+
97
+ test("Refund on shipped order returns OrderNotCancelled", () =>
98
+ givenEvents([Placed({customerId: "cust-1", productIds: ["prod-1"]}), Shipped])
99
+ ->whenCmd(Refund({reason: "delivered-damaged"}))
100
+ ->thenError(OrderNotCancelled)
101
+ )
102
+
103
+ test("Refund on cancelled order produces Refunded", () =>
104
+ givenEvents([
105
+ Placed({customerId: "cust-1", productIds: ["prod-1"]}),
106
+ Cancelled({productIds: ["prod-1"]}),
107
+ ])
108
+ ->whenCmd(Refund({reason: "customer-changed-mind"}))
109
+ ->thenEvent(Refunded({reason: "customer-changed-mind"}))
110
+ )
111
+
112
+ test("Refund on already-refunded order produces no events (idempotent)", () =>
113
+ givenEvents([
114
+ Placed({customerId: "cust-1", productIds: ["prod-1"]}),
115
+ Cancelled({productIds: ["prod-1"]}),
116
+ Refunded({reason: "customer-changed-mind"}),
117
+ ])
118
+ ->whenCmd(Refund({reason: "customer-changed-mind"}))
119
+ ->thenNoEvent
120
+ )
121
+ })