@reventlessdev/online-shop-aggregates-ordering 3.0.0-alpha.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +846 -0
- package/LICENSE +202 -0
- package/__mocks__/emptyModule.js +1 -0
- package/lib/bs/.compiler.log +2 -0
- package/lib/bs/OrderingPlugin.cmi +0 -0
- package/lib/bs/OrderingPlugin.cmj +0 -0
- package/lib/bs/OrderingPlugin.cmt +0 -0
- package/lib/bs/OrderingPlugin.mlmap +31 -0
- package/lib/bs/build.ninja +0 -0
- package/lib/bs/compiler-info.json +8 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.ast +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.res +18 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct.res.mjs +50 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.ast +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res +27 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res.mjs +87 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.ast +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.res +13 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts.res.mjs +53 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.ast +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res +20 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +65 -0
- package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer.ast +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer.res +24 -0
- package/lib/bs/src/Customer/Aggregate/Customer.res.mjs +64 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior.ast +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior.res +41 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior.res.mjs +143 -0
- package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers.ast +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers.res +12 -0
- package/lib/bs/src/Customer/ReadModel/Customers.res.mjs +36 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections.ast +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections.res +21 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections.res.mjs +91 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Extension/Products_Extension.ast +0 -0
- package/lib/bs/src/Extension/Products_Extension.res +23 -0
- package/lib/bs/src/Extension/Products_Extension.res.mjs +43 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.ast +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res +28 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +59 -0
- package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order.ast +0 -0
- package/lib/bs/src/Order/Aggregate/Order.res +27 -0
- package/lib/bs/src/Order/Aggregate/Order.res.mjs +81 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior.ast +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior.res +52 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior.res.mjs +193 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings.ast +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings.res +15 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings.res.mjs +55 -0
- package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/ReadModel/Orders.ast +0 -0
- package/lib/bs/src/Order/ReadModel/Orders.res +19 -0
- package/lib/bs/src/Order/ReadModel/Orders.res.mjs +62 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections.ast +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections.res +31 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections.res.mjs +89 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification.ast +0 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res +18 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res.mjs +34 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.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 +223 -0
- package/lib/bs/src/Service/EmailService-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Service/EmailService-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Service/EmailService-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Service/EmailService.ast +0 -0
- package/lib/bs/src/Service/EmailService.res +22 -0
- package/lib/bs/src/Service/EmailService.res.mjs +23 -0
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Task/OrderNotifications.ast +0 -0
- package/lib/bs/src/Task/OrderNotifications.res +8 -0
- package/lib/bs/src/Task/OrderNotifications.res.mjs +29 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.ast +0 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res +27 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res.mjs +102 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.ast +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res +15 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res.mjs +83 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT.ast +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res +90 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res.mjs +170 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT.ast +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res +27 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res.mjs +106 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT.ast +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT.res +21 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +106 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +33 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +143 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.ast +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res +52 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +162 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT.ast +0 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT.res +121 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT.res.mjs +231 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT.ast +0 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT.res +46 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT.res.mjs +118 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock.ast +0 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock.res +31 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock.res.mjs +56 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.ast +0 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res +37 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +76 -0
- package/lib/ocaml/.compiler.log +2 -0
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts.ast +0 -0
- package/lib/ocaml/AvailableProducts.res +13 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts_GWT.ast +0 -0
- package/lib/ocaml/AvailableProducts_GWT.res +15 -0
- package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts_Projections.ast +0 -0
- package/lib/ocaml/AvailableProducts_Projections.res +20 -0
- package/lib/ocaml/CatalogProduct-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/CatalogProduct-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct.ast +0 -0
- package/lib/ocaml/CatalogProduct.res +18 -0
- package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct_Behavior.ast +0 -0
- package/lib/ocaml/CatalogProduct_Behavior.res +27 -0
- package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct_GWT.ast +0 -0
- package/lib/ocaml/CatalogProduct_GWT.res +27 -0
- package/lib/ocaml/Customer-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Customer-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer.ast +0 -0
- package/lib/ocaml/Customer.res +24 -0
- package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer_Behavior.ast +0 -0
- package/lib/ocaml/Customer_Behavior.res +41 -0
- package/lib/ocaml/Customer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Customer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer_GWT.ast +0 -0
- package/lib/ocaml/Customer_GWT.res +90 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers.ast +0 -0
- package/lib/ocaml/Customers.res +12 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers_GWT.ast +0 -0
- package/lib/ocaml/Customers_GWT.res +27 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers_Projections.ast +0 -0
- package/lib/ocaml/Customers_Projections.res +21 -0
- package/lib/ocaml/EmailService-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/EmailService-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/EmailService-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/EmailService.ast +0 -0
- package/lib/ocaml/EmailService.res +22 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/EmailService_Mock.ast +0 -0
- package/lib/ocaml/EmailService_Mock.res +31 -0
- package/lib/ocaml/Order-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Order-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order.ast +0 -0
- package/lib/ocaml/Order.res +27 -0
- package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderMappings_GWT.ast +0 -0
- package/lib/ocaml/OrderMappings_GWT.res +52 -0
- package/lib/ocaml/OrderNotifications-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderNotifications-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/OrderNotifications-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderNotifications.ast +0 -0
- package/lib/ocaml/OrderNotifications.res +8 -0
- package/lib/ocaml/Order_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_Behavior-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Order_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_Behavior.ast +0 -0
- package/lib/ocaml/Order_Behavior.res +52 -0
- package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_EmailNotification.ast +0 -0
- package/lib/ocaml/Order_EmailNotification.res +18 -0
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT.ast +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT.res +37 -0
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_GWT.ast +0 -0
- package/lib/ocaml/Order_GWT.res +121 -0
- package/lib/ocaml/Order_Mappings-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_Mappings-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Order_Mappings-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_Mappings.ast +0 -0
- package/lib/ocaml/Order_Mappings.res +15 -0
- package/lib/ocaml/OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderingPlugin.cmj +0 -0
- package/lib/ocaml/OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderingPlugin.mlmap +31 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders.ast +0 -0
- package/lib/ocaml/Orders.res +19 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping.ast +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping.res +28 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT.res +33 -0
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_GWT.ast +0 -0
- package/lib/ocaml/Orders_GWT.res +46 -0
- package/lib/ocaml/Orders_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Projections-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Orders_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_Projections.ast +0 -0
- package/lib/ocaml/Orders_Projections.res +31 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Plugin.ast +0 -0
- package/lib/ocaml/Plugin.res +65 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension.ast +0 -0
- package/lib/ocaml/Products_Extension.res +23 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension_GWT.ast +0 -0
- package/lib/ocaml/Products_Extension_GWT.res +21 -0
- package/package.json +52 -0
- package/rescript.json +39 -0
- package/src/CatalogProduct/Aggregate/CatalogProduct.res +18 -0
- package/src/CatalogProduct/Aggregate/CatalogProduct.res.mjs +50 -0
- package/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res +27 -0
- package/src/CatalogProduct/Aggregate/CatalogProduct_Behavior.res.mjs +87 -0
- package/src/CatalogProduct/ReadModel/AvailableProducts.res +13 -0
- package/src/CatalogProduct/ReadModel/AvailableProducts.res.mjs +53 -0
- package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res +20 -0
- package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +65 -0
- package/src/Customer/Aggregate/Customer.res +24 -0
- package/src/Customer/Aggregate/Customer.res.mjs +64 -0
- package/src/Customer/Aggregate/Customer_Behavior.res +41 -0
- package/src/Customer/Aggregate/Customer_Behavior.res.mjs +143 -0
- package/src/Customer/ReadModel/Customers.res +12 -0
- package/src/Customer/ReadModel/Customers.res.mjs +36 -0
- package/src/Customer/ReadModel/Customers_Projections.res +21 -0
- package/src/Customer/ReadModel/Customers_Projections.res.mjs +91 -0
- package/src/Extension/Products_Extension.res +23 -0
- package/src/Extension/Products_Extension.res.mjs +43 -0
- package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +28 -0
- package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +59 -0
- package/src/Order/Aggregate/Order.res +27 -0
- package/src/Order/Aggregate/Order.res.mjs +81 -0
- package/src/Order/Aggregate/Order_Behavior.res +52 -0
- package/src/Order/Aggregate/Order_Behavior.res.mjs +193 -0
- package/src/Order/Aggregate/Order_Mappings.res +15 -0
- package/src/Order/Aggregate/Order_Mappings.res.mjs +55 -0
- package/src/Order/ReadModel/Orders.res +19 -0
- package/src/Order/ReadModel/Orders.res.mjs +62 -0
- package/src/Order/ReadModel/Orders_Projections.res +31 -0
- package/src/Order/ReadModel/Orders_Projections.res.mjs +89 -0
- package/src/Order/SideEffect/Order_EmailNotification.res +18 -0
- package/src/Order/SideEffect/Order_EmailNotification.res.mjs +34 -0
- package/src/Plugin.res +65 -0
- package/src/Plugin.res.mjs +223 -0
- package/src/Service/EmailService.res +22 -0
- package/src/Service/EmailService.res.mjs +23 -0
- package/src/Task/OrderNotifications.res +8 -0
- package/src/Task/OrderNotifications.res.mjs +29 -0
- package/src/plugin.json +1 -0
- package/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res +27 -0
- package/tests/CatalogProduct/Aggregate/CatalogProduct_GWT.res.mjs +102 -0
- package/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res +15 -0
- package/tests/CatalogProduct/ReadModel/AvailableProducts_GWT.res.mjs +83 -0
- package/tests/Customer/Aggregate/Customer_GWT.res +90 -0
- package/tests/Customer/Aggregate/Customer_GWT.res.mjs +170 -0
- package/tests/Customer/ReadModel/Customers_GWT.res +27 -0
- package/tests/Customer/ReadModel/Customers_GWT.res.mjs +106 -0
- package/tests/Extension/Products_Extension_GWT.res +21 -0
- package/tests/Extension/Products_Extension_GWT.res.mjs +106 -0
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +33 -0
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +143 -0
- package/tests/Order/Aggregate/OrderMappings_GWT.res +52 -0
- package/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +162 -0
- package/tests/Order/Aggregate/Order_GWT.res +121 -0
- package/tests/Order/Aggregate/Order_GWT.res.mjs +231 -0
- package/tests/Order/ReadModel/Orders_GWT.res +46 -0
- package/tests/Order/ReadModel/Orders_GWT.res.mjs +118 -0
- package/tests/Order/SideEffect/EmailService_Mock.res +31 -0
- package/tests/Order/SideEffect/EmailService_Mock.res.mjs +56 -0
- package/tests/Order/SideEffect/Order_EmailNotification_GWT.res +37 -0
- package/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +76 -0
|
@@ -0,0 +1,83 @@
|
|
|
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 AvailableProducts_Projections$OrderingPlugin from "../../../src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs";
|
|
5
|
+
|
|
6
|
+
let include = MultiSourceProjection_GWT$ReventlessGwt.Make(AvailableProducts_Projections$OrderingPlugin.CatalogProductMapping);
|
|
7
|
+
|
|
8
|
+
let describe = include.describe;
|
|
9
|
+
|
|
10
|
+
let test = include.test;
|
|
11
|
+
|
|
12
|
+
let givenEvents = include.givenEvents;
|
|
13
|
+
|
|
14
|
+
let whenEvent = include.whenEvent;
|
|
15
|
+
|
|
16
|
+
let thenState = include.thenState;
|
|
17
|
+
|
|
18
|
+
describe("AvailableProducts ReadModel ← CatalogProduct", () => {
|
|
19
|
+
test("Synced sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
|
|
20
|
+
TAG: "Synced",
|
|
21
|
+
name: "Laptop",
|
|
22
|
+
price: 999.99
|
|
23
|
+
}), {
|
|
24
|
+
name: "Laptop",
|
|
25
|
+
price: 999.99
|
|
26
|
+
}));
|
|
27
|
+
test("PriceUpdated updates the price", undefined, () => thenState(whenEvent(givenEvents([{
|
|
28
|
+
TAG: "Synced",
|
|
29
|
+
name: "Laptop",
|
|
30
|
+
price: 999.99
|
|
31
|
+
}]), {
|
|
32
|
+
TAG: "PriceUpdated",
|
|
33
|
+
price: 899.99
|
|
34
|
+
}), {
|
|
35
|
+
name: "Laptop",
|
|
36
|
+
price: 899.99
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
let describeWithId = include.describeWithId;
|
|
41
|
+
|
|
42
|
+
let givenEventsWithTime = include.givenEventsWithTime;
|
|
43
|
+
|
|
44
|
+
let whenEvents = include.whenEvents;
|
|
45
|
+
|
|
46
|
+
let whenEventWithTime = include.whenEventWithTime;
|
|
47
|
+
|
|
48
|
+
let whenEventsWithTime = include.whenEventsWithTime;
|
|
49
|
+
|
|
50
|
+
let thenStates = include.thenStates;
|
|
51
|
+
|
|
52
|
+
let thenStatesWithId = include.thenStatesWithId;
|
|
53
|
+
|
|
54
|
+
let thenAllStates = include.thenAllStates;
|
|
55
|
+
|
|
56
|
+
let thenStateWithId = include.thenStateWithId;
|
|
57
|
+
|
|
58
|
+
let thenNoState = include.thenNoState;
|
|
59
|
+
|
|
60
|
+
let thenThrow = include.thenThrow;
|
|
61
|
+
|
|
62
|
+
let thenFail = include.thenFail;
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
describe,
|
|
66
|
+
describeWithId,
|
|
67
|
+
test,
|
|
68
|
+
givenEvents,
|
|
69
|
+
givenEventsWithTime,
|
|
70
|
+
whenEvent,
|
|
71
|
+
whenEvents,
|
|
72
|
+
whenEventWithTime,
|
|
73
|
+
whenEventsWithTime,
|
|
74
|
+
thenStates,
|
|
75
|
+
thenStatesWithId,
|
|
76
|
+
thenAllStates,
|
|
77
|
+
thenState,
|
|
78
|
+
thenStateWithId,
|
|
79
|
+
thenNoState,
|
|
80
|
+
thenThrow,
|
|
81
|
+
thenFail,
|
|
82
|
+
}
|
|
83
|
+
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@@reventless.gwt
|
|
2
|
+
|
|
3
|
+
describe("Customer Behavior", () => {
|
|
4
|
+
test("Register on new aggregate produces Registered", () =>
|
|
5
|
+
givenEvents([])
|
|
6
|
+
->whenCmd(Register({email: "alice@example.com", address: "123 Main St"}))
|
|
7
|
+
->thenEvent(Registered({email: "alice@example.com", address: "123 Main St"}))
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
test("Register on existing aggregate returns CustomerAlreadyRegistered", () =>
|
|
11
|
+
givenEvents([Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
12
|
+
->whenCmd(Register({email: "bob@example.com", address: "456 Oak Ave"}))
|
|
13
|
+
->thenError(CustomerAlreadyRegistered)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("Register on deactivated aggregate returns CustomerAlreadyDeactivated", () =>
|
|
17
|
+
givenEvents([
|
|
18
|
+
Registered({email: "alice@example.com", address: "123 Main St"}),
|
|
19
|
+
Deactivated,
|
|
20
|
+
])
|
|
21
|
+
->whenCmd(Register({email: "bob@example.com", address: "456 Oak Ave"}))
|
|
22
|
+
->thenError(CustomerAlreadyDeactivated)
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
test("UpdateEmail on non-existent aggregate returns CustomerNotFound", () =>
|
|
26
|
+
givenEvents([])
|
|
27
|
+
->whenCmd(UpdateEmail({email: "x@y"}))
|
|
28
|
+
->thenError(CustomerNotFound)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
test("UpdateEmail on active customer produces EmailUpdated", () =>
|
|
32
|
+
givenEvents([Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
33
|
+
->whenCmd(UpdateEmail({email: "alice2@example.com"}))
|
|
34
|
+
->thenEvent(EmailUpdated({email: "alice2@example.com"}))
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
test("UpdateEmail to same email produces no events (idempotent)", () =>
|
|
38
|
+
givenEvents([Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
39
|
+
->whenCmd(UpdateEmail({email: "alice@example.com"}))
|
|
40
|
+
->thenNoEvent
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
test("UpdateEmail on deactivated customer returns CustomerAlreadyDeactivated", () =>
|
|
44
|
+
givenEvents([
|
|
45
|
+
Registered({email: "alice@example.com", address: "123 Main St"}),
|
|
46
|
+
Deactivated,
|
|
47
|
+
])
|
|
48
|
+
->whenCmd(UpdateEmail({email: "x@y"}))
|
|
49
|
+
->thenError(CustomerAlreadyDeactivated)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
test("UpdateAddress on non-existent aggregate returns CustomerNotFound", () =>
|
|
53
|
+
givenEvents([])
|
|
54
|
+
->whenCmd(UpdateAddress({address: "x"}))
|
|
55
|
+
->thenError(CustomerNotFound)
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
test("UpdateAddress on active customer produces AddressUpdated", () =>
|
|
59
|
+
givenEvents([Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
60
|
+
->whenCmd(UpdateAddress({address: "789 Pine Rd"}))
|
|
61
|
+
->thenEvent(AddressUpdated({address: "789 Pine Rd"}))
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
test("UpdateAddress to same address produces no events (idempotent)", () =>
|
|
65
|
+
givenEvents([Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
66
|
+
->whenCmd(UpdateAddress({address: "123 Main St"}))
|
|
67
|
+
->thenNoEvent
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
test("Deactivate on non-existent aggregate returns CustomerNotFound", () =>
|
|
71
|
+
givenEvents([])
|
|
72
|
+
->whenCmd(Deactivate)
|
|
73
|
+
->thenError(CustomerNotFound)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
test("Deactivate on active customer produces Deactivated", () =>
|
|
77
|
+
givenEvents([Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
78
|
+
->whenCmd(Deactivate)
|
|
79
|
+
->thenEvent(Deactivated)
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
test("Deactivate on deactivated customer produces no events (idempotent)", () =>
|
|
83
|
+
givenEvents([
|
|
84
|
+
Registered({email: "alice@example.com", address: "123 Main St"}),
|
|
85
|
+
Deactivated,
|
|
86
|
+
])
|
|
87
|
+
->whenCmd(Deactivate)
|
|
88
|
+
->thenNoEvent
|
|
89
|
+
)
|
|
90
|
+
})
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Customer$OrderingPlugin from "../../../src/Customer/Aggregate/Customer.res.mjs";
|
|
4
|
+
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
5
|
+
import * as Customer_Behavior$OrderingPlugin from "../../../src/Customer/Aggregate/Customer_Behavior.res.mjs";
|
|
6
|
+
|
|
7
|
+
let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
|
|
8
|
+
name: Customer$OrderingPlugin.name,
|
|
9
|
+
commandSchema: Customer$OrderingPlugin.commandSchema,
|
|
10
|
+
eventSchema: Customer$OrderingPlugin.eventSchema,
|
|
11
|
+
errorSchema: Customer$OrderingPlugin.errorSchema
|
|
12
|
+
})({
|
|
13
|
+
Spec: {
|
|
14
|
+
name: Customer$OrderingPlugin.name,
|
|
15
|
+
commandSchema: Customer$OrderingPlugin.commandSchema,
|
|
16
|
+
eventSchema: Customer$OrderingPlugin.eventSchema,
|
|
17
|
+
errorSchema: Customer$OrderingPlugin.errorSchema
|
|
18
|
+
},
|
|
19
|
+
initialState: Customer_Behavior$OrderingPlugin.initialState,
|
|
20
|
+
evolve: Customer_Behavior$OrderingPlugin.evolve,
|
|
21
|
+
decide: Customer_Behavior$OrderingPlugin.decide,
|
|
22
|
+
moduleUrl: Customer_Behavior$OrderingPlugin.moduleUrl
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
let describe = include.describe;
|
|
26
|
+
|
|
27
|
+
let test = include.test;
|
|
28
|
+
|
|
29
|
+
let givenEvents = include.givenEvents;
|
|
30
|
+
|
|
31
|
+
let whenCmd = include.whenCmd;
|
|
32
|
+
|
|
33
|
+
let thenEvent = include.thenEvent;
|
|
34
|
+
|
|
35
|
+
let thenNoEvent = include.thenNoEvent;
|
|
36
|
+
|
|
37
|
+
let thenError = include.thenError;
|
|
38
|
+
|
|
39
|
+
describe("Customer Behavior", () => {
|
|
40
|
+
test("Register on new aggregate produces Registered", () => thenEvent(whenCmd(givenEvents([]), {
|
|
41
|
+
TAG: "Register",
|
|
42
|
+
email: "alice@example.com",
|
|
43
|
+
address: "123 Main St"
|
|
44
|
+
}), {
|
|
45
|
+
TAG: "Registered",
|
|
46
|
+
email: "alice@example.com",
|
|
47
|
+
address: "123 Main St"
|
|
48
|
+
}));
|
|
49
|
+
test("Register on existing aggregate returns CustomerAlreadyRegistered", () => thenError(whenCmd(givenEvents([{
|
|
50
|
+
TAG: "Registered",
|
|
51
|
+
email: "alice@example.com",
|
|
52
|
+
address: "123 Main St"
|
|
53
|
+
}]), {
|
|
54
|
+
TAG: "Register",
|
|
55
|
+
email: "bob@example.com",
|
|
56
|
+
address: "456 Oak Ave"
|
|
57
|
+
}), "CustomerAlreadyRegistered"));
|
|
58
|
+
test("Register on deactivated aggregate returns CustomerAlreadyDeactivated", () => thenError(whenCmd(givenEvents([
|
|
59
|
+
{
|
|
60
|
+
TAG: "Registered",
|
|
61
|
+
email: "alice@example.com",
|
|
62
|
+
address: "123 Main St"
|
|
63
|
+
},
|
|
64
|
+
"Deactivated"
|
|
65
|
+
]), {
|
|
66
|
+
TAG: "Register",
|
|
67
|
+
email: "bob@example.com",
|
|
68
|
+
address: "456 Oak Ave"
|
|
69
|
+
}), "CustomerAlreadyDeactivated"));
|
|
70
|
+
test("UpdateEmail on non-existent aggregate returns CustomerNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
71
|
+
TAG: "UpdateEmail",
|
|
72
|
+
email: "x@y"
|
|
73
|
+
}), "CustomerNotFound"));
|
|
74
|
+
test("UpdateEmail on active customer produces EmailUpdated", () => thenEvent(whenCmd(givenEvents([{
|
|
75
|
+
TAG: "Registered",
|
|
76
|
+
email: "alice@example.com",
|
|
77
|
+
address: "123 Main St"
|
|
78
|
+
}]), {
|
|
79
|
+
TAG: "UpdateEmail",
|
|
80
|
+
email: "alice2@example.com"
|
|
81
|
+
}), {
|
|
82
|
+
TAG: "EmailUpdated",
|
|
83
|
+
email: "alice2@example.com"
|
|
84
|
+
}));
|
|
85
|
+
test("UpdateEmail to same email produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
86
|
+
TAG: "Registered",
|
|
87
|
+
email: "alice@example.com",
|
|
88
|
+
address: "123 Main St"
|
|
89
|
+
}]), {
|
|
90
|
+
TAG: "UpdateEmail",
|
|
91
|
+
email: "alice@example.com"
|
|
92
|
+
})));
|
|
93
|
+
test("UpdateEmail on deactivated customer returns CustomerAlreadyDeactivated", () => thenError(whenCmd(givenEvents([
|
|
94
|
+
{
|
|
95
|
+
TAG: "Registered",
|
|
96
|
+
email: "alice@example.com",
|
|
97
|
+
address: "123 Main St"
|
|
98
|
+
},
|
|
99
|
+
"Deactivated"
|
|
100
|
+
]), {
|
|
101
|
+
TAG: "UpdateEmail",
|
|
102
|
+
email: "x@y"
|
|
103
|
+
}), "CustomerAlreadyDeactivated"));
|
|
104
|
+
test("UpdateAddress on non-existent aggregate returns CustomerNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
105
|
+
TAG: "UpdateAddress",
|
|
106
|
+
address: "x"
|
|
107
|
+
}), "CustomerNotFound"));
|
|
108
|
+
test("UpdateAddress on active customer produces AddressUpdated", () => thenEvent(whenCmd(givenEvents([{
|
|
109
|
+
TAG: "Registered",
|
|
110
|
+
email: "alice@example.com",
|
|
111
|
+
address: "123 Main St"
|
|
112
|
+
}]), {
|
|
113
|
+
TAG: "UpdateAddress",
|
|
114
|
+
address: "789 Pine Rd"
|
|
115
|
+
}), {
|
|
116
|
+
TAG: "AddressUpdated",
|
|
117
|
+
address: "789 Pine Rd"
|
|
118
|
+
}));
|
|
119
|
+
test("UpdateAddress to same address produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
120
|
+
TAG: "Registered",
|
|
121
|
+
email: "alice@example.com",
|
|
122
|
+
address: "123 Main St"
|
|
123
|
+
}]), {
|
|
124
|
+
TAG: "UpdateAddress",
|
|
125
|
+
address: "123 Main St"
|
|
126
|
+
})));
|
|
127
|
+
test("Deactivate on non-existent aggregate returns CustomerNotFound", () => thenError(whenCmd(givenEvents([]), "Deactivate"), "CustomerNotFound"));
|
|
128
|
+
test("Deactivate on active customer produces Deactivated", () => thenEvent(whenCmd(givenEvents([{
|
|
129
|
+
TAG: "Registered",
|
|
130
|
+
email: "alice@example.com",
|
|
131
|
+
address: "123 Main St"
|
|
132
|
+
}]), "Deactivate"), "Deactivated"));
|
|
133
|
+
test("Deactivate on deactivated customer produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
|
|
134
|
+
{
|
|
135
|
+
TAG: "Registered",
|
|
136
|
+
email: "alice@example.com",
|
|
137
|
+
address: "123 Main St"
|
|
138
|
+
},
|
|
139
|
+
"Deactivated"
|
|
140
|
+
]), "Deactivate")));
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
let Spec = include.Spec;
|
|
144
|
+
|
|
145
|
+
let thenCompareEvent = include.thenCompareEvent;
|
|
146
|
+
|
|
147
|
+
let thenEventWithError = include.thenEventWithError;
|
|
148
|
+
|
|
149
|
+
let thenEvents = include.thenEvents;
|
|
150
|
+
|
|
151
|
+
let thenCompareEvents = include.thenCompareEvents;
|
|
152
|
+
|
|
153
|
+
let thenEventsWithError = include.thenEventsWithError;
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
Spec,
|
|
157
|
+
describe,
|
|
158
|
+
test,
|
|
159
|
+
givenEvents,
|
|
160
|
+
whenCmd,
|
|
161
|
+
thenEvent,
|
|
162
|
+
thenCompareEvent,
|
|
163
|
+
thenNoEvent,
|
|
164
|
+
thenEventWithError,
|
|
165
|
+
thenEvents,
|
|
166
|
+
thenCompareEvents,
|
|
167
|
+
thenEventsWithError,
|
|
168
|
+
thenError,
|
|
169
|
+
}
|
|
170
|
+
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@@reventless.gwt(Customers_Projections.CustomerMapping)
|
|
2
|
+
|
|
3
|
+
describe("Customers ReadModel ← Customer", () => {
|
|
4
|
+
test("Registered sets initial read model state", () =>
|
|
5
|
+
givenEvents([])
|
|
6
|
+
->whenEvent(Customer.Registered({email: "alice@example.com", address: "123 Main St"}))
|
|
7
|
+
->thenState({Customers.email: "alice@example.com", address: "123 Main St", deactivated: false})
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
test("EmailUpdated updates the email", () =>
|
|
11
|
+
givenEvents([Customer.Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
12
|
+
->whenEvent(Customer.EmailUpdated({email: "alice2@example.com"}))
|
|
13
|
+
->thenState({Customers.email: "alice2@example.com", address: "123 Main St", deactivated: false})
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("AddressUpdated updates the address", () =>
|
|
17
|
+
givenEvents([Customer.Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
18
|
+
->whenEvent(Customer.AddressUpdated({address: "789 Pine Rd"}))
|
|
19
|
+
->thenState({Customers.email: "alice@example.com", address: "789 Pine Rd", deactivated: false})
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
test("Deactivated sets deactivated flag", () =>
|
|
23
|
+
givenEvents([Customer.Registered({email: "alice@example.com", address: "123 Main St"})])
|
|
24
|
+
->whenEvent(Customer.Deactivated)
|
|
25
|
+
->thenState({Customers.email: "alice@example.com", address: "123 Main St", deactivated: true})
|
|
26
|
+
)
|
|
27
|
+
})
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Customers_Projections$OrderingPlugin from "../../../src/Customer/ReadModel/Customers_Projections.res.mjs";
|
|
4
|
+
import * as MultiSourceProjection_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/MultiSourceProjection_GWT.res.mjs";
|
|
5
|
+
|
|
6
|
+
let include = MultiSourceProjection_GWT$ReventlessGwt.Make(Customers_Projections$OrderingPlugin.CustomerMapping);
|
|
7
|
+
|
|
8
|
+
let describe = include.describe;
|
|
9
|
+
|
|
10
|
+
let test = include.test;
|
|
11
|
+
|
|
12
|
+
let givenEvents = include.givenEvents;
|
|
13
|
+
|
|
14
|
+
let whenEvent = include.whenEvent;
|
|
15
|
+
|
|
16
|
+
let thenState = include.thenState;
|
|
17
|
+
|
|
18
|
+
describe("Customers ReadModel ← Customer", () => {
|
|
19
|
+
test("Registered sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
|
|
20
|
+
TAG: "Registered",
|
|
21
|
+
email: "alice@example.com",
|
|
22
|
+
address: "123 Main St"
|
|
23
|
+
}), {
|
|
24
|
+
email: "alice@example.com",
|
|
25
|
+
address: "123 Main St",
|
|
26
|
+
deactivated: false
|
|
27
|
+
}));
|
|
28
|
+
test("EmailUpdated updates the email", undefined, () => thenState(whenEvent(givenEvents([{
|
|
29
|
+
TAG: "Registered",
|
|
30
|
+
email: "alice@example.com",
|
|
31
|
+
address: "123 Main St"
|
|
32
|
+
}]), {
|
|
33
|
+
TAG: "EmailUpdated",
|
|
34
|
+
email: "alice2@example.com"
|
|
35
|
+
}), {
|
|
36
|
+
email: "alice2@example.com",
|
|
37
|
+
address: "123 Main St",
|
|
38
|
+
deactivated: false
|
|
39
|
+
}));
|
|
40
|
+
test("AddressUpdated updates the address", undefined, () => thenState(whenEvent(givenEvents([{
|
|
41
|
+
TAG: "Registered",
|
|
42
|
+
email: "alice@example.com",
|
|
43
|
+
address: "123 Main St"
|
|
44
|
+
}]), {
|
|
45
|
+
TAG: "AddressUpdated",
|
|
46
|
+
address: "789 Pine Rd"
|
|
47
|
+
}), {
|
|
48
|
+
email: "alice@example.com",
|
|
49
|
+
address: "789 Pine Rd",
|
|
50
|
+
deactivated: false
|
|
51
|
+
}));
|
|
52
|
+
test("Deactivated sets deactivated flag", undefined, () => thenState(whenEvent(givenEvents([{
|
|
53
|
+
TAG: "Registered",
|
|
54
|
+
email: "alice@example.com",
|
|
55
|
+
address: "123 Main St"
|
|
56
|
+
}]), "Deactivated"), {
|
|
57
|
+
email: "alice@example.com",
|
|
58
|
+
address: "123 Main St",
|
|
59
|
+
deactivated: true
|
|
60
|
+
}));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
let describeWithId = include.describeWithId;
|
|
64
|
+
|
|
65
|
+
let givenEventsWithTime = include.givenEventsWithTime;
|
|
66
|
+
|
|
67
|
+
let whenEvents = include.whenEvents;
|
|
68
|
+
|
|
69
|
+
let whenEventWithTime = include.whenEventWithTime;
|
|
70
|
+
|
|
71
|
+
let whenEventsWithTime = include.whenEventsWithTime;
|
|
72
|
+
|
|
73
|
+
let thenStates = include.thenStates;
|
|
74
|
+
|
|
75
|
+
let thenStatesWithId = include.thenStatesWithId;
|
|
76
|
+
|
|
77
|
+
let thenAllStates = include.thenAllStates;
|
|
78
|
+
|
|
79
|
+
let thenStateWithId = include.thenStateWithId;
|
|
80
|
+
|
|
81
|
+
let thenNoState = include.thenNoState;
|
|
82
|
+
|
|
83
|
+
let thenThrow = include.thenThrow;
|
|
84
|
+
|
|
85
|
+
let thenFail = include.thenFail;
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
describe,
|
|
89
|
+
describeWithId,
|
|
90
|
+
test,
|
|
91
|
+
givenEvents,
|
|
92
|
+
givenEventsWithTime,
|
|
93
|
+
whenEvent,
|
|
94
|
+
whenEvents,
|
|
95
|
+
whenEventWithTime,
|
|
96
|
+
whenEventsWithTime,
|
|
97
|
+
thenStates,
|
|
98
|
+
thenStatesWithId,
|
|
99
|
+
thenAllStates,
|
|
100
|
+
thenState,
|
|
101
|
+
thenStateWithId,
|
|
102
|
+
thenNoState,
|
|
103
|
+
thenThrow,
|
|
104
|
+
thenFail,
|
|
105
|
+
}
|
|
106
|
+
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Boundary GWT for Ordering's Products extension: public Catalog events become
|
|
2
|
+
// CatalogProduct commands on Ordering's local shadow aggregate.
|
|
3
|
+
@@reventless.gwt
|
|
4
|
+
|
|
5
|
+
// `Mapping` is brought into scope by the PPX `open Products_Extension`; opening
|
|
6
|
+
// it surfaces the extension point's events and the delegate's commands.
|
|
7
|
+
open Mapping
|
|
8
|
+
|
|
9
|
+
describe("Products Extension delegate", () => {
|
|
10
|
+
test("ProductBecameAvailable issues Sync", () =>
|
|
11
|
+
whenIncomingEvent(
|
|
12
|
+
ExtensionPoint.ProductBecameAvailable({productId: "p1", name: "Book", price: 9.99}),
|
|
13
|
+
)->thenPublishesAggregateCommand("p1", Delegate.Sync({name: "Book", price: 9.99}))
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
test("ProductPriceChanged issues UpdatePrice", () =>
|
|
17
|
+
whenIncomingEvent(
|
|
18
|
+
ExtensionPoint.ProductPriceChanged({productId: "p1", price: 7.5}),
|
|
19
|
+
)->thenPublishesAggregateCommand("p1", Delegate.UpdatePrice({price: 7.5}))
|
|
20
|
+
)
|
|
21
|
+
})
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
4
|
+
import * as Delegate_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Delegate_GWT.res.mjs";
|
|
5
|
+
import * as CatalogProduct$OrderingPlugin from "../../src/CatalogProduct/Aggregate/CatalogProduct.res.mjs";
|
|
6
|
+
import * as Products_Extension$OrderingPlugin from "../../src/Extension/Products_Extension.res.mjs";
|
|
7
|
+
import * as Products_ExtensionPoint$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/Products_ExtensionPoint.res.mjs";
|
|
8
|
+
|
|
9
|
+
let include = Delegate_GWT$ReventlessGwt.FromExtension({
|
|
10
|
+
ExtensionPoint: {
|
|
11
|
+
name: Products_ExtensionPoint$CatalogSpec.name,
|
|
12
|
+
moduleUrl: Products_ExtensionPoint$CatalogSpec.moduleUrl,
|
|
13
|
+
commandSchema: Products_ExtensionPoint$CatalogSpec.commandSchema,
|
|
14
|
+
eventSchema: Products_ExtensionPoint$CatalogSpec.eventSchema,
|
|
15
|
+
directiveSchema: Products_ExtensionPoint$CatalogSpec.directiveSchema
|
|
16
|
+
},
|
|
17
|
+
Delegate: {
|
|
18
|
+
Id: Id$Reventless.$$String,
|
|
19
|
+
name: CatalogProduct$OrderingPlugin.name,
|
|
20
|
+
eventSchema: CatalogProduct$OrderingPlugin.eventSchema,
|
|
21
|
+
errorSchema: CatalogProduct$OrderingPlugin.errorSchema,
|
|
22
|
+
commandSchema: CatalogProduct$OrderingPlugin.commandSchema,
|
|
23
|
+
moduleUrl: CatalogProduct$OrderingPlugin.moduleUrl,
|
|
24
|
+
commandAuthorization: CatalogProduct$OrderingPlugin.commandAuthorization
|
|
25
|
+
},
|
|
26
|
+
moduleUrl: Products_Extension$OrderingPlugin.Mapping.moduleUrl,
|
|
27
|
+
delegateModuleUrl: Products_Extension$OrderingPlugin.Mapping.delegateModuleUrl,
|
|
28
|
+
mapIncomingEvent: Products_Extension$OrderingPlugin.Mapping.mapIncomingEvent,
|
|
29
|
+
mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
let describe = include.describe;
|
|
33
|
+
|
|
34
|
+
let test = include.test;
|
|
35
|
+
|
|
36
|
+
let whenIncomingEvent = include.whenIncomingEvent;
|
|
37
|
+
|
|
38
|
+
let thenPublishesAggregateCommand = include.thenPublishesAggregateCommand;
|
|
39
|
+
|
|
40
|
+
describe("Products Extension delegate", () => {
|
|
41
|
+
test("ProductBecameAvailable issues Sync", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
|
|
42
|
+
TAG: "ProductBecameAvailable",
|
|
43
|
+
productId: "p1",
|
|
44
|
+
name: "Book",
|
|
45
|
+
price: 9.99
|
|
46
|
+
}), "p1", {
|
|
47
|
+
TAG: "Sync",
|
|
48
|
+
name: "Book",
|
|
49
|
+
price: 9.99
|
|
50
|
+
}));
|
|
51
|
+
test("ProductPriceChanged issues UpdatePrice", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
|
|
52
|
+
TAG: "ProductPriceChanged",
|
|
53
|
+
productId: "p1",
|
|
54
|
+
price: 7.5
|
|
55
|
+
}), "p1", {
|
|
56
|
+
TAG: "UpdatePrice",
|
|
57
|
+
price: 7.5
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
let encCmd = include.encCmd;
|
|
62
|
+
|
|
63
|
+
let encEpCmd = include.encEpCmd;
|
|
64
|
+
|
|
65
|
+
let encDirective = include.encDirective;
|
|
66
|
+
|
|
67
|
+
let EvCore = include.EvCore;
|
|
68
|
+
|
|
69
|
+
let OutCore = include.OutCore;
|
|
70
|
+
|
|
71
|
+
let thenPublishesNothing = include.thenPublishesNothing;
|
|
72
|
+
|
|
73
|
+
let thenPublishesCommand = include.thenPublishesCommand;
|
|
74
|
+
|
|
75
|
+
let thenPublishesCommands = include.thenPublishesCommands;
|
|
76
|
+
|
|
77
|
+
let whenDelegateEvent = include.whenDelegateEvent;
|
|
78
|
+
|
|
79
|
+
let thenPublishesExtensionPointCommand = include.thenPublishesExtensionPointCommand;
|
|
80
|
+
|
|
81
|
+
let thenHandlesDirective = include.thenHandlesDirective;
|
|
82
|
+
|
|
83
|
+
let thenHandlesDirectives = include.thenHandlesDirectives;
|
|
84
|
+
|
|
85
|
+
let thenHandlesNoDirective = include.thenHandlesNoDirective;
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
encCmd,
|
|
89
|
+
encEpCmd,
|
|
90
|
+
encDirective,
|
|
91
|
+
EvCore,
|
|
92
|
+
OutCore,
|
|
93
|
+
describe,
|
|
94
|
+
test,
|
|
95
|
+
thenPublishesNothing,
|
|
96
|
+
whenIncomingEvent,
|
|
97
|
+
thenPublishesCommand,
|
|
98
|
+
thenPublishesCommands,
|
|
99
|
+
thenPublishesAggregateCommand,
|
|
100
|
+
whenDelegateEvent,
|
|
101
|
+
thenPublishesExtensionPointCommand,
|
|
102
|
+
thenHandlesDirective,
|
|
103
|
+
thenHandlesDirectives,
|
|
104
|
+
thenHandlesNoDirective,
|
|
105
|
+
}
|
|
106
|
+
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Boundary GWT for the Orders extension point: batch order events decompose
|
|
2
|
+
// into one public per-product event each (one-to-many fan-out).
|
|
3
|
+
@@reventless.gwt
|
|
4
|
+
|
|
5
|
+
describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
|
|
6
|
+
test("Placed fans out to one ItemOrdered per product", () =>
|
|
7
|
+
whenDelegateEvent(
|
|
8
|
+
Delegate.Placed({customerId: "c1", productIds: ["p1", "p2"]}),
|
|
9
|
+
)->thenPublishesEvents([
|
|
10
|
+
("p1", ExtensionPoint.ItemOrdered({productId: "p1", orderId: "gwt-id", customerId: "c1"})),
|
|
11
|
+
("p2", ExtensionPoint.ItemOrdered({productId: "p2", orderId: "gwt-id", customerId: "c1"})),
|
|
12
|
+
])
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
test("Cancelled fans out to one ItemOrderCancelled per product", () =>
|
|
16
|
+
whenDelegateEvent(
|
|
17
|
+
Delegate.Cancelled({productIds: ["p1", "p2"]}),
|
|
18
|
+
)->thenPublishesEvents([
|
|
19
|
+
("p1", ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "gwt-id"})),
|
|
20
|
+
("p2", ExtensionPoint.ItemOrderCancelled({productId: "p2", orderId: "gwt-id"})),
|
|
21
|
+
])
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
test("Shipped publishes nothing", () =>
|
|
25
|
+
whenDelegateEvent(Delegate.Shipped)->thenPublishesNothing
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
test("Refunded publishes nothing", () =>
|
|
29
|
+
whenDelegateEvent(
|
|
30
|
+
Delegate.Refunded({reason: "customer-changed-mind"}),
|
|
31
|
+
)->thenPublishesNothing
|
|
32
|
+
)
|
|
33
|
+
})
|