@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,22 @@
|
|
|
1
|
+
// Product projection mappings.
|
|
2
|
+
// Maps Product aggregate events to Products read model state changes.
|
|
3
|
+
@@reventless.mappings
|
|
4
|
+
|
|
5
|
+
module ProductMapping = Mapping.Make(
|
|
6
|
+
Product,
|
|
7
|
+
Products,
|
|
8
|
+
{
|
|
9
|
+
open Product
|
|
10
|
+
let project = ({event, id, _}) =>
|
|
11
|
+
switch event {
|
|
12
|
+
| Added({name, description, price}) =>
|
|
13
|
+
Set(id, {Products.name: name, description, price})
|
|
14
|
+
| NameUpdated({name}) => Update(id, state => {...state, name})
|
|
15
|
+
| DescriptionUpdated({description}) =>
|
|
16
|
+
Update(id, state => {...state, description})
|
|
17
|
+
| PriceUpdated({price}) => Update(id, state => {...state, price})
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
let mappings: array<module(Mapping)> = [module(ProductMapping)]
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reventlessdev/online-shop-aggregates-catalog",
|
|
3
|
+
"version": "3.0.0-alpha.101",
|
|
4
|
+
"description": "Online Shop example — Catalog plugin (Product & Category aggregates)",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"jest": {
|
|
7
|
+
"testMatch": [
|
|
8
|
+
"<rootDir>/tests/**/*Test.res.mjs",
|
|
9
|
+
"<rootDir>/tests/**/*_GWT.res.mjs"
|
|
10
|
+
],
|
|
11
|
+
"moduleFileExtensions": [
|
|
12
|
+
"js",
|
|
13
|
+
"mjs"
|
|
14
|
+
],
|
|
15
|
+
"moduleNameMapper": {
|
|
16
|
+
"^@npmcli/arborist$": "<rootDir>/__mocks__/emptyModule.js",
|
|
17
|
+
"^spdx-license-ids$": "<rootDir>/../../../node_modules/spdx-license-ids/index.json",
|
|
18
|
+
"^spdx-license-ids/deprecated$": "<rootDir>/../../../node_modules/spdx-license-ids/deprecated.json",
|
|
19
|
+
"^spdx-exceptions$": "<rootDir>/../../../node_modules/spdx-exceptions/index.json"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"sury": "^11.0.0-alpha.4",
|
|
24
|
+
"@reventlessdev/online-shop-aggregates-catalog-spec": "3.0.0-alpha.57",
|
|
25
|
+
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.14",
|
|
26
|
+
"@reventlessdev/online-shop-aggregates-ordering-spec": "3.0.0-alpha.57",
|
|
27
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.74",
|
|
28
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.81",
|
|
29
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.113",
|
|
30
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.61"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"rescript": "^12.3.0",
|
|
34
|
+
"sury-ppx": "11.0.0-alpha.2",
|
|
35
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.47"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"rescript": "^12.3.0"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"registry": "https://registry.npmjs.org"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"generate": "generate-plugin src/",
|
|
45
|
+
"prebuild": "pnpm run generate",
|
|
46
|
+
"build": "rescript build",
|
|
47
|
+
"start": "rescript watch",
|
|
48
|
+
"clean": "rescript clean",
|
|
49
|
+
"rebuild": "pnpm run clean && pnpm run build -- -with-deps",
|
|
50
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules' npx jest"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/rescript.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reventlessdev/online-shop-aggregates-catalog",
|
|
3
|
+
"package-specs": {
|
|
4
|
+
"module": "esmodule",
|
|
5
|
+
"in-source": true
|
|
6
|
+
},
|
|
7
|
+
"namespace": "CatalogPlugin",
|
|
8
|
+
"ppx-flags": [
|
|
9
|
+
"@reventlessdev/reventless-ppx/bin",
|
|
10
|
+
"sury-ppx/bin"
|
|
11
|
+
],
|
|
12
|
+
"warnings": {
|
|
13
|
+
"error": "-44+101"
|
|
14
|
+
},
|
|
15
|
+
"sources": [
|
|
16
|
+
{
|
|
17
|
+
"dir": "src",
|
|
18
|
+
"subdirs": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"dir": "tests",
|
|
22
|
+
"subdirs": true
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"dependencies": [
|
|
26
|
+
"sury",
|
|
27
|
+
"@reventlessdev/rescript-pulumi-pulumi",
|
|
28
|
+
"@reventlessdev/reventless-spec",
|
|
29
|
+
"@reventlessdev/reventless-infra",
|
|
30
|
+
"@reventlessdev/reventless-local",
|
|
31
|
+
"@reventlessdev/reventless-gwt",
|
|
32
|
+
"@reventlessdev/online-shop-aggregates-catalog-spec",
|
|
33
|
+
"@reventlessdev/online-shop-aggregates-ordering-spec"
|
|
34
|
+
],
|
|
35
|
+
"dev-dependencies": [
|
|
36
|
+
],
|
|
37
|
+
"compiler-flags": [],
|
|
38
|
+
"suffix": ".res.mjs"
|
|
39
|
+
}
|
|
@@ -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
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
|
|
5
|
+
let commandSchema = S.union([
|
|
6
|
+
S.schema(s => ({
|
|
7
|
+
TAG: "Add",
|
|
8
|
+
name: s.m(S.string)
|
|
9
|
+
})),
|
|
10
|
+
S.schema(s => ({
|
|
11
|
+
TAG: "Rename",
|
|
12
|
+
name: s.m(S.string)
|
|
13
|
+
})),
|
|
14
|
+
S.literal("Archive")
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
let eventSchema = S.union([
|
|
18
|
+
S.schema(s => ({
|
|
19
|
+
TAG: "Added",
|
|
20
|
+
name: s.m(S.string)
|
|
21
|
+
})),
|
|
22
|
+
S.schema(s => ({
|
|
23
|
+
TAG: "Renamed",
|
|
24
|
+
name: s.m(S.string)
|
|
25
|
+
})),
|
|
26
|
+
S.literal("Archived")
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
let errorSchema = S.union([
|
|
30
|
+
S.literal("CategoryAlreadyExists"),
|
|
31
|
+
S.literal("CategoryNotFound"),
|
|
32
|
+
S.literal("CategoryAlreadyArchived")
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
function commandAuthorization(command) {
|
|
36
|
+
if (typeof command !== "object") {
|
|
37
|
+
return {
|
|
38
|
+
TAG: "AllowGroups",
|
|
39
|
+
_0: ["Admin"]
|
|
40
|
+
};
|
|
41
|
+
} else {
|
|
42
|
+
return "AllowAuthenticated";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let name = "Category";
|
|
47
|
+
|
|
48
|
+
let Id;
|
|
49
|
+
|
|
50
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Category/Aggregate/Category.res.mjs";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
name,
|
|
54
|
+
Id,
|
|
55
|
+
commandSchema,
|
|
56
|
+
eventSchema,
|
|
57
|
+
errorSchema,
|
|
58
|
+
moduleUrl,
|
|
59
|
+
commandAuthorization,
|
|
60
|
+
}
|
|
61
|
+
/* commandSchema Not a pure module */
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
|
|
5
|
+
let stateSchema = S.union([
|
|
6
|
+
S.literal("NotCreated"),
|
|
7
|
+
S.schema(s => ({
|
|
8
|
+
TAG: "Active",
|
|
9
|
+
name: s.m(S.string)
|
|
10
|
+
})),
|
|
11
|
+
S.literal("Archived")
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
function evolve(state, event) {
|
|
15
|
+
if (typeof state !== "object") {
|
|
16
|
+
if (state === "NotCreated" && typeof event === "object" && event.TAG === "Added") {
|
|
17
|
+
return {
|
|
18
|
+
TAG: "Active",
|
|
19
|
+
name: event.name
|
|
20
|
+
};
|
|
21
|
+
} else {
|
|
22
|
+
return state;
|
|
23
|
+
}
|
|
24
|
+
} else if (typeof event !== "object") {
|
|
25
|
+
return "Archived";
|
|
26
|
+
} else {
|
|
27
|
+
return {
|
|
28
|
+
TAG: "Active",
|
|
29
|
+
name: event.name
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function decide(state, command) {
|
|
35
|
+
if (typeof state !== "object") {
|
|
36
|
+
if (state === "NotCreated") {
|
|
37
|
+
if (typeof command !== "object" || command.TAG !== "Add") {
|
|
38
|
+
return {
|
|
39
|
+
TAG: "Error",
|
|
40
|
+
_0: "CategoryNotFound"
|
|
41
|
+
};
|
|
42
|
+
} else {
|
|
43
|
+
return {
|
|
44
|
+
TAG: "Ok",
|
|
45
|
+
_0: [{
|
|
46
|
+
TAG: "Added",
|
|
47
|
+
name: command.name
|
|
48
|
+
}]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
} else if (typeof command !== "object") {
|
|
52
|
+
return {
|
|
53
|
+
TAG: "Ok",
|
|
54
|
+
_0: []
|
|
55
|
+
};
|
|
56
|
+
} else {
|
|
57
|
+
return {
|
|
58
|
+
TAG: "Error",
|
|
59
|
+
_0: "CategoryAlreadyArchived"
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (typeof command !== "object") {
|
|
64
|
+
return {
|
|
65
|
+
TAG: "Ok",
|
|
66
|
+
_0: ["Archived"]
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (command.TAG === "Add") {
|
|
70
|
+
return {
|
|
71
|
+
TAG: "Error",
|
|
72
|
+
_0: "CategoryAlreadyExists"
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
let name = command.name;
|
|
76
|
+
if (name === state.name) {
|
|
77
|
+
return {
|
|
78
|
+
TAG: "Ok",
|
|
79
|
+
_0: []
|
|
80
|
+
};
|
|
81
|
+
} else {
|
|
82
|
+
return {
|
|
83
|
+
TAG: "Ok",
|
|
84
|
+
_0: [{
|
|
85
|
+
TAG: "Renamed",
|
|
86
|
+
name: name
|
|
87
|
+
}]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let Spec;
|
|
93
|
+
|
|
94
|
+
let initialState = "NotCreated";
|
|
95
|
+
|
|
96
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Category/Aggregate/Category_Behavior.res.mjs";
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
Spec,
|
|
100
|
+
stateSchema,
|
|
101
|
+
initialState,
|
|
102
|
+
evolve,
|
|
103
|
+
decide,
|
|
104
|
+
moduleUrl,
|
|
105
|
+
}
|
|
106
|
+
/* stateSchema Not a pure module */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
|
|
5
|
+
|
|
6
|
+
let stateSchema = S.schema(s => ({
|
|
7
|
+
name: s.m(S.string),
|
|
8
|
+
archived: s.m(S.bool)
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
let config = ReadModel$Reventless.config(undefined, undefined, undefined);
|
|
12
|
+
|
|
13
|
+
let name = "Categories";
|
|
14
|
+
|
|
15
|
+
let Id;
|
|
16
|
+
|
|
17
|
+
let subIdConfig;
|
|
18
|
+
|
|
19
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Category/ReadModel/Categories.res.mjs";
|
|
20
|
+
|
|
21
|
+
let authorization = "AllowAuthenticated";
|
|
22
|
+
|
|
23
|
+
let visibility = "Public";
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
name,
|
|
27
|
+
Id,
|
|
28
|
+
stateSchema,
|
|
29
|
+
config,
|
|
30
|
+
subIdConfig,
|
|
31
|
+
moduleUrl,
|
|
32
|
+
authorization,
|
|
33
|
+
visibility,
|
|
34
|
+
}
|
|
35
|
+
/* stateSchema Not a pure module */
|
|
@@ -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)]
|
|
@@ -0,0 +1,75 @@
|
|
|
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 Projection$Reventless from "@reventlessdev/reventless-spec/src/types/Projection.res.mjs";
|
|
5
|
+
import * as Category$CatalogPlugin from "../Aggregate/Category.res.mjs";
|
|
6
|
+
import * as Categories$CatalogPlugin from "./Categories.res.mjs";
|
|
7
|
+
|
|
8
|
+
let M = Projection$Reventless.Mappings.Make({
|
|
9
|
+
Id: Id$Reventless.$$String,
|
|
10
|
+
name: Categories$CatalogPlugin.name,
|
|
11
|
+
stateSchema: Categories$CatalogPlugin.stateSchema,
|
|
12
|
+
subIdConfig: undefined
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function project(param) {
|
|
16
|
+
let event = param.event;
|
|
17
|
+
let id = param.id;
|
|
18
|
+
if (typeof event !== "object") {
|
|
19
|
+
return {
|
|
20
|
+
TAG: "Update",
|
|
21
|
+
_0: id,
|
|
22
|
+
_1: state => ({
|
|
23
|
+
name: state.name,
|
|
24
|
+
archived: true
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (event.TAG === "Added") {
|
|
29
|
+
return {
|
|
30
|
+
TAG: "Set",
|
|
31
|
+
_0: id,
|
|
32
|
+
_1: {
|
|
33
|
+
name: event.name,
|
|
34
|
+
archived: false
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
let name = event.name;
|
|
39
|
+
return {
|
|
40
|
+
TAG: "Update",
|
|
41
|
+
_0: id,
|
|
42
|
+
_1: state => ({
|
|
43
|
+
name: name,
|
|
44
|
+
archived: state.archived
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let CategoryMapping = Projection$Reventless.Mapping.Make({
|
|
50
|
+
Id: Id$Reventless.$$String,
|
|
51
|
+
name: Category$CatalogPlugin.name,
|
|
52
|
+
eventSchema: Category$CatalogPlugin.eventSchema
|
|
53
|
+
})({
|
|
54
|
+
Id: Id$Reventless.$$String,
|
|
55
|
+
name: Categories$CatalogPlugin.name,
|
|
56
|
+
stateSchema: Categories$CatalogPlugin.stateSchema,
|
|
57
|
+
subIdConfig: undefined
|
|
58
|
+
})({
|
|
59
|
+
project: project
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
let mappings = [CategoryMapping];
|
|
63
|
+
|
|
64
|
+
let Target;
|
|
65
|
+
|
|
66
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Category/ReadModel/Categories_Projections.res.mjs";
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
Target,
|
|
70
|
+
M,
|
|
71
|
+
CategoryMapping,
|
|
72
|
+
mappings,
|
|
73
|
+
moduleUrl,
|
|
74
|
+
}
|
|
75
|
+
/* M Not a pure module */
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as ProductDemand$CatalogPlugin from "../ProductDemand/Aggregate/ProductDemand.res.mjs";
|
|
4
|
+
|
|
5
|
+
function mapIncomingEvent(_id, event, _meta, _pluginDef, _queryEngine) {
|
|
6
|
+
if (event.TAG === "ItemOrdered") {
|
|
7
|
+
return [{
|
|
8
|
+
TAG: "PublishAggregateCommand",
|
|
9
|
+
_0: event.productId,
|
|
10
|
+
_1: {
|
|
11
|
+
TAG: "Record",
|
|
12
|
+
orderId: event.orderId
|
|
13
|
+
}
|
|
14
|
+
}];
|
|
15
|
+
} else {
|
|
16
|
+
return [{
|
|
17
|
+
TAG: "PublishAggregateCommand",
|
|
18
|
+
_0: event.productId,
|
|
19
|
+
_1: {
|
|
20
|
+
TAG: "Revoke",
|
|
21
|
+
orderId: event.orderId
|
|
22
|
+
}
|
|
23
|
+
}];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let Mapping = {
|
|
28
|
+
ExtensionPoint: undefined,
|
|
29
|
+
Delegate: undefined,
|
|
30
|
+
mapIncomingEvent: mapIncomingEvent,
|
|
31
|
+
mapOutgoingEvent: undefined,
|
|
32
|
+
delegateModuleUrl: ProductDemand$CatalogPlugin.moduleUrl,
|
|
33
|
+
moduleUrl: "@reventlessdev/online-shop-aggregates-catalog/src/Extension/Orders_Extension.res.mjs"
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Extension/Orders_Extension.res.mjs";
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
Mapping,
|
|
40
|
+
moduleUrl,
|
|
41
|
+
}
|
|
42
|
+
/* ProductDemand-CatalogPlugin Not a pure module */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Maps internal Product aggregate events to the stable ProductsExtensionPoint public API.
|
|
2
|
+
@@reventless.spec
|
|
3
|
+
|
|
4
|
+
module ExtensionPoint = CatalogSpec.Products_ExtensionPoint
|
|
5
|
+
module Delegate = Product
|
|
6
|
+
|
|
7
|
+
let mapIncomingCommand = (_id, _command, _meta) => []
|
|
8
|
+
|
|
9
|
+
let mapOutgoingEvent = Some((id, event, _meta, _queryEngine) =>
|
|
10
|
+
switch event {
|
|
11
|
+
| Product.Added({name, price}) => [
|
|
12
|
+
PublishEvent(id, CatalogSpec.Products_ExtensionPoint.ProductBecameAvailable({productId: id, name, price})),
|
|
13
|
+
]
|
|
14
|
+
| Product.PriceUpdated({price}) => [
|
|
15
|
+
PublishEvent(id, CatalogSpec.Products_ExtensionPoint.ProductPriceChanged({productId: id, price})),
|
|
16
|
+
]
|
|
17
|
+
| _ => []
|
|
18
|
+
}
|
|
19
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function mapIncomingCommand(_id, _command, _meta) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let mapOutgoingEvent = (id, event, _meta, _queryEngine) => {
|
|
9
|
+
switch (event.TAG) {
|
|
10
|
+
case "Added" :
|
|
11
|
+
return [{
|
|
12
|
+
TAG: "PublishEvent",
|
|
13
|
+
_0: id,
|
|
14
|
+
_1: {
|
|
15
|
+
TAG: "ProductBecameAvailable",
|
|
16
|
+
productId: id,
|
|
17
|
+
name: event.name,
|
|
18
|
+
price: event.price
|
|
19
|
+
}
|
|
20
|
+
}];
|
|
21
|
+
case "NameUpdated" :
|
|
22
|
+
case "DescriptionUpdated" :
|
|
23
|
+
return [];
|
|
24
|
+
case "PriceUpdated" :
|
|
25
|
+
return [{
|
|
26
|
+
TAG: "PublishEvent",
|
|
27
|
+
_0: id,
|
|
28
|
+
_1: {
|
|
29
|
+
TAG: "ProductPriceChanged",
|
|
30
|
+
productId: id,
|
|
31
|
+
price: event.price
|
|
32
|
+
}
|
|
33
|
+
}];
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
let name = "Products";
|
|
38
|
+
|
|
39
|
+
let Id;
|
|
40
|
+
|
|
41
|
+
let ExtensionPoint;
|
|
42
|
+
|
|
43
|
+
let Delegate;
|
|
44
|
+
|
|
45
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs";
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
name,
|
|
49
|
+
Id,
|
|
50
|
+
ExtensionPoint,
|
|
51
|
+
Delegate,
|
|
52
|
+
mapIncomingCommand,
|
|
53
|
+
mapOutgoingEvent,
|
|
54
|
+
moduleUrl,
|
|
55
|
+
}
|
|
56
|
+
/* No side effect */
|
package/src/Plugin.res
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// AUTO-GENERATED — do not edit. Run `npm run generate` to update.
|
|
2
|
+
|
|
3
|
+
@val external uiBundleUrl: option<string> = "process.env.CATALOG_UI_BUNDLE_URL"
|
|
4
|
+
|
|
5
|
+
module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
6
|
+
// Aggregates
|
|
7
|
+
module CategoryAggregate = Platform.Aggregate.Make(
|
|
8
|
+
Category,
|
|
9
|
+
Category_Behavior,
|
|
10
|
+
ReventlessInfra.NoEventMappings.Make(Category),
|
|
11
|
+
)
|
|
12
|
+
module ProductAggregate = Platform.Aggregate.Make(
|
|
13
|
+
Product,
|
|
14
|
+
Product_Behavior,
|
|
15
|
+
ReventlessInfra.NoEventMappings.Make(Product),
|
|
16
|
+
)
|
|
17
|
+
module ProductDemandAggregate = Platform.Aggregate.Make(
|
|
18
|
+
ProductDemand,
|
|
19
|
+
ProductDemand_Behavior,
|
|
20
|
+
ReventlessInfra.NoEventMappings.Make(ProductDemand),
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
// ReadModels
|
|
24
|
+
module CategoriesReadModel = Platform.ReadModel.Make(Categories, Categories_Projections)
|
|
25
|
+
module ProductDemandsReadModel = Platform.ReadModel.Make(ProductDemands, ProductDemands_Projections)
|
|
26
|
+
module ProductsReadModel = Platform.ReadModel.Make(Products, Products_Projections)
|
|
27
|
+
|
|
28
|
+
// Tasks
|
|
29
|
+
module ImportProductsTask = Platform.Task.Make(ImportProducts)
|
|
30
|
+
|
|
31
|
+
// ExtensionPoints
|
|
32
|
+
module Products_ExtensionPoint = Platform.ExtensionPoint.Make(Products_ExtensionPointMapping)
|
|
33
|
+
|
|
34
|
+
// Extensions
|
|
35
|
+
module Orders_Extension = Platform.Extension.Make(Orders_Extension.Mapping)
|
|
36
|
+
|
|
37
|
+
let pluginStructure = Platform.Plugin.makePluginDefinition(
|
|
38
|
+
~name="Catalog",
|
|
39
|
+
~aggregates=[module(CategoryAggregate), module(ProductAggregate), module(ProductDemandAggregate)],
|
|
40
|
+
~readModels=[module(CategoriesReadModel), module(ProductDemandsReadModel), module(ProductsReadModel)],
|
|
41
|
+
~extensions=[module(Orders_Extension)],
|
|
42
|
+
~extensionPoints=[module(Products_ExtensionPointMapping)],
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
let make = () =>
|
|
46
|
+
Platform.Plugin.make(
|
|
47
|
+
~name="Catalog",
|
|
48
|
+
~heartbeatInterval=5,
|
|
49
|
+
~extensionPoints=[module(Products_ExtensionPoint)],
|
|
50
|
+
~extensions=[module(Orders_Extension)],
|
|
51
|
+
~aggregates=[module(CategoryAggregate), module(ProductAggregate), module(ProductDemandAggregate)],
|
|
52
|
+
~readModels=[module(CategoriesReadModel), module(ProductDemandsReadModel), module(ProductsReadModel)],
|
|
53
|
+
~tasks=[module(ImportProductsTask)],
|
|
54
|
+
~pluginStructure=pluginStructure,
|
|
55
|
+
~uiFragments=?uiBundleUrl->Option.map(url =>
|
|
56
|
+
Platform.Plugin.makeAutoUIManifest(
|
|
57
|
+
~remoteEntryUrl=url,
|
|
58
|
+
~name="Catalog",
|
|
59
|
+
~pluginStructure,
|
|
60
|
+
~readModelPositions=["platform-summary"],
|
|
61
|
+
~aggregatePositions=["resource-detail"],
|
|
62
|
+
)
|
|
63
|
+
),
|
|
64
|
+
)
|
|
65
|
+
}
|