@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,114 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
4
|
+
import * as ProductDemand$CatalogPlugin from "../../../src/ProductDemand/Aggregate/ProductDemand.res.mjs";
|
|
5
|
+
import * as ProductDemand_Behavior$CatalogPlugin from "../../../src/ProductDemand/Aggregate/ProductDemand_Behavior.res.mjs";
|
|
6
|
+
|
|
7
|
+
let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
|
|
8
|
+
name: ProductDemand$CatalogPlugin.name,
|
|
9
|
+
commandSchema: ProductDemand$CatalogPlugin.commandSchema,
|
|
10
|
+
eventSchema: ProductDemand$CatalogPlugin.eventSchema,
|
|
11
|
+
errorSchema: ProductDemand$CatalogPlugin.errorSchema
|
|
12
|
+
})({
|
|
13
|
+
Spec: {
|
|
14
|
+
name: ProductDemand$CatalogPlugin.name,
|
|
15
|
+
commandSchema: ProductDemand$CatalogPlugin.commandSchema,
|
|
16
|
+
eventSchema: ProductDemand$CatalogPlugin.eventSchema,
|
|
17
|
+
errorSchema: ProductDemand$CatalogPlugin.errorSchema
|
|
18
|
+
},
|
|
19
|
+
initialState: ProductDemand_Behavior$CatalogPlugin.initialState,
|
|
20
|
+
evolve: ProductDemand_Behavior$CatalogPlugin.evolve,
|
|
21
|
+
decide: ProductDemand_Behavior$CatalogPlugin.decide,
|
|
22
|
+
moduleUrl: ProductDemand_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
|
+
describe("ProductDemand Behavior", () => {
|
|
38
|
+
test("Record on new aggregate produces Recorded", () => thenEvent(whenCmd(givenEvents([]), {
|
|
39
|
+
TAG: "Record",
|
|
40
|
+
orderId: "order-1"
|
|
41
|
+
}), {
|
|
42
|
+
TAG: "Recorded",
|
|
43
|
+
orderId: "order-1"
|
|
44
|
+
}));
|
|
45
|
+
test("Record with new orderId on existing aggregate produces Recorded", () => thenEvent(whenCmd(givenEvents([{
|
|
46
|
+
TAG: "Recorded",
|
|
47
|
+
orderId: "order-1"
|
|
48
|
+
}]), {
|
|
49
|
+
TAG: "Record",
|
|
50
|
+
orderId: "order-2"
|
|
51
|
+
}), {
|
|
52
|
+
TAG: "Recorded",
|
|
53
|
+
orderId: "order-2"
|
|
54
|
+
}));
|
|
55
|
+
test("Record with already-recorded orderId produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
56
|
+
TAG: "Recorded",
|
|
57
|
+
orderId: "order-1"
|
|
58
|
+
}]), {
|
|
59
|
+
TAG: "Record",
|
|
60
|
+
orderId: "order-1"
|
|
61
|
+
})));
|
|
62
|
+
test("Revoke on never-recorded aggregate produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([]), {
|
|
63
|
+
TAG: "Revoke",
|
|
64
|
+
orderId: "order-1"
|
|
65
|
+
})));
|
|
66
|
+
test("Revoke of unrecorded orderId on existing aggregate produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
67
|
+
TAG: "Recorded",
|
|
68
|
+
orderId: "order-1"
|
|
69
|
+
}]), {
|
|
70
|
+
TAG: "Revoke",
|
|
71
|
+
orderId: "order-2"
|
|
72
|
+
})));
|
|
73
|
+
test("Revoke of recorded orderId produces Revoked", () => thenEvent(whenCmd(givenEvents([{
|
|
74
|
+
TAG: "Recorded",
|
|
75
|
+
orderId: "order-1"
|
|
76
|
+
}]), {
|
|
77
|
+
TAG: "Revoke",
|
|
78
|
+
orderId: "order-1"
|
|
79
|
+
}), {
|
|
80
|
+
TAG: "Revoked",
|
|
81
|
+
orderId: "order-1"
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
let Spec = include.Spec;
|
|
86
|
+
|
|
87
|
+
let thenCompareEvent = include.thenCompareEvent;
|
|
88
|
+
|
|
89
|
+
let thenEventWithError = include.thenEventWithError;
|
|
90
|
+
|
|
91
|
+
let thenEvents = include.thenEvents;
|
|
92
|
+
|
|
93
|
+
let thenCompareEvents = include.thenCompareEvents;
|
|
94
|
+
|
|
95
|
+
let thenEventsWithError = include.thenEventsWithError;
|
|
96
|
+
|
|
97
|
+
let thenError = include.thenError;
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
Spec,
|
|
101
|
+
describe,
|
|
102
|
+
test,
|
|
103
|
+
givenEvents,
|
|
104
|
+
whenCmd,
|
|
105
|
+
thenEvent,
|
|
106
|
+
thenCompareEvent,
|
|
107
|
+
thenNoEvent,
|
|
108
|
+
thenEventWithError,
|
|
109
|
+
thenEvents,
|
|
110
|
+
thenCompareEvents,
|
|
111
|
+
thenEventsWithError,
|
|
112
|
+
thenError,
|
|
113
|
+
}
|
|
114
|
+
/* include Not a pure module */
|
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Multi-source ReadModel: separate `_GWT` instances per source mapping.
|
|
2
|
+
// `MultiSourceProjection_GWT.Make` is single-source; spec-stem uniqueness keeps
|
|
3
|
+
// the file name singular while we instantiate one functor per mapping.
|
|
4
|
+
|
|
5
|
+
module ProductGwt = ReventlessGwt.MultiSourceProjection_GWT.Make(
|
|
6
|
+
ProductDemands_Projections.ProductMapping,
|
|
7
|
+
)
|
|
8
|
+
module ProductDemandGwt = ReventlessGwt.MultiSourceProjection_GWT.Make(
|
|
9
|
+
ProductDemands_Projections.ProductDemandMapping,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
ProductGwt.describe("ProductDemands ReadModel ← Product", () => {
|
|
13
|
+
ProductGwt.test("Added initialises the entry with orderCount = 0", () =>
|
|
14
|
+
ProductGwt.givenEvents([])
|
|
15
|
+
->ProductGwt.whenEvent(Product.Added({name: "Laptop", description: "x", price: 1.0}))
|
|
16
|
+
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
ProductGwt.test("NameUpdated is ignored (handled by Products read model)", () =>
|
|
20
|
+
ProductGwt.givenEvents([Product.Added({name: "Laptop", description: "x", price: 1.0})])
|
|
21
|
+
->ProductGwt.whenEvent(Product.NameUpdated({name: "Gaming Laptop"}))
|
|
22
|
+
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
ProductGwt.test("DescriptionUpdated is ignored", () =>
|
|
26
|
+
ProductGwt.givenEvents([Product.Added({name: "Laptop", description: "x", price: 1.0})])
|
|
27
|
+
->ProductGwt.whenEvent(Product.DescriptionUpdated({description: "y"}))
|
|
28
|
+
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
ProductGwt.test("PriceUpdated is ignored", () =>
|
|
32
|
+
ProductGwt.givenEvents([Product.Added({name: "Laptop", description: "x", price: 1.0})])
|
|
33
|
+
->ProductGwt.whenEvent(Product.PriceUpdated({price: 2.0}))
|
|
34
|
+
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
35
|
+
)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
// `MultiSourceProjection_GWT` is single-source: the ProductDemand mapping
|
|
39
|
+
// emits `Update(...)` that needs initial state seeded by the Product
|
|
40
|
+
// mapping's `Set(...)`. Tested in isolation, both Update branches surface
|
|
41
|
+
// a `StaleState` error. We assert the throw to lock in that the mapping
|
|
42
|
+
// never tries to initialise its own row — the integration relies on
|
|
43
|
+
// Product.Added arriving first.
|
|
44
|
+
ProductDemandGwt.describe("ProductDemands ReadModel ← ProductDemand", () => {
|
|
45
|
+
ProductDemandGwt.test("Recorded without prior Product.Added throws StaleState", () =>
|
|
46
|
+
ProductDemandGwt.givenEvents([])
|
|
47
|
+
->ProductDemandGwt.whenEvent(ProductDemand.Recorded({orderId: "order-1"}))
|
|
48
|
+
->ProductDemandGwt.thenThrow
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
ProductDemandGwt.test("Revoked without prior Product.Added throws StaleState", () =>
|
|
52
|
+
ProductDemandGwt.givenEvents([])
|
|
53
|
+
->ProductDemandGwt.whenEvent(ProductDemand.Revoked({orderId: "order-1"}))
|
|
54
|
+
->ProductDemandGwt.thenThrow
|
|
55
|
+
)
|
|
56
|
+
})
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as MultiSourceProjection_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/MultiSourceProjection_GWT.res.mjs";
|
|
4
|
+
import * as ProductDemands_Projections$CatalogPlugin from "../../../src/ProductDemand/ReadModel/ProductDemands_Projections.res.mjs";
|
|
5
|
+
|
|
6
|
+
let ProductGwt = MultiSourceProjection_GWT$ReventlessGwt.Make(ProductDemands_Projections$CatalogPlugin.ProductMapping);
|
|
7
|
+
|
|
8
|
+
let ProductDemandGwt = MultiSourceProjection_GWT$ReventlessGwt.Make(ProductDemands_Projections$CatalogPlugin.ProductDemandMapping);
|
|
9
|
+
|
|
10
|
+
ProductGwt.describe("ProductDemands ReadModel ← Product", () => {
|
|
11
|
+
ProductGwt.test("Added initialises the entry with orderCount = 0", undefined, () => ProductGwt.thenState(ProductGwt.whenEvent(ProductGwt.givenEvents([]), {
|
|
12
|
+
TAG: "Added",
|
|
13
|
+
name: "Laptop",
|
|
14
|
+
description: "x",
|
|
15
|
+
price: 1.0
|
|
16
|
+
}), {
|
|
17
|
+
name: "Laptop",
|
|
18
|
+
orderCount: 0
|
|
19
|
+
}));
|
|
20
|
+
ProductGwt.test("NameUpdated is ignored (handled by Products read model)", undefined, () => ProductGwt.thenState(ProductGwt.whenEvent(ProductGwt.givenEvents([{
|
|
21
|
+
TAG: "Added",
|
|
22
|
+
name: "Laptop",
|
|
23
|
+
description: "x",
|
|
24
|
+
price: 1.0
|
|
25
|
+
}]), {
|
|
26
|
+
TAG: "NameUpdated",
|
|
27
|
+
name: "Gaming Laptop"
|
|
28
|
+
}), {
|
|
29
|
+
name: "Laptop",
|
|
30
|
+
orderCount: 0
|
|
31
|
+
}));
|
|
32
|
+
ProductGwt.test("DescriptionUpdated is ignored", undefined, () => ProductGwt.thenState(ProductGwt.whenEvent(ProductGwt.givenEvents([{
|
|
33
|
+
TAG: "Added",
|
|
34
|
+
name: "Laptop",
|
|
35
|
+
description: "x",
|
|
36
|
+
price: 1.0
|
|
37
|
+
}]), {
|
|
38
|
+
TAG: "DescriptionUpdated",
|
|
39
|
+
description: "y"
|
|
40
|
+
}), {
|
|
41
|
+
name: "Laptop",
|
|
42
|
+
orderCount: 0
|
|
43
|
+
}));
|
|
44
|
+
ProductGwt.test("PriceUpdated is ignored", undefined, () => ProductGwt.thenState(ProductGwt.whenEvent(ProductGwt.givenEvents([{
|
|
45
|
+
TAG: "Added",
|
|
46
|
+
name: "Laptop",
|
|
47
|
+
description: "x",
|
|
48
|
+
price: 1.0
|
|
49
|
+
}]), {
|
|
50
|
+
TAG: "PriceUpdated",
|
|
51
|
+
price: 2.0
|
|
52
|
+
}), {
|
|
53
|
+
name: "Laptop",
|
|
54
|
+
orderCount: 0
|
|
55
|
+
}));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
ProductDemandGwt.describe("ProductDemands ReadModel ← ProductDemand", () => {
|
|
59
|
+
ProductDemandGwt.test("Recorded without prior Product.Added throws StaleState", undefined, () => ProductDemandGwt.thenThrow(ProductDemandGwt.whenEvent(ProductDemandGwt.givenEvents([]), {
|
|
60
|
+
TAG: "Recorded",
|
|
61
|
+
orderId: "order-1"
|
|
62
|
+
})));
|
|
63
|
+
ProductDemandGwt.test("Revoked without prior Product.Added throws StaleState", undefined, () => ProductDemandGwt.thenThrow(ProductDemandGwt.whenEvent(ProductDemandGwt.givenEvents([]), {
|
|
64
|
+
TAG: "Revoked",
|
|
65
|
+
orderId: "order-1"
|
|
66
|
+
})));
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
ProductGwt,
|
|
71
|
+
ProductDemandGwt,
|
|
72
|
+
}
|
|
73
|
+
/* ProductGwt Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
randjbuildsystem
|
|
2
|
+
Categories
|
|
3
|
+
Categories_GWT
|
|
4
|
+
Categories_Projections
|
|
5
|
+
Category
|
|
6
|
+
Category_Behavior
|
|
7
|
+
Category_GWT
|
|
8
|
+
ImportProducts
|
|
9
|
+
Orders_Extension
|
|
10
|
+
Orders_Extension_GWT
|
|
11
|
+
Plugin
|
|
12
|
+
Product
|
|
13
|
+
ProductDemand
|
|
14
|
+
ProductDemand_Behavior
|
|
15
|
+
ProductDemand_GWT
|
|
16
|
+
ProductDemands
|
|
17
|
+
ProductDemands_GWT
|
|
18
|
+
ProductDemands_Projections
|
|
19
|
+
Product_Behavior
|
|
20
|
+
Product_GWT
|
|
21
|
+
Products
|
|
22
|
+
Products_ExtensionPointMapping
|
|
23
|
+
Products_ExtensionPointMapping_GWT
|
|
24
|
+
Products_GWT
|
|
25
|
+
Products_Projections
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@@reventless.gwt(Categories_Projections.CategoryMapping)
|
|
2
|
+
|
|
3
|
+
describe("Categories ReadModel ← Category", () => {
|
|
4
|
+
test("Added sets initial read model state", () =>
|
|
5
|
+
givenEvents([])
|
|
6
|
+
->whenEvent(Category.Added({name: "Electronics"}))
|
|
7
|
+
->thenState({Categories.name: "Electronics", archived: false})
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
test("Renamed updates the name", () =>
|
|
11
|
+
givenEvents([Category.Added({name: "Electronics"})])
|
|
12
|
+
->whenEvent(Category.Renamed({name: "Consumer Electronics"}))
|
|
13
|
+
->thenState({Categories.name: "Consumer Electronics", archived: false})
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("Archived sets archived flag", () =>
|
|
17
|
+
givenEvents([Category.Added({name: "Electronics"})])
|
|
18
|
+
->whenEvent(Category.Archived)
|
|
19
|
+
->thenState({Categories.name: "Electronics", archived: true})
|
|
20
|
+
)
|
|
21
|
+
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Category projection mappings.
|
|
2
|
+
// Maps Category aggregate events to Categories read model state changes.
|
|
3
|
+
@@reventless.mappings
|
|
4
|
+
|
|
5
|
+
module CategoryMapping = Mapping.Make(
|
|
6
|
+
Category,
|
|
7
|
+
Categories,
|
|
8
|
+
{
|
|
9
|
+
open Category
|
|
10
|
+
let project = ({event, id, _}) =>
|
|
11
|
+
switch event {
|
|
12
|
+
| Added({name}) => Set(id, {Categories.name, archived: false})
|
|
13
|
+
| Renamed({name}) => Update(id, state => {...state, name})
|
|
14
|
+
| Archived => Update(id, state => {...state, archived: true})
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
let mappings: array<module(Mapping)> = [module(CategoryMapping)]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Category aggregate specification.
|
|
2
|
+
// A named grouping of products (e.g. "Books", "Electronics").
|
|
3
|
+
|
|
4
|
+
@@reventless.spec
|
|
5
|
+
|
|
6
|
+
@schema
|
|
7
|
+
type command =
|
|
8
|
+
| Add({name: string})
|
|
9
|
+
| Rename({name: string})
|
|
10
|
+
| @authorize(AllowGroups(["Admin"])) Archive
|
|
11
|
+
|
|
12
|
+
@schema
|
|
13
|
+
type event =
|
|
14
|
+
| Added({name: string})
|
|
15
|
+
| Renamed({name: string})
|
|
16
|
+
| Archived
|
|
17
|
+
|
|
18
|
+
@schema
|
|
19
|
+
type error =
|
|
20
|
+
| CategoryAlreadyExists
|
|
21
|
+
| CategoryNotFound
|
|
22
|
+
| CategoryAlreadyArchived
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Category aggregate behavior.
|
|
2
|
+
// Implements the state machine for adding, renaming, and archiving categories.
|
|
3
|
+
|
|
4
|
+
@@reventless.behavior
|
|
5
|
+
|
|
6
|
+
@schema
|
|
7
|
+
type state =
|
|
8
|
+
| NotCreated
|
|
9
|
+
| Active({name: string})
|
|
10
|
+
| Archived
|
|
11
|
+
|
|
12
|
+
let initialState = NotCreated
|
|
13
|
+
|
|
14
|
+
let evolve = (state, event) =>
|
|
15
|
+
switch (state, event) {
|
|
16
|
+
| (NotCreated, Added({name})) => Active({name: name})
|
|
17
|
+
| (Active(_), Added({name})) => Active({name: name})
|
|
18
|
+
| (Active(_), Renamed({name})) => Active({name: name})
|
|
19
|
+
| (Active(_), Category.Archived) => Archived
|
|
20
|
+
| (Archived, _) => state
|
|
21
|
+
| (NotCreated, _) => state
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let decide = (state, command) =>
|
|
25
|
+
switch (state, command) {
|
|
26
|
+
| (NotCreated, Add({name})) => Ok([Added({name: name})])
|
|
27
|
+
| (NotCreated, Rename(_)) => Error(CategoryNotFound)
|
|
28
|
+
| (NotCreated, Archive) => Error(CategoryNotFound)
|
|
29
|
+
| (Active(_), Add(_)) => Error(CategoryAlreadyExists)
|
|
30
|
+
| (Active(s), Rename({name})) if name == s.name => Ok([])
|
|
31
|
+
| (Active(_), Rename({name})) => Ok([Renamed({name: name})])
|
|
32
|
+
| (Active(_), Archive) => Ok([Category.Archived])
|
|
33
|
+
| (Archived, Add(_)) => Error(CategoryAlreadyArchived)
|
|
34
|
+
| (Archived, Rename(_)) => Error(CategoryAlreadyArchived)
|
|
35
|
+
| (Archived, Archive) => Ok([]) // idempotent
|
|
36
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@@reventless.gwt
|
|
2
|
+
|
|
3
|
+
describe("Category Behavior", () => {
|
|
4
|
+
test("Add on new aggregate produces Added", () =>
|
|
5
|
+
givenEvents([])
|
|
6
|
+
->whenCmd(Add({name: "Electronics"}))
|
|
7
|
+
->thenEvent(Added({name: "Electronics"}))
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
test("Add on existing aggregate returns CategoryAlreadyExists", () =>
|
|
11
|
+
givenEvents([Added({name: "Electronics"})])
|
|
12
|
+
->whenCmd(Add({name: "Electronics 2"}))
|
|
13
|
+
->thenError(CategoryAlreadyExists)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("Rename on non-existent aggregate returns CategoryNotFound", () =>
|
|
17
|
+
givenEvents([])
|
|
18
|
+
->whenCmd(Rename({name: "New Name"}))
|
|
19
|
+
->thenError(CategoryNotFound)
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
test("Rename on active category produces Renamed", () =>
|
|
23
|
+
givenEvents([Added({name: "Electronics"})])
|
|
24
|
+
->whenCmd(Rename({name: "Consumer Electronics"}))
|
|
25
|
+
->thenEvent(Renamed({name: "Consumer Electronics"}))
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
test("Rename to same name produces no events (idempotent)", () =>
|
|
29
|
+
givenEvents([Added({name: "Electronics"})])
|
|
30
|
+
->whenCmd(Rename({name: "Electronics"}))
|
|
31
|
+
->thenNoEvent
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
test("Rename on archived category returns CategoryAlreadyArchived", () =>
|
|
35
|
+
givenEvents([Added({name: "Electronics"}), Archived])
|
|
36
|
+
->whenCmd(Rename({name: "New Name"}))
|
|
37
|
+
->thenError(CategoryAlreadyArchived)
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
test("Archive on active category produces Archived", () =>
|
|
41
|
+
givenEvents([Added({name: "Electronics"})])
|
|
42
|
+
->whenCmd(Archive)
|
|
43
|
+
->thenEvent(Archived)
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
test("Archive on archived category produces no events (idempotent)", () =>
|
|
47
|
+
givenEvents([Added({name: "Electronics"}), Archived])
|
|
48
|
+
->whenCmd(Archive)
|
|
49
|
+
->thenNoEvent
|
|
50
|
+
)
|
|
51
|
+
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Import products from a CSV file uploaded to S3.
|
|
2
|
+
// Each row is translated to a Product.Add command.
|
|
3
|
+
|
|
4
|
+
@@reventless.task
|
|
5
|
+
|
|
6
|
+
let importCallback = (~eventName, ~key) => {
|
|
7
|
+
if eventName->String.includes("ObjectCreated") {
|
|
8
|
+
Console.log("[ImportProducts] Processing file: " ++ key)
|
|
9
|
+
|
|
10
|
+
let meta: Message.meta = {
|
|
11
|
+
service: "ImportProducts",
|
|
12
|
+
time: Date.now()->Float.toString,
|
|
13
|
+
ip: "",
|
|
14
|
+
user: "system",
|
|
15
|
+
msgId: key,
|
|
16
|
+
correlationId: key,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[
|
|
20
|
+
Task.PublishCommands(
|
|
21
|
+
"Product",
|
|
22
|
+
[
|
|
23
|
+
{
|
|
24
|
+
id: key,
|
|
25
|
+
meta,
|
|
26
|
+
commandJson: Product.Add({
|
|
27
|
+
name: "Imported Product",
|
|
28
|
+
description: "Imported from " ++ key,
|
|
29
|
+
price: 9.99,
|
|
30
|
+
})->Message.encode(Product.commandSchema),
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
),
|
|
34
|
+
]->Promise.resolve
|
|
35
|
+
} else {
|
|
36
|
+
[]->Promise.resolve
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let setup = (_queryEngine, _queryBucketName, _opts) => {
|
|
41
|
+
Task.buckets: [
|
|
42
|
+
{
|
|
43
|
+
bucketName: "product-imports",
|
|
44
|
+
bucketMode: Task.Read,
|
|
45
|
+
callback: importCallback,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Catalog's extension subscribing to Ordering's OrdersExtensionPoint.
|
|
2
|
+
// Routes ItemOrdered / ItemOrderCancelled events to ProductDemand commands.
|
|
3
|
+
|
|
4
|
+
@@reventless.extension
|
|
5
|
+
|
|
6
|
+
module Mapping = {
|
|
7
|
+
module ExtensionPoint = OrderingSpec.Orders_ExtensionPoint
|
|
8
|
+
module Delegate = ProductDemand
|
|
9
|
+
|
|
10
|
+
open ExtensionPoint
|
|
11
|
+
open Delegate
|
|
12
|
+
let mapIncomingEvent = (_id, event, _meta, _pluginDef, _queryEngine) =>
|
|
13
|
+
switch event {
|
|
14
|
+
| ItemOrdered({productId, orderId}) => [
|
|
15
|
+
PublishAggregateCommand(productId, Record({orderId: orderId})),
|
|
16
|
+
]
|
|
17
|
+
| ItemOrderCancelled({productId, orderId}) => [
|
|
18
|
+
PublishAggregateCommand(productId, Revoke({orderId: orderId})),
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let mapOutgoingEvent = None
|
|
23
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
+
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|