@reventlessdev/online-shop-aggregates-catalog 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.
- package/CHANGELOG.md +854 -0
- package/LICENSE +202 -0
- package/__mocks__/emptyModule.js +1 -0
- package/lib/bs/.compiler.log +2 -0
- package/lib/bs/CatalogPlugin.cmi +0 -0
- package/lib/bs/CatalogPlugin.cmj +0 -0
- package/lib/bs/CatalogPlugin.cmt +0 -0
- package/lib/bs/CatalogPlugin.mlmap +25 -0
- package/lib/bs/build.ninja +0 -0
- package/lib/bs/compiler-info.json +8 -0
- package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Category/Aggregate/Category.ast +0 -0
- package/lib/bs/src/Category/Aggregate/Category.res +22 -0
- package/lib/bs/src/Category/Aggregate/Category.res.mjs +61 -0
- package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Category/Aggregate/Category_Behavior.ast +0 -0
- package/lib/bs/src/Category/Aggregate/Category_Behavior.res +36 -0
- package/lib/bs/src/Category/Aggregate/Category_Behavior.res.mjs +106 -0
- package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Category/ReadModel/Categories.ast +0 -0
- package/lib/bs/src/Category/ReadModel/Categories.res +11 -0
- package/lib/bs/src/Category/ReadModel/Categories.res.mjs +35 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections.ast +0 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections.res +19 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections.res.mjs +75 -0
- package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Extension/Orders_Extension.ast +0 -0
- package/lib/bs/src/Extension/Orders_Extension.res +23 -0
- package/lib/bs/src/Extension/Orders_Extension.res.mjs +42 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.ast +0 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.res +19 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs +56 -0
- package/lib/bs/src/Plugin-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Plugin-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Plugin.ast +0 -0
- package/lib/bs/src/Plugin.res +65 -0
- package/lib/bs/src/Plugin.res.mjs +222 -0
- package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Product/Aggregate/Product.ast +0 -0
- package/lib/bs/src/Product/Aggregate/Product.res +23 -0
- package/lib/bs/src/Product/Aggregate/Product.res.mjs +71 -0
- package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Product/Aggregate/Product_Behavior.ast +0 -0
- package/lib/bs/src/Product/Aggregate/Product_Behavior.res +38 -0
- package/lib/bs/src/Product/Aggregate/Product_Behavior.res.mjs +150 -0
- package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Product/ReadModel/Products.ast +0 -0
- package/lib/bs/src/Product/ReadModel/Products.res +12 -0
- package/lib/bs/src/Product/ReadModel/Products.res.mjs +36 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections.ast +0 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections.res +22 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections.res.mjs +91 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand.ast +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand.res +20 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand.res.mjs +51 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior.ast +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior.res +39 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior.res.mjs +102 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands.ast +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands.res +8 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands.res.mjs +35 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.ast +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.res +36 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.res.mjs +99 -0
- package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmj +0 -0
- package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Task/ImportProducts.ast +0 -0
- package/lib/bs/src/Task/ImportProducts.res +48 -0
- package/lib/bs/src/Task/ImportProducts.res.mjs +58 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT.ast +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT.res +51 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT.res.mjs +125 -0
- package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/ReadModel/Categories_GWT.ast +0 -0
- package/lib/bs/tests/Category/ReadModel/Categories_GWT.res +21 -0
- package/lib/bs/tests/Category/ReadModel/Categories_GWT.res.mjs +88 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT.ast +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT.res +21 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT.res.mjs +105 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +31 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res.mjs +114 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT.ast +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT.res +69 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT.res.mjs +166 -0
- package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/ReadModel/Products_GWT.ast +0 -0
- package/lib/bs/tests/Product/ReadModel/Products_GWT.res +27 -0
- package/lib/bs/tests/Product/ReadModel/Products_GWT.res.mjs +113 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.ast +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +39 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +114 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmj +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.ast +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +56 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.res.mjs +73 -0
- package/lib/ocaml/.compiler.log +2 -0
- package/lib/ocaml/CatalogPlugin.cmi +0 -0
- package/lib/ocaml/CatalogPlugin.cmj +0 -0
- package/lib/ocaml/CatalogPlugin.cmt +0 -0
- package/lib/ocaml/CatalogPlugin.mlmap +25 -0
- package/lib/ocaml/Categories-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Categories-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Categories.ast +0 -0
- package/lib/ocaml/Categories.res +11 -0
- package/lib/ocaml/Categories_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Categories_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Categories_GWT.ast +0 -0
- package/lib/ocaml/Categories_GWT.res +21 -0
- package/lib/ocaml/Categories_Projections-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories_Projections-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Categories_Projections-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Categories_Projections.ast +0 -0
- package/lib/ocaml/Categories_Projections.res +19 -0
- package/lib/ocaml/Category-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Category-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Category-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Category.ast +0 -0
- package/lib/ocaml/Category.res +22 -0
- package/lib/ocaml/Category_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Category_Behavior-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Category_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Category_Behavior.ast +0 -0
- package/lib/ocaml/Category_Behavior.res +36 -0
- package/lib/ocaml/Category_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Category_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Category_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Category_GWT.ast +0 -0
- package/lib/ocaml/Category_GWT.res +51 -0
- package/lib/ocaml/ImportProducts-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ImportProducts-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/ImportProducts-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ImportProducts.ast +0 -0
- package/lib/ocaml/ImportProducts.res +48 -0
- package/lib/ocaml/Orders_Extension-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Extension-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Orders_Extension-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Orders_Extension.ast +0 -0
- package/lib/ocaml/Orders_Extension.res +23 -0
- package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Orders_Extension_GWT.ast +0 -0
- package/lib/ocaml/Orders_Extension_GWT.res +21 -0
- package/lib/ocaml/Plugin-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Plugin-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Plugin.ast +0 -0
- package/lib/ocaml/Plugin.res +65 -0
- package/lib/ocaml/Product-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Product-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Product-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Product.ast +0 -0
- package/lib/ocaml/Product.res +23 -0
- package/lib/ocaml/ProductDemand-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/ProductDemand-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemand.ast +0 -0
- package/lib/ocaml/ProductDemand.res +20 -0
- package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemand_Behavior.ast +0 -0
- package/lib/ocaml/ProductDemand_Behavior.res +39 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemand_GWT.ast +0 -0
- package/lib/ocaml/ProductDemand_GWT.res +39 -0
- package/lib/ocaml/ProductDemands-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/ProductDemands-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands.ast +0 -0
- package/lib/ocaml/ProductDemands.res +8 -0
- package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands_GWT.ast +0 -0
- package/lib/ocaml/ProductDemands_GWT.res +56 -0
- package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands_Projections.ast +0 -0
- package/lib/ocaml/ProductDemands_Projections.res +36 -0
- package/lib/ocaml/Product_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Product_Behavior-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Product_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Product_Behavior.ast +0 -0
- package/lib/ocaml/Product_Behavior.res +38 -0
- package/lib/ocaml/Product_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Product_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Product_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Product_GWT.ast +0 -0
- package/lib/ocaml/Product_GWT.res +69 -0
- package/lib/ocaml/Products-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Products-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products.ast +0 -0
- package/lib/ocaml/Products.res +12 -0
- package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping.ast +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping.res +19 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT.res +31 -0
- package/lib/ocaml/Products_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_GWT-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Products_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_GWT.ast +0 -0
- package/lib/ocaml/Products_GWT.res +27 -0
- package/lib/ocaml/Products_Projections-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_Projections-CatalogPlugin.cmj +0 -0
- package/lib/ocaml/Products_Projections-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_Projections.ast +0 -0
- package/lib/ocaml/Products_Projections.res +22 -0
- package/package.json +52 -0
- package/rescript.json +39 -0
- package/src/Category/Aggregate/Category.res +22 -0
- package/src/Category/Aggregate/Category.res.mjs +61 -0
- package/src/Category/Aggregate/Category_Behavior.res +36 -0
- package/src/Category/Aggregate/Category_Behavior.res.mjs +106 -0
- package/src/Category/ReadModel/Categories.res +11 -0
- package/src/Category/ReadModel/Categories.res.mjs +35 -0
- package/src/Category/ReadModel/Categories_Projections.res +19 -0
- package/src/Category/ReadModel/Categories_Projections.res.mjs +75 -0
- package/src/Extension/Orders_Extension.res +23 -0
- package/src/Extension/Orders_Extension.res.mjs +42 -0
- package/src/ExtensionPoint/Products_ExtensionPointMapping.res +19 -0
- package/src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs +56 -0
- package/src/Plugin.res +65 -0
- package/src/Plugin.res.mjs +222 -0
- package/src/Product/Aggregate/Product.res +23 -0
- package/src/Product/Aggregate/Product.res.mjs +71 -0
- package/src/Product/Aggregate/Product_Behavior.res +38 -0
- package/src/Product/Aggregate/Product_Behavior.res.mjs +150 -0
- package/src/Product/ReadModel/Products.res +12 -0
- package/src/Product/ReadModel/Products.res.mjs +36 -0
- package/src/Product/ReadModel/Products_Projections.res +22 -0
- package/src/Product/ReadModel/Products_Projections.res.mjs +91 -0
- package/src/ProductDemand/Aggregate/ProductDemand.res +20 -0
- package/src/ProductDemand/Aggregate/ProductDemand.res.mjs +51 -0
- package/src/ProductDemand/Aggregate/ProductDemand_Behavior.res +39 -0
- package/src/ProductDemand/Aggregate/ProductDemand_Behavior.res.mjs +102 -0
- package/src/ProductDemand/ReadModel/ProductDemands.res +8 -0
- package/src/ProductDemand/ReadModel/ProductDemands.res.mjs +35 -0
- package/src/ProductDemand/ReadModel/ProductDemands_Projections.res +36 -0
- package/src/ProductDemand/ReadModel/ProductDemands_Projections.res.mjs +99 -0
- package/src/Task/ImportProducts.res +48 -0
- package/src/Task/ImportProducts.res.mjs +58 -0
- package/src/plugin.json +1 -0
- package/tests/Category/Aggregate/Category_GWT.res +51 -0
- package/tests/Category/Aggregate/Category_GWT.res.mjs +125 -0
- package/tests/Category/ReadModel/Categories_GWT.res +21 -0
- package/tests/Category/ReadModel/Categories_GWT.res.mjs +88 -0
- package/tests/Extension/Orders_Extension_GWT.res +21 -0
- package/tests/Extension/Orders_Extension_GWT.res.mjs +105 -0
- package/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +31 -0
- package/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res.mjs +114 -0
- package/tests/Product/Aggregate/Product_GWT.res +69 -0
- package/tests/Product/Aggregate/Product_GWT.res.mjs +166 -0
- package/tests/Product/ReadModel/Products_GWT.res +27 -0
- package/tests/Product/ReadModel/Products_GWT.res.mjs +113 -0
- package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +39 -0
- package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +114 -0
- package/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +56 -0
- package/tests/ProductDemand/ReadModel/ProductDemands_GWT.res.mjs +73 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Categories_Projections$CatalogPlugin from "../../../src/Category/ReadModel/Categories_Projections.res.mjs";
|
|
4
|
+
import * as MultiSourceProjection_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/MultiSourceProjection_GWT.res.mjs";
|
|
5
|
+
|
|
6
|
+
let include = MultiSourceProjection_GWT$ReventlessGwt.Make(Categories_Projections$CatalogPlugin.CategoryMapping);
|
|
7
|
+
|
|
8
|
+
let describe = include.describe;
|
|
9
|
+
|
|
10
|
+
let test = include.test;
|
|
11
|
+
|
|
12
|
+
let givenEvents = include.givenEvents;
|
|
13
|
+
|
|
14
|
+
let whenEvent = include.whenEvent;
|
|
15
|
+
|
|
16
|
+
let thenState = include.thenState;
|
|
17
|
+
|
|
18
|
+
describe("Categories ReadModel ← Category", () => {
|
|
19
|
+
test("Added sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
|
|
20
|
+
TAG: "Added",
|
|
21
|
+
name: "Electronics"
|
|
22
|
+
}), {
|
|
23
|
+
name: "Electronics",
|
|
24
|
+
archived: false
|
|
25
|
+
}));
|
|
26
|
+
test("Renamed updates the name", undefined, () => thenState(whenEvent(givenEvents([{
|
|
27
|
+
TAG: "Added",
|
|
28
|
+
name: "Electronics"
|
|
29
|
+
}]), {
|
|
30
|
+
TAG: "Renamed",
|
|
31
|
+
name: "Consumer Electronics"
|
|
32
|
+
}), {
|
|
33
|
+
name: "Consumer Electronics",
|
|
34
|
+
archived: false
|
|
35
|
+
}));
|
|
36
|
+
test("Archived sets archived flag", undefined, () => thenState(whenEvent(givenEvents([{
|
|
37
|
+
TAG: "Added",
|
|
38
|
+
name: "Electronics"
|
|
39
|
+
}]), "Archived"), {
|
|
40
|
+
name: "Electronics",
|
|
41
|
+
archived: true
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
let describeWithId = include.describeWithId;
|
|
46
|
+
|
|
47
|
+
let givenEventsWithTime = include.givenEventsWithTime;
|
|
48
|
+
|
|
49
|
+
let whenEvents = include.whenEvents;
|
|
50
|
+
|
|
51
|
+
let whenEventWithTime = include.whenEventWithTime;
|
|
52
|
+
|
|
53
|
+
let whenEventsWithTime = include.whenEventsWithTime;
|
|
54
|
+
|
|
55
|
+
let thenStates = include.thenStates;
|
|
56
|
+
|
|
57
|
+
let thenStatesWithId = include.thenStatesWithId;
|
|
58
|
+
|
|
59
|
+
let thenAllStates = include.thenAllStates;
|
|
60
|
+
|
|
61
|
+
let thenStateWithId = include.thenStateWithId;
|
|
62
|
+
|
|
63
|
+
let thenNoState = include.thenNoState;
|
|
64
|
+
|
|
65
|
+
let thenThrow = include.thenThrow;
|
|
66
|
+
|
|
67
|
+
let thenFail = include.thenFail;
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
describe,
|
|
71
|
+
describeWithId,
|
|
72
|
+
test,
|
|
73
|
+
givenEvents,
|
|
74
|
+
givenEventsWithTime,
|
|
75
|
+
whenEvent,
|
|
76
|
+
whenEvents,
|
|
77
|
+
whenEventWithTime,
|
|
78
|
+
whenEventsWithTime,
|
|
79
|
+
thenStates,
|
|
80
|
+
thenStatesWithId,
|
|
81
|
+
thenAllStates,
|
|
82
|
+
thenState,
|
|
83
|
+
thenStateWithId,
|
|
84
|
+
thenNoState,
|
|
85
|
+
thenThrow,
|
|
86
|
+
thenFail,
|
|
87
|
+
}
|
|
88
|
+
/* include Not a pure module */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Boundary GWT for Catalog's Orders extension: public Ordering events become
|
|
2
|
+
// ProductDemand commands on Catalog's aggregate.
|
|
3
|
+
@@reventless.gwt
|
|
4
|
+
|
|
5
|
+
// `Mapping` is brought into scope by the PPX `open Orders_Extension`; opening
|
|
6
|
+
// it surfaces the extension point's events and the delegate's commands.
|
|
7
|
+
open Mapping
|
|
8
|
+
|
|
9
|
+
describe("Orders Extension delegate", () => {
|
|
10
|
+
test("ItemOrdered records demand for the product", () =>
|
|
11
|
+
whenIncomingEvent(
|
|
12
|
+
ExtensionPoint.ItemOrdered({productId: "p1", orderId: "o1", customerId: "c1"}),
|
|
13
|
+
)->thenPublishesAggregateCommand("p1", Delegate.Record({orderId: "o1"}))
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("ItemOrderCancelled revokes demand for the product", () =>
|
|
17
|
+
whenIncomingEvent(
|
|
18
|
+
ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "o1"}),
|
|
19
|
+
)->thenPublishesAggregateCommand("p1", Delegate.Revoke({orderId: "o1"}))
|
|
20
|
+
)
|
|
21
|
+
})
|
|
@@ -0,0 +1,105 @@
|
|
|
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 Delegate_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Delegate_GWT.res.mjs";
|
|
5
|
+
import * as ProductDemand$CatalogPlugin from "../../src/ProductDemand/Aggregate/ProductDemand.res.mjs";
|
|
6
|
+
import * as Orders_Extension$CatalogPlugin from "../../src/Extension/Orders_Extension.res.mjs";
|
|
7
|
+
import * as Orders_ExtensionPoint$OrderingSpec from "@reventlessdev/online-shop-aggregates-ordering-spec/src/Orders_ExtensionPoint.res.mjs";
|
|
8
|
+
|
|
9
|
+
let include = Delegate_GWT$ReventlessGwt.FromExtension({
|
|
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: ProductDemand$CatalogPlugin.name,
|
|
20
|
+
eventSchema: ProductDemand$CatalogPlugin.eventSchema,
|
|
21
|
+
errorSchema: ProductDemand$CatalogPlugin.errorSchema,
|
|
22
|
+
commandSchema: ProductDemand$CatalogPlugin.commandSchema,
|
|
23
|
+
moduleUrl: ProductDemand$CatalogPlugin.moduleUrl,
|
|
24
|
+
commandAuthorization: ProductDemand$CatalogPlugin.commandAuthorization
|
|
25
|
+
},
|
|
26
|
+
moduleUrl: Orders_Extension$CatalogPlugin.Mapping.moduleUrl,
|
|
27
|
+
delegateModuleUrl: Orders_Extension$CatalogPlugin.Mapping.delegateModuleUrl,
|
|
28
|
+
mapIncomingEvent: Orders_Extension$CatalogPlugin.Mapping.mapIncomingEvent,
|
|
29
|
+
mapOutgoingEvent: Orders_Extension$CatalogPlugin.Mapping.mapOutgoingEvent
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
let describe = include.describe;
|
|
33
|
+
|
|
34
|
+
let test = include.test;
|
|
35
|
+
|
|
36
|
+
let whenIncomingEvent = include.whenIncomingEvent;
|
|
37
|
+
|
|
38
|
+
let thenPublishesAggregateCommand = include.thenPublishesAggregateCommand;
|
|
39
|
+
|
|
40
|
+
describe("Orders Extension delegate", () => {
|
|
41
|
+
test("ItemOrdered records demand for the product", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
|
|
42
|
+
TAG: "ItemOrdered",
|
|
43
|
+
productId: "p1",
|
|
44
|
+
orderId: "o1",
|
|
45
|
+
customerId: "c1"
|
|
46
|
+
}), "p1", {
|
|
47
|
+
TAG: "Record",
|
|
48
|
+
orderId: "o1"
|
|
49
|
+
}));
|
|
50
|
+
test("ItemOrderCancelled revokes demand for the product", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
|
|
51
|
+
TAG: "ItemOrderCancelled",
|
|
52
|
+
productId: "p1",
|
|
53
|
+
orderId: "o1"
|
|
54
|
+
}), "p1", {
|
|
55
|
+
TAG: "Revoke",
|
|
56
|
+
orderId: "o1"
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
let encCmd = include.encCmd;
|
|
61
|
+
|
|
62
|
+
let encEpCmd = include.encEpCmd;
|
|
63
|
+
|
|
64
|
+
let encDirective = include.encDirective;
|
|
65
|
+
|
|
66
|
+
let EvCore = include.EvCore;
|
|
67
|
+
|
|
68
|
+
let OutCore = include.OutCore;
|
|
69
|
+
|
|
70
|
+
let thenPublishesNothing = include.thenPublishesNothing;
|
|
71
|
+
|
|
72
|
+
let thenPublishesCommand = include.thenPublishesCommand;
|
|
73
|
+
|
|
74
|
+
let thenPublishesCommands = include.thenPublishesCommands;
|
|
75
|
+
|
|
76
|
+
let whenDelegateEvent = include.whenDelegateEvent;
|
|
77
|
+
|
|
78
|
+
let thenPublishesExtensionPointCommand = include.thenPublishesExtensionPointCommand;
|
|
79
|
+
|
|
80
|
+
let thenHandlesDirective = include.thenHandlesDirective;
|
|
81
|
+
|
|
82
|
+
let thenHandlesDirectives = include.thenHandlesDirectives;
|
|
83
|
+
|
|
84
|
+
let thenHandlesNoDirective = include.thenHandlesNoDirective;
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
encCmd,
|
|
88
|
+
encEpCmd,
|
|
89
|
+
encDirective,
|
|
90
|
+
EvCore,
|
|
91
|
+
OutCore,
|
|
92
|
+
describe,
|
|
93
|
+
test,
|
|
94
|
+
thenPublishesNothing,
|
|
95
|
+
whenIncomingEvent,
|
|
96
|
+
thenPublishesCommand,
|
|
97
|
+
thenPublishesCommands,
|
|
98
|
+
thenPublishesAggregateCommand,
|
|
99
|
+
whenDelegateEvent,
|
|
100
|
+
thenPublishesExtensionPointCommand,
|
|
101
|
+
thenHandlesDirective,
|
|
102
|
+
thenHandlesDirectives,
|
|
103
|
+
thenHandlesNoDirective,
|
|
104
|
+
}
|
|
105
|
+
/* include Not a pure module */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Boundary GWT for the Products extension point: internal Product aggregate
|
|
2
|
+
// events become the stable public events Ordering subscribes to.
|
|
3
|
+
@@reventless.gwt
|
|
4
|
+
|
|
5
|
+
describe("Products ExtensionPoint mapping", () => {
|
|
6
|
+
test("Added publishes ProductBecameAvailable", () =>
|
|
7
|
+
whenDelegateEvent(
|
|
8
|
+
Delegate.Added({name: "Book", description: "A good book", price: 9.99}),
|
|
9
|
+
)->thenPublishesEvent(
|
|
10
|
+
"gwt-id",
|
|
11
|
+
ExtensionPoint.ProductBecameAvailable({productId: "gwt-id", name: "Book", price: 9.99}),
|
|
12
|
+
)
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
test("PriceUpdated publishes ProductPriceChanged", () =>
|
|
16
|
+
whenDelegateEvent(Delegate.PriceUpdated({price: 7.5}))->thenPublishesEvent(
|
|
17
|
+
"gwt-id",
|
|
18
|
+
ExtensionPoint.ProductPriceChanged({productId: "gwt-id", price: 7.5}),
|
|
19
|
+
)
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
test("NameUpdated publishes nothing", () =>
|
|
23
|
+
whenDelegateEvent(Delegate.NameUpdated({name: "Better Book"}))->thenPublishesNothing
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
test("DescriptionUpdated publishes nothing", () =>
|
|
27
|
+
whenDelegateEvent(
|
|
28
|
+
Delegate.DescriptionUpdated({description: "A really good book"}),
|
|
29
|
+
)->thenPublishesNothing
|
|
30
|
+
)
|
|
31
|
+
})
|
|
@@ -0,0 +1,114 @@
|
|
|
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 Product$CatalogPlugin from "../../src/Product/Aggregate/Product.res.mjs";
|
|
5
|
+
import * as Delegate_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Delegate_GWT.res.mjs";
|
|
6
|
+
import * as Products_ExtensionPoint$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/Products_ExtensionPoint.res.mjs";
|
|
7
|
+
import * as Products_ExtensionPointMapping$CatalogPlugin from "../../src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs";
|
|
8
|
+
|
|
9
|
+
let include = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
|
|
10
|
+
ExtensionPoint: {
|
|
11
|
+
name: Products_ExtensionPoint$CatalogSpec.name,
|
|
12
|
+
moduleUrl: Products_ExtensionPoint$CatalogSpec.moduleUrl,
|
|
13
|
+
commandSchema: Products_ExtensionPoint$CatalogSpec.commandSchema,
|
|
14
|
+
eventSchema: Products_ExtensionPoint$CatalogSpec.eventSchema,
|
|
15
|
+
directiveSchema: Products_ExtensionPoint$CatalogSpec.directiveSchema
|
|
16
|
+
},
|
|
17
|
+
Delegate: {
|
|
18
|
+
Id: Id$Reventless.$$String,
|
|
19
|
+
name: Product$CatalogPlugin.name,
|
|
20
|
+
eventSchema: Product$CatalogPlugin.eventSchema,
|
|
21
|
+
errorSchema: Product$CatalogPlugin.errorSchema,
|
|
22
|
+
commandSchema: Product$CatalogPlugin.commandSchema,
|
|
23
|
+
moduleUrl: Product$CatalogPlugin.moduleUrl,
|
|
24
|
+
commandAuthorization: Product$CatalogPlugin.commandAuthorization
|
|
25
|
+
},
|
|
26
|
+
moduleUrl: Products_ExtensionPointMapping$CatalogPlugin.moduleUrl,
|
|
27
|
+
mapIncomingCommand: Products_ExtensionPointMapping$CatalogPlugin.mapIncomingCommand,
|
|
28
|
+
mapOutgoingEvent: Products_ExtensionPointMapping$CatalogPlugin.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 thenPublishesEvent = include.thenPublishesEvent;
|
|
40
|
+
|
|
41
|
+
describe("Products ExtensionPoint mapping", () => {
|
|
42
|
+
test("Added publishes ProductBecameAvailable", undefined, () => thenPublishesEvent(whenDelegateEvent({
|
|
43
|
+
TAG: "Added",
|
|
44
|
+
name: "Book",
|
|
45
|
+
description: "A good book",
|
|
46
|
+
price: 9.99
|
|
47
|
+
}), "gwt-id", {
|
|
48
|
+
TAG: "ProductBecameAvailable",
|
|
49
|
+
productId: "gwt-id",
|
|
50
|
+
name: "Book",
|
|
51
|
+
price: 9.99
|
|
52
|
+
}));
|
|
53
|
+
test("PriceUpdated publishes ProductPriceChanged", undefined, () => thenPublishesEvent(whenDelegateEvent({
|
|
54
|
+
TAG: "PriceUpdated",
|
|
55
|
+
price: 7.5
|
|
56
|
+
}), "gwt-id", {
|
|
57
|
+
TAG: "ProductPriceChanged",
|
|
58
|
+
productId: "gwt-id",
|
|
59
|
+
price: 7.5
|
|
60
|
+
}));
|
|
61
|
+
test("NameUpdated publishes nothing", undefined, () => thenPublishesNothing(whenDelegateEvent({
|
|
62
|
+
TAG: "NameUpdated",
|
|
63
|
+
name: "Better Book"
|
|
64
|
+
})));
|
|
65
|
+
test("DescriptionUpdated publishes nothing", undefined, () => thenPublishesNothing(whenDelegateEvent({
|
|
66
|
+
TAG: "DescriptionUpdated",
|
|
67
|
+
description: "A really good book"
|
|
68
|
+
})));
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
let encEvent = include.encEvent;
|
|
72
|
+
|
|
73
|
+
let encCommand = include.encCommand;
|
|
74
|
+
|
|
75
|
+
let encDirective = include.encDirective;
|
|
76
|
+
|
|
77
|
+
let EvCore = include.EvCore;
|
|
78
|
+
|
|
79
|
+
let CmdCore = include.CmdCore;
|
|
80
|
+
|
|
81
|
+
let thenPublishesEvents = include.thenPublishesEvents;
|
|
82
|
+
|
|
83
|
+
let whenIncomingCommand = include.whenIncomingCommand;
|
|
84
|
+
|
|
85
|
+
let thenPublishesCommand = include.thenPublishesCommand;
|
|
86
|
+
|
|
87
|
+
let thenPublishesCommands = include.thenPublishesCommands;
|
|
88
|
+
|
|
89
|
+
let thenHandlesDirective = include.thenHandlesDirective;
|
|
90
|
+
|
|
91
|
+
let thenHandlesDirectives = include.thenHandlesDirectives;
|
|
92
|
+
|
|
93
|
+
let thenHandlesNoDirective = include.thenHandlesNoDirective;
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
encEvent,
|
|
97
|
+
encCommand,
|
|
98
|
+
encDirective,
|
|
99
|
+
EvCore,
|
|
100
|
+
CmdCore,
|
|
101
|
+
describe,
|
|
102
|
+
test,
|
|
103
|
+
thenPublishesNothing,
|
|
104
|
+
whenDelegateEvent,
|
|
105
|
+
thenPublishesEvent,
|
|
106
|
+
thenPublishesEvents,
|
|
107
|
+
whenIncomingCommand,
|
|
108
|
+
thenPublishesCommand,
|
|
109
|
+
thenPublishesCommands,
|
|
110
|
+
thenHandlesDirective,
|
|
111
|
+
thenHandlesDirectives,
|
|
112
|
+
thenHandlesNoDirective,
|
|
113
|
+
}
|
|
114
|
+
/* include Not a pure module */
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@@reventless.gwt
|
|
2
|
+
|
|
3
|
+
describe("Product Behavior", () => {
|
|
4
|
+
test("Add on new aggregate produces Added", () =>
|
|
5
|
+
givenEvents([])
|
|
6
|
+
->whenCmd(Add({name: "Laptop", description: "A laptop", price: 999.99}))
|
|
7
|
+
->thenEvent(Added({name: "Laptop", description: "A laptop", price: 999.99}))
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
test("Add on existing aggregate returns ProductAlreadyExists", () =>
|
|
11
|
+
givenEvents([Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
12
|
+
->whenCmd(Add({name: "Laptop 2", description: "Another", price: 1.0}))
|
|
13
|
+
->thenError(ProductAlreadyExists)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("UpdateName on non-existent aggregate returns ProductNotFound", () =>
|
|
17
|
+
givenEvents([])
|
|
18
|
+
->whenCmd(UpdateName({name: "New Name"}))
|
|
19
|
+
->thenError(ProductNotFound)
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
test("UpdateName on existing product produces NameUpdated", () =>
|
|
23
|
+
givenEvents([Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
24
|
+
->whenCmd(UpdateName({name: "Gaming Laptop"}))
|
|
25
|
+
->thenEvent(NameUpdated({name: "Gaming Laptop"}))
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
test("UpdateName to same name produces no events (idempotent)", () =>
|
|
29
|
+
givenEvents([Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
30
|
+
->whenCmd(UpdateName({name: "Laptop"}))
|
|
31
|
+
->thenNoEvent
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
test("UpdateDescription on non-existent aggregate returns ProductNotFound", () =>
|
|
35
|
+
givenEvents([])
|
|
36
|
+
->whenCmd(UpdateDescription({description: "x"}))
|
|
37
|
+
->thenError(ProductNotFound)
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
test("UpdateDescription on existing product produces DescriptionUpdated", () =>
|
|
41
|
+
givenEvents([Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
42
|
+
->whenCmd(UpdateDescription({description: "A high-end laptop"}))
|
|
43
|
+
->thenEvent(DescriptionUpdated({description: "A high-end laptop"}))
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
test("UpdateDescription to same description produces no events (idempotent)", () =>
|
|
47
|
+
givenEvents([Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
48
|
+
->whenCmd(UpdateDescription({description: "A laptop"}))
|
|
49
|
+
->thenNoEvent
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
test("UpdatePrice on non-existent aggregate returns ProductNotFound", () =>
|
|
53
|
+
givenEvents([])
|
|
54
|
+
->whenCmd(UpdatePrice({price: 1.0}))
|
|
55
|
+
->thenError(ProductNotFound)
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
test("UpdatePrice on existing product produces PriceUpdated", () =>
|
|
59
|
+
givenEvents([Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
60
|
+
->whenCmd(UpdatePrice({price: 899.99}))
|
|
61
|
+
->thenEvent(PriceUpdated({price: 899.99}))
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
test("UpdatePrice to same price produces no events (idempotent)", () =>
|
|
65
|
+
givenEvents([Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
66
|
+
->whenCmd(UpdatePrice({price: 999.99}))
|
|
67
|
+
->thenNoEvent
|
|
68
|
+
)
|
|
69
|
+
})
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Product$CatalogPlugin from "../../../src/Product/Aggregate/Product.res.mjs";
|
|
4
|
+
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
5
|
+
import * as Product_Behavior$CatalogPlugin from "../../../src/Product/Aggregate/Product_Behavior.res.mjs";
|
|
6
|
+
|
|
7
|
+
let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
|
|
8
|
+
name: Product$CatalogPlugin.name,
|
|
9
|
+
commandSchema: Product$CatalogPlugin.commandSchema,
|
|
10
|
+
eventSchema: Product$CatalogPlugin.eventSchema,
|
|
11
|
+
errorSchema: Product$CatalogPlugin.errorSchema
|
|
12
|
+
})({
|
|
13
|
+
Spec: {
|
|
14
|
+
name: Product$CatalogPlugin.name,
|
|
15
|
+
commandSchema: Product$CatalogPlugin.commandSchema,
|
|
16
|
+
eventSchema: Product$CatalogPlugin.eventSchema,
|
|
17
|
+
errorSchema: Product$CatalogPlugin.errorSchema
|
|
18
|
+
},
|
|
19
|
+
initialState: Product_Behavior$CatalogPlugin.initialState,
|
|
20
|
+
evolve: Product_Behavior$CatalogPlugin.evolve,
|
|
21
|
+
decide: Product_Behavior$CatalogPlugin.decide,
|
|
22
|
+
moduleUrl: Product_Behavior$CatalogPlugin.moduleUrl
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
let describe = include.describe;
|
|
26
|
+
|
|
27
|
+
let test = include.test;
|
|
28
|
+
|
|
29
|
+
let givenEvents = include.givenEvents;
|
|
30
|
+
|
|
31
|
+
let whenCmd = include.whenCmd;
|
|
32
|
+
|
|
33
|
+
let thenEvent = include.thenEvent;
|
|
34
|
+
|
|
35
|
+
let thenNoEvent = include.thenNoEvent;
|
|
36
|
+
|
|
37
|
+
let thenError = include.thenError;
|
|
38
|
+
|
|
39
|
+
describe("Product Behavior", () => {
|
|
40
|
+
test("Add on new aggregate produces Added", () => thenEvent(whenCmd(givenEvents([]), {
|
|
41
|
+
TAG: "Add",
|
|
42
|
+
name: "Laptop",
|
|
43
|
+
description: "A laptop",
|
|
44
|
+
price: 999.99
|
|
45
|
+
}), {
|
|
46
|
+
TAG: "Added",
|
|
47
|
+
name: "Laptop",
|
|
48
|
+
description: "A laptop",
|
|
49
|
+
price: 999.99
|
|
50
|
+
}));
|
|
51
|
+
test("Add on existing aggregate returns ProductAlreadyExists", () => thenError(whenCmd(givenEvents([{
|
|
52
|
+
TAG: "Added",
|
|
53
|
+
name: "Laptop",
|
|
54
|
+
description: "A laptop",
|
|
55
|
+
price: 999.99
|
|
56
|
+
}]), {
|
|
57
|
+
TAG: "Add",
|
|
58
|
+
name: "Laptop 2",
|
|
59
|
+
description: "Another",
|
|
60
|
+
price: 1.0
|
|
61
|
+
}), "ProductAlreadyExists"));
|
|
62
|
+
test("UpdateName on non-existent aggregate returns ProductNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
63
|
+
TAG: "UpdateName",
|
|
64
|
+
name: "New Name"
|
|
65
|
+
}), "ProductNotFound"));
|
|
66
|
+
test("UpdateName on existing product produces NameUpdated", () => thenEvent(whenCmd(givenEvents([{
|
|
67
|
+
TAG: "Added",
|
|
68
|
+
name: "Laptop",
|
|
69
|
+
description: "A laptop",
|
|
70
|
+
price: 999.99
|
|
71
|
+
}]), {
|
|
72
|
+
TAG: "UpdateName",
|
|
73
|
+
name: "Gaming Laptop"
|
|
74
|
+
}), {
|
|
75
|
+
TAG: "NameUpdated",
|
|
76
|
+
name: "Gaming Laptop"
|
|
77
|
+
}));
|
|
78
|
+
test("UpdateName to same name produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
79
|
+
TAG: "Added",
|
|
80
|
+
name: "Laptop",
|
|
81
|
+
description: "A laptop",
|
|
82
|
+
price: 999.99
|
|
83
|
+
}]), {
|
|
84
|
+
TAG: "UpdateName",
|
|
85
|
+
name: "Laptop"
|
|
86
|
+
})));
|
|
87
|
+
test("UpdateDescription on non-existent aggregate returns ProductNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
88
|
+
TAG: "UpdateDescription",
|
|
89
|
+
description: "x"
|
|
90
|
+
}), "ProductNotFound"));
|
|
91
|
+
test("UpdateDescription on existing product produces DescriptionUpdated", () => thenEvent(whenCmd(givenEvents([{
|
|
92
|
+
TAG: "Added",
|
|
93
|
+
name: "Laptop",
|
|
94
|
+
description: "A laptop",
|
|
95
|
+
price: 999.99
|
|
96
|
+
}]), {
|
|
97
|
+
TAG: "UpdateDescription",
|
|
98
|
+
description: "A high-end laptop"
|
|
99
|
+
}), {
|
|
100
|
+
TAG: "DescriptionUpdated",
|
|
101
|
+
description: "A high-end laptop"
|
|
102
|
+
}));
|
|
103
|
+
test("UpdateDescription to same description produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
104
|
+
TAG: "Added",
|
|
105
|
+
name: "Laptop",
|
|
106
|
+
description: "A laptop",
|
|
107
|
+
price: 999.99
|
|
108
|
+
}]), {
|
|
109
|
+
TAG: "UpdateDescription",
|
|
110
|
+
description: "A laptop"
|
|
111
|
+
})));
|
|
112
|
+
test("UpdatePrice on non-existent aggregate returns ProductNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
113
|
+
TAG: "UpdatePrice",
|
|
114
|
+
price: 1.0
|
|
115
|
+
}), "ProductNotFound"));
|
|
116
|
+
test("UpdatePrice on existing product produces PriceUpdated", () => thenEvent(whenCmd(givenEvents([{
|
|
117
|
+
TAG: "Added",
|
|
118
|
+
name: "Laptop",
|
|
119
|
+
description: "A laptop",
|
|
120
|
+
price: 999.99
|
|
121
|
+
}]), {
|
|
122
|
+
TAG: "UpdatePrice",
|
|
123
|
+
price: 899.99
|
|
124
|
+
}), {
|
|
125
|
+
TAG: "PriceUpdated",
|
|
126
|
+
price: 899.99
|
|
127
|
+
}));
|
|
128
|
+
test("UpdatePrice to same price produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
129
|
+
TAG: "Added",
|
|
130
|
+
name: "Laptop",
|
|
131
|
+
description: "A laptop",
|
|
132
|
+
price: 999.99
|
|
133
|
+
}]), {
|
|
134
|
+
TAG: "UpdatePrice",
|
|
135
|
+
price: 999.99
|
|
136
|
+
})));
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
let Spec = include.Spec;
|
|
140
|
+
|
|
141
|
+
let thenCompareEvent = include.thenCompareEvent;
|
|
142
|
+
|
|
143
|
+
let thenEventWithError = include.thenEventWithError;
|
|
144
|
+
|
|
145
|
+
let thenEvents = include.thenEvents;
|
|
146
|
+
|
|
147
|
+
let thenCompareEvents = include.thenCompareEvents;
|
|
148
|
+
|
|
149
|
+
let thenEventsWithError = include.thenEventsWithError;
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
Spec,
|
|
153
|
+
describe,
|
|
154
|
+
test,
|
|
155
|
+
givenEvents,
|
|
156
|
+
whenCmd,
|
|
157
|
+
thenEvent,
|
|
158
|
+
thenCompareEvent,
|
|
159
|
+
thenNoEvent,
|
|
160
|
+
thenEventWithError,
|
|
161
|
+
thenEvents,
|
|
162
|
+
thenCompareEvents,
|
|
163
|
+
thenEventsWithError,
|
|
164
|
+
thenError,
|
|
165
|
+
}
|
|
166
|
+
/* include Not a pure module */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@@reventless.gwt(Products_Projections.ProductMapping)
|
|
2
|
+
|
|
3
|
+
describe("Products ReadModel ← Product", () => {
|
|
4
|
+
test("Added sets initial read model state", () =>
|
|
5
|
+
givenEvents([])
|
|
6
|
+
->whenEvent(Product.Added({name: "Laptop", description: "A laptop", price: 999.99}))
|
|
7
|
+
->thenState({Products.name: "Laptop", description: "A laptop", price: 999.99})
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
test("NameUpdated updates the name", () =>
|
|
11
|
+
givenEvents([Product.Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
12
|
+
->whenEvent(Product.NameUpdated({name: "Gaming Laptop"}))
|
|
13
|
+
->thenState({Products.name: "Gaming Laptop", description: "A laptop", price: 999.99})
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("DescriptionUpdated updates the description", () =>
|
|
17
|
+
givenEvents([Product.Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
18
|
+
->whenEvent(Product.DescriptionUpdated({description: "A high-end laptop"}))
|
|
19
|
+
->thenState({Products.name: "Laptop", description: "A high-end laptop", price: 999.99})
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
test("PriceUpdated updates the price", () =>
|
|
23
|
+
givenEvents([Product.Added({name: "Laptop", description: "A laptop", price: 999.99})])
|
|
24
|
+
->whenEvent(Product.PriceUpdated({price: 899.99}))
|
|
25
|
+
->thenState({Products.name: "Laptop", description: "A laptop", price: 899.99})
|
|
26
|
+
)
|
|
27
|
+
})
|