@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,150 @@
|
|
|
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: "Created",
|
|
9
|
+
name: s.m(S.string),
|
|
10
|
+
description: s.m(S.string),
|
|
11
|
+
price: s.m(S.float)
|
|
12
|
+
}))
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function evolve(state, event) {
|
|
16
|
+
if (typeof state !== "object") {
|
|
17
|
+
if (event.TAG === "Added") {
|
|
18
|
+
return {
|
|
19
|
+
TAG: "Created",
|
|
20
|
+
name: event.name,
|
|
21
|
+
description: event.description,
|
|
22
|
+
price: event.price
|
|
23
|
+
};
|
|
24
|
+
} else {
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
switch (event.TAG) {
|
|
29
|
+
case "Added" :
|
|
30
|
+
return {
|
|
31
|
+
TAG: "Created",
|
|
32
|
+
name: event.name,
|
|
33
|
+
description: event.description,
|
|
34
|
+
price: event.price
|
|
35
|
+
};
|
|
36
|
+
case "NameUpdated" :
|
|
37
|
+
return {
|
|
38
|
+
TAG: "Created",
|
|
39
|
+
name: event.name,
|
|
40
|
+
description: state.description,
|
|
41
|
+
price: state.price
|
|
42
|
+
};
|
|
43
|
+
case "DescriptionUpdated" :
|
|
44
|
+
return {
|
|
45
|
+
TAG: "Created",
|
|
46
|
+
name: state.name,
|
|
47
|
+
description: event.description,
|
|
48
|
+
price: state.price
|
|
49
|
+
};
|
|
50
|
+
case "PriceUpdated" :
|
|
51
|
+
return {
|
|
52
|
+
TAG: "Created",
|
|
53
|
+
name: state.name,
|
|
54
|
+
description: state.description,
|
|
55
|
+
price: event.price
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function decide(state, command) {
|
|
61
|
+
if (typeof state !== "object") {
|
|
62
|
+
if (command.TAG === "Add") {
|
|
63
|
+
return {
|
|
64
|
+
TAG: "Ok",
|
|
65
|
+
_0: [{
|
|
66
|
+
TAG: "Added",
|
|
67
|
+
name: command.name,
|
|
68
|
+
description: command.description,
|
|
69
|
+
price: command.price
|
|
70
|
+
}]
|
|
71
|
+
};
|
|
72
|
+
} else {
|
|
73
|
+
return {
|
|
74
|
+
TAG: "Error",
|
|
75
|
+
_0: "ProductNotFound"
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
switch (command.TAG) {
|
|
80
|
+
case "Add" :
|
|
81
|
+
return {
|
|
82
|
+
TAG: "Error",
|
|
83
|
+
_0: "ProductAlreadyExists"
|
|
84
|
+
};
|
|
85
|
+
case "UpdateName" :
|
|
86
|
+
let name = command.name;
|
|
87
|
+
if (name === state.name) {
|
|
88
|
+
return {
|
|
89
|
+
TAG: "Ok",
|
|
90
|
+
_0: []
|
|
91
|
+
};
|
|
92
|
+
} else {
|
|
93
|
+
return {
|
|
94
|
+
TAG: "Ok",
|
|
95
|
+
_0: [{
|
|
96
|
+
TAG: "NameUpdated",
|
|
97
|
+
name: name
|
|
98
|
+
}]
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
case "UpdateDescription" :
|
|
102
|
+
let description = command.description;
|
|
103
|
+
if (description === state.description) {
|
|
104
|
+
return {
|
|
105
|
+
TAG: "Ok",
|
|
106
|
+
_0: []
|
|
107
|
+
};
|
|
108
|
+
} else {
|
|
109
|
+
return {
|
|
110
|
+
TAG: "Ok",
|
|
111
|
+
_0: [{
|
|
112
|
+
TAG: "DescriptionUpdated",
|
|
113
|
+
description: description
|
|
114
|
+
}]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
case "UpdatePrice" :
|
|
118
|
+
let price = command.price;
|
|
119
|
+
if (price === state.price) {
|
|
120
|
+
return {
|
|
121
|
+
TAG: "Ok",
|
|
122
|
+
_0: []
|
|
123
|
+
};
|
|
124
|
+
} else {
|
|
125
|
+
return {
|
|
126
|
+
TAG: "Ok",
|
|
127
|
+
_0: [{
|
|
128
|
+
TAG: "PriceUpdated",
|
|
129
|
+
price: price
|
|
130
|
+
}]
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
let Spec;
|
|
137
|
+
|
|
138
|
+
let initialState = "NotCreated";
|
|
139
|
+
|
|
140
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Product/Aggregate/Product_Behavior.res.mjs";
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
Spec,
|
|
144
|
+
stateSchema,
|
|
145
|
+
initialState,
|
|
146
|
+
evolve,
|
|
147
|
+
decide,
|
|
148
|
+
moduleUrl,
|
|
149
|
+
}
|
|
150
|
+
/* stateSchema Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
description: s.m(S.string),
|
|
9
|
+
price: s.m(S.float)
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
let config = ReadModel$Reventless.config(undefined, undefined, undefined);
|
|
13
|
+
|
|
14
|
+
let name = "Products";
|
|
15
|
+
|
|
16
|
+
let Id;
|
|
17
|
+
|
|
18
|
+
let subIdConfig;
|
|
19
|
+
|
|
20
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Product/ReadModel/Products.res.mjs";
|
|
21
|
+
|
|
22
|
+
let authorization = "AllowAuthenticated";
|
|
23
|
+
|
|
24
|
+
let visibility = "Public";
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
name,
|
|
28
|
+
Id,
|
|
29
|
+
stateSchema,
|
|
30
|
+
config,
|
|
31
|
+
subIdConfig,
|
|
32
|
+
moduleUrl,
|
|
33
|
+
authorization,
|
|
34
|
+
visibility,
|
|
35
|
+
}
|
|
36
|
+
/* stateSchema Not a pure module */
|
|
Binary file
|
|
@@ -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)]
|
|
@@ -0,0 +1,91 @@
|
|
|
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 "../Aggregate/Product.res.mjs";
|
|
5
|
+
import * as Projection$Reventless from "@reventlessdev/reventless-spec/src/types/Projection.res.mjs";
|
|
6
|
+
import * as Products$CatalogPlugin from "./Products.res.mjs";
|
|
7
|
+
|
|
8
|
+
let M = Projection$Reventless.Mappings.Make({
|
|
9
|
+
Id: Id$Reventless.$$String,
|
|
10
|
+
name: Products$CatalogPlugin.name,
|
|
11
|
+
stateSchema: Products$CatalogPlugin.stateSchema,
|
|
12
|
+
subIdConfig: undefined
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function project(param) {
|
|
16
|
+
let event = param.event;
|
|
17
|
+
let id = param.id;
|
|
18
|
+
switch (event.TAG) {
|
|
19
|
+
case "Added" :
|
|
20
|
+
return {
|
|
21
|
+
TAG: "Set",
|
|
22
|
+
_0: id,
|
|
23
|
+
_1: {
|
|
24
|
+
name: event.name,
|
|
25
|
+
description: event.description,
|
|
26
|
+
price: event.price
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
case "NameUpdated" :
|
|
30
|
+
let name = event.name;
|
|
31
|
+
return {
|
|
32
|
+
TAG: "Update",
|
|
33
|
+
_0: id,
|
|
34
|
+
_1: state => ({
|
|
35
|
+
name: name,
|
|
36
|
+
description: state.description,
|
|
37
|
+
price: state.price
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
case "DescriptionUpdated" :
|
|
41
|
+
let description = event.description;
|
|
42
|
+
return {
|
|
43
|
+
TAG: "Update",
|
|
44
|
+
_0: id,
|
|
45
|
+
_1: state => ({
|
|
46
|
+
name: state.name,
|
|
47
|
+
description: description,
|
|
48
|
+
price: state.price
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
case "PriceUpdated" :
|
|
52
|
+
let price = event.price;
|
|
53
|
+
return {
|
|
54
|
+
TAG: "Update",
|
|
55
|
+
_0: id,
|
|
56
|
+
_1: state => ({
|
|
57
|
+
name: state.name,
|
|
58
|
+
description: state.description,
|
|
59
|
+
price: price
|
|
60
|
+
})
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let ProductMapping = Projection$Reventless.Mapping.Make({
|
|
66
|
+
Id: Id$Reventless.$$String,
|
|
67
|
+
name: Product$CatalogPlugin.name,
|
|
68
|
+
eventSchema: Product$CatalogPlugin.eventSchema
|
|
69
|
+
})({
|
|
70
|
+
Id: Id$Reventless.$$String,
|
|
71
|
+
name: Products$CatalogPlugin.name,
|
|
72
|
+
stateSchema: Products$CatalogPlugin.stateSchema,
|
|
73
|
+
subIdConfig: undefined
|
|
74
|
+
})({
|
|
75
|
+
project: project
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
let mappings = [ProductMapping];
|
|
79
|
+
|
|
80
|
+
let Target;
|
|
81
|
+
|
|
82
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Product/ReadModel/Products_Projections.res.mjs";
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
Target,
|
|
86
|
+
M,
|
|
87
|
+
ProductMapping,
|
|
88
|
+
mappings,
|
|
89
|
+
moduleUrl,
|
|
90
|
+
}
|
|
91
|
+
/* M Not a pure module */
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// ProductDemand aggregate specification.
|
|
2
|
+
// Records per-product order demand, driven by Ordering's OrdersExtensionPoint.
|
|
3
|
+
|
|
4
|
+
@@reventless.spec
|
|
5
|
+
|
|
6
|
+
// Not a UI/API command — driven only by Ordering's OrdersExtensionPoint.
|
|
7
|
+
// @noApi removes it from the GraphQL/MCP/AutoUI surface, so the cross-plugin
|
|
8
|
+
// `orderId` is never rendered as a picker and needs no @ref.
|
|
9
|
+
@schema @noApi
|
|
10
|
+
type command =
|
|
11
|
+
| Record({orderId: string})
|
|
12
|
+
| Revoke({orderId: string})
|
|
13
|
+
|
|
14
|
+
@schema
|
|
15
|
+
type event =
|
|
16
|
+
| Recorded({orderId: string})
|
|
17
|
+
| Revoked({orderId: string})
|
|
18
|
+
|
|
19
|
+
@schema
|
|
20
|
+
type error = unit
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Api$ReventlessInfra from "@reventlessdev/reventless-infra/src/components/Api.res.mjs";
|
|
5
|
+
|
|
6
|
+
let commandSchema = S.union([
|
|
7
|
+
S.schema(s => ({
|
|
8
|
+
TAG: "Record",
|
|
9
|
+
orderId: s.m(S.string)
|
|
10
|
+
})),
|
|
11
|
+
S.schema(s => ({
|
|
12
|
+
TAG: "Revoke",
|
|
13
|
+
orderId: s.m(S.string)
|
|
14
|
+
}))
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
let eventSchema = S.union([
|
|
18
|
+
S.schema(s => ({
|
|
19
|
+
TAG: "Recorded",
|
|
20
|
+
orderId: s.m(S.string)
|
|
21
|
+
})),
|
|
22
|
+
S.schema(s => ({
|
|
23
|
+
TAG: "Revoked",
|
|
24
|
+
orderId: s.m(S.string)
|
|
25
|
+
}))
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
let commandSchema$1 = Api$ReventlessInfra.markNoApi(commandSchema);
|
|
29
|
+
|
|
30
|
+
function commandAuthorization(param) {
|
|
31
|
+
return "AllowAuthenticated";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let name = "ProductDemand";
|
|
35
|
+
|
|
36
|
+
let Id;
|
|
37
|
+
|
|
38
|
+
let errorSchema = S.unit;
|
|
39
|
+
|
|
40
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/ProductDemand/Aggregate/ProductDemand.res.mjs";
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
name,
|
|
44
|
+
Id,
|
|
45
|
+
eventSchema,
|
|
46
|
+
errorSchema,
|
|
47
|
+
commandSchema$1 as commandSchema,
|
|
48
|
+
moduleUrl,
|
|
49
|
+
commandAuthorization,
|
|
50
|
+
}
|
|
51
|
+
/* commandSchema Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// ProductDemand aggregate behavior.
|
|
2
|
+
// Idempotently records and revokes order demand per product.
|
|
3
|
+
|
|
4
|
+
@@reventless.behavior
|
|
5
|
+
|
|
6
|
+
@schema
|
|
7
|
+
type state =
|
|
8
|
+
| NotCreated
|
|
9
|
+
| Created({recordedOrderIds: array<string>})
|
|
10
|
+
|
|
11
|
+
let initialState = NotCreated
|
|
12
|
+
|
|
13
|
+
let evolve = (state, event) =>
|
|
14
|
+
switch (state, event) {
|
|
15
|
+
| (NotCreated, Recorded({orderId})) => Created({recordedOrderIds: [orderId]})
|
|
16
|
+
| (Created(s), Recorded({orderId})) =>
|
|
17
|
+
Created({recordedOrderIds: Array.concat(s.recordedOrderIds, [orderId])})
|
|
18
|
+
| (Created(s), Revoked({orderId})) =>
|
|
19
|
+
Created({recordedOrderIds: s.recordedOrderIds->Array.filter(id => id !== orderId)})
|
|
20
|
+
| (NotCreated, Revoked(_)) => state
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let decide = (state, command) =>
|
|
24
|
+
switch (state, command) {
|
|
25
|
+
| (NotCreated, Record({orderId})) => Ok([Recorded({orderId: orderId})])
|
|
26
|
+
| (NotCreated, Revoke(_)) => Ok([]) // nothing recorded yet — idempotent
|
|
27
|
+
| (Created(s), Record({orderId})) =>
|
|
28
|
+
if s.recordedOrderIds->Array.includes(orderId) {
|
|
29
|
+
Ok([]) // idempotent
|
|
30
|
+
} else {
|
|
31
|
+
Ok([Recorded({orderId: orderId})])
|
|
32
|
+
}
|
|
33
|
+
| (Created(s), Revoke({orderId})) =>
|
|
34
|
+
if !(s.recordedOrderIds->Array.includes(orderId)) {
|
|
35
|
+
Ok([]) // idempotent
|
|
36
|
+
} else {
|
|
37
|
+
Ok([Revoked({orderId: orderId})])
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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: "Created",
|
|
9
|
+
recordedOrderIds: s.m(S.array(S.string))
|
|
10
|
+
}))
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
function evolve(state, event) {
|
|
14
|
+
if (typeof state !== "object") {
|
|
15
|
+
if (event.TAG === "Recorded") {
|
|
16
|
+
return {
|
|
17
|
+
TAG: "Created",
|
|
18
|
+
recordedOrderIds: [event.orderId]
|
|
19
|
+
};
|
|
20
|
+
} else {
|
|
21
|
+
return state;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (event.TAG === "Recorded") {
|
|
25
|
+
return {
|
|
26
|
+
TAG: "Created",
|
|
27
|
+
recordedOrderIds: state.recordedOrderIds.concat([event.orderId])
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
let orderId = event.orderId;
|
|
31
|
+
return {
|
|
32
|
+
TAG: "Created",
|
|
33
|
+
recordedOrderIds: state.recordedOrderIds.filter(id => id !== orderId)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function decide(state, command) {
|
|
38
|
+
if (typeof state !== "object") {
|
|
39
|
+
if (command.TAG === "Record") {
|
|
40
|
+
return {
|
|
41
|
+
TAG: "Ok",
|
|
42
|
+
_0: [{
|
|
43
|
+
TAG: "Recorded",
|
|
44
|
+
orderId: command.orderId
|
|
45
|
+
}]
|
|
46
|
+
};
|
|
47
|
+
} else {
|
|
48
|
+
return {
|
|
49
|
+
TAG: "Ok",
|
|
50
|
+
_0: []
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (command.TAG === "Record") {
|
|
55
|
+
let orderId = command.orderId;
|
|
56
|
+
if (state.recordedOrderIds.includes(orderId)) {
|
|
57
|
+
return {
|
|
58
|
+
TAG: "Ok",
|
|
59
|
+
_0: []
|
|
60
|
+
};
|
|
61
|
+
} else {
|
|
62
|
+
return {
|
|
63
|
+
TAG: "Ok",
|
|
64
|
+
_0: [{
|
|
65
|
+
TAG: "Recorded",
|
|
66
|
+
orderId: orderId
|
|
67
|
+
}]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
let orderId$1 = command.orderId;
|
|
72
|
+
if (state.recordedOrderIds.includes(orderId$1)) {
|
|
73
|
+
return {
|
|
74
|
+
TAG: "Ok",
|
|
75
|
+
_0: [{
|
|
76
|
+
TAG: "Revoked",
|
|
77
|
+
orderId: orderId$1
|
|
78
|
+
}]
|
|
79
|
+
};
|
|
80
|
+
} else {
|
|
81
|
+
return {
|
|
82
|
+
TAG: "Ok",
|
|
83
|
+
_0: []
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let Spec;
|
|
89
|
+
|
|
90
|
+
let initialState = "NotCreated";
|
|
91
|
+
|
|
92
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/ProductDemand/Aggregate/ProductDemand_Behavior.res.mjs";
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
Spec,
|
|
96
|
+
stateSchema,
|
|
97
|
+
initialState,
|
|
98
|
+
evolve,
|
|
99
|
+
decide,
|
|
100
|
+
moduleUrl,
|
|
101
|
+
}
|
|
102
|
+
/* stateSchema Not a pure module */
|
|
Binary file
|
|
@@ -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
|
+
orderCount: s.m(S.int)
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
let config = ReadModel$Reventless.config(undefined, undefined, undefined);
|
|
12
|
+
|
|
13
|
+
let name = "ProductDemands";
|
|
14
|
+
|
|
15
|
+
let Id;
|
|
16
|
+
|
|
17
|
+
let subIdConfig;
|
|
18
|
+
|
|
19
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/ProductDemand/ReadModel/ProductDemands.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 */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// ProductDemands projection mappings.
|
|
2
|
+
// Multi-source read model: combines events from two aggregates.
|
|
3
|
+
// Source 1: Product — initialises the entry on Added.
|
|
4
|
+
// Source 2: ProductDemand — increments / decrements the order count.
|
|
5
|
+
@@reventless.mappings
|
|
6
|
+
|
|
7
|
+
module ProductMapping = Mapping.Make(
|
|
8
|
+
Product,
|
|
9
|
+
ProductDemands,
|
|
10
|
+
{
|
|
11
|
+
open Product
|
|
12
|
+
let project = ({event, id, _}) =>
|
|
13
|
+
switch event {
|
|
14
|
+
| Added({name}) =>
|
|
15
|
+
Set(id, {ProductDemands.name: name, orderCount: 0})
|
|
16
|
+
| _ => Ignore
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
module ProductDemandMapping = Mapping.Make(
|
|
22
|
+
ProductDemand,
|
|
23
|
+
ProductDemands,
|
|
24
|
+
{
|
|
25
|
+
open ProductDemand
|
|
26
|
+
let project = ({event, id, _}) =>
|
|
27
|
+
switch event {
|
|
28
|
+
| Recorded(_) =>
|
|
29
|
+
Update(id, (state: ProductDemands.state) => {...state, orderCount: state.orderCount + 1})
|
|
30
|
+
| Revoked(_) =>
|
|
31
|
+
Update(id, (state: ProductDemands.state) => {...state, orderCount: max(0, state.orderCount - 1)})
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
let mappings: array<module(Mapping)> = [module(ProductMapping), module(ProductDemandMapping)]
|