@reventlessdev/online-shop-aggregates-ordering 3.0.0-alpha.244 → 3.0.0-alpha.246
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 +15 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/OrderingPlugin.cmi +0 -0
- package/lib/bs/OrderingPlugin.cmt +0 -0
- package/lib/bs/OrderingPlugin.mlmap +2 -0
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmi +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 +2 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmi +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 +2 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +4 -4
- package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmi +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 +2 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/CustomerId.ast +0 -0
- package/lib/bs/src/Customer/CustomerId.res +4 -0
- package/lib/bs/src/Customer/CustomerId.res.mjs +29 -0
- package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmi +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 +2 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections.res.mjs +4 -4
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +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 +6 -2
- package/lib/bs/src/Extension/Products_Extension.res.mjs +4 -3
- 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 +23 -8
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +28 -20
- package/lib/bs/src/LifecycleModel-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/LifecycleModel-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmi +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 +7 -3
- package/lib/bs/src/Order/Aggregate/Order.res.mjs +7 -6
- package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmi +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 +1 -1
- package/lib/bs/src/Order/Aggregate/Order_Behavior.res.mjs +4 -2
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings.res.mjs +3 -3
- package/lib/bs/src/Order/OrderId-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/OrderId-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/OrderId-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/OrderId.ast +0 -0
- package/lib/bs/src/Order/OrderId.res +4 -0
- package/lib/bs/src/Order/OrderId.res.mjs +29 -0
- package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmi +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 +4 -2
- package/lib/bs/src/Order/ReadModel/Orders.res.mjs +4 -2
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections.res.mjs +4 -4
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmi +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 +4 -1
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification.res.mjs +4 -3
- package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin.res.mjs +15 -13
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Task/OrderNotifications.res.mjs +3 -3
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +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 +4 -2
- package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +7 -4
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +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 +6 -2
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +18 -7
- 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 +6 -4
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +19 -11
- package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmi +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 +29 -24
- package/lib/bs/tests/Order/Aggregate/Order_GWT.res.mjs +55 -44
- package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmi +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 +19 -14
- package/lib/bs/tests/Order/ReadModel/Orders_GWT.res.mjs +31 -20
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmi +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 +5 -2
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +8 -6
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts.ast +0 -0
- package/lib/ocaml/AvailableProducts.res +2 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct.ast +0 -0
- package/lib/ocaml/CatalogProduct.res +2 -0
- package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer.ast +0 -0
- package/lib/ocaml/Customer.res +2 -0
- package/lib/ocaml/CustomerId-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CustomerId-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/CustomerId-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CustomerId.ast +0 -0
- package/lib/ocaml/CustomerId.res +4 -0
- package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers.ast +0 -0
- package/lib/ocaml/Customers.res +2 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/LifecycleModel-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/LifecycleModel-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order.ast +0 -0
- package/lib/ocaml/Order.res +7 -3
- package/lib/ocaml/OrderId-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderId-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/OrderId-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderId.ast +0 -0
- package/lib/ocaml/OrderId.res +4 -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 +6 -4
- package/lib/ocaml/OrderNotifications-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderNotifications-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_Behavior-OrderingPlugin.cmi +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 +1 -1
- package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmi +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 +4 -1
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +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 +5 -2
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +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 +29 -24
- package/lib/ocaml/Order_Mappings-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_Mappings-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderingPlugin.mlmap +2 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders.ast +0 -0
- package/lib/ocaml/Orders.res +4 -2
- 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 +23 -8
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +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 +6 -2
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +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 +19 -14
- package/lib/ocaml/Orders_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +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 +6 -2
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +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 +4 -2
- package/package.json +8 -8
- package/src/CatalogProduct/Aggregate/CatalogProduct.res +2 -0
- package/src/CatalogProduct/ReadModel/AvailableProducts.res +2 -0
- package/src/CatalogProduct/ReadModel/AvailableProducts_Projections.res.mjs +4 -4
- package/src/Customer/Aggregate/Customer.res +2 -0
- package/src/Customer/CustomerId.res +4 -0
- package/src/Customer/CustomerId.res.mjs +29 -0
- package/src/Customer/ReadModel/Customers.res +2 -0
- package/src/Customer/ReadModel/Customers_Projections.res.mjs +4 -4
- package/src/Extension/Products_Extension.res +6 -2
- package/src/Extension/Products_Extension.res.mjs +4 -3
- package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +23 -8
- package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +28 -20
- package/src/Order/Aggregate/Order.res +7 -3
- package/src/Order/Aggregate/Order.res.mjs +7 -6
- package/src/Order/Aggregate/Order_Behavior.res +1 -1
- package/src/Order/Aggregate/Order_Behavior.res.mjs +4 -2
- package/src/Order/Aggregate/Order_Mappings.res.mjs +3 -3
- package/src/Order/OrderId.res +4 -0
- package/src/Order/OrderId.res.mjs +29 -0
- package/src/Order/ReadModel/Orders.res +4 -2
- package/src/Order/ReadModel/Orders.res.mjs +4 -2
- package/src/Order/ReadModel/Orders_Projections.res.mjs +4 -4
- package/src/Order/SideEffect/Order_EmailNotification.res +4 -1
- package/src/Order/SideEffect/Order_EmailNotification.res.mjs +4 -3
- package/src/Plugin.res.mjs +15 -13
- package/src/Task/OrderNotifications.res.mjs +3 -3
- package/tests/Extension/Products_Extension_GWT.res +4 -2
- package/tests/Extension/Products_Extension_GWT.res.mjs +7 -4
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +6 -2
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +18 -7
- package/tests/Order/Aggregate/OrderMappings_GWT.res +6 -4
- package/tests/Order/Aggregate/OrderMappings_GWT.res.mjs +19 -11
- package/tests/Order/Aggregate/Order_GWT.res +29 -24
- package/tests/Order/Aggregate/Order_GWT.res.mjs +55 -44
- package/tests/Order/ReadModel/Orders_GWT.res +19 -14
- package/tests/Order/ReadModel/Orders_GWT.res.mjs +31 -20
- package/tests/Order/SideEffect/Order_EmailNotification_GWT.res +5 -2
- package/tests/Order/SideEffect/Order_EmailNotification_GWT.res.mjs +8 -6
package/src/Plugin.res.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
4
3
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
4
|
import * as Order$OrderingPlugin from "./Order/Aggregate/Order.res.mjs";
|
|
6
5
|
import * as Orders$OrderingPlugin from "./Order/ReadModel/Orders.res.mjs";
|
|
6
|
+
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
|
|
7
|
+
import * as OrderId$OrderingPlugin from "./Order/OrderId.res.mjs";
|
|
7
8
|
import * as Customer$OrderingPlugin from "./Customer/Aggregate/Customer.res.mjs";
|
|
8
9
|
import * as Customers$OrderingPlugin from "./Customer/ReadModel/Customers.res.mjs";
|
|
10
|
+
import * as CustomerId$OrderingPlugin from "./Customer/CustomerId.res.mjs";
|
|
9
11
|
import * as CatalogProduct$OrderingPlugin from "./CatalogProduct/Aggregate/CatalogProduct.res.mjs";
|
|
10
12
|
import * as LifecycleModel$OrderingPlugin from "./LifecycleModel.res.mjs";
|
|
11
13
|
import * as Order_Behavior$OrderingPlugin from "./Order/Aggregate/Order_Behavior.res.mjs";
|
|
@@ -25,7 +27,7 @@ import * as AvailableProducts_Projections$OrderingPlugin from "./CatalogProduct/
|
|
|
25
27
|
|
|
26
28
|
function Make(Platform) {
|
|
27
29
|
let CatalogProductAggregate = Platform.Aggregate.Make({
|
|
28
|
-
Id:
|
|
30
|
+
Id: ProductId$CatalogSpec,
|
|
29
31
|
name: CatalogProduct$OrderingPlugin.name,
|
|
30
32
|
eventSchema: CatalogProduct$OrderingPlugin.eventSchema,
|
|
31
33
|
errorSchema: CatalogProduct$OrderingPlugin.errorSchema,
|
|
@@ -42,11 +44,11 @@ function Make(Platform) {
|
|
|
42
44
|
moduleUrl: CatalogProduct_Behavior$OrderingPlugin.moduleUrl
|
|
43
45
|
})(NoEventMappings$ReventlessInfra.Make({
|
|
44
46
|
name: CatalogProduct$OrderingPlugin.name,
|
|
45
|
-
Id:
|
|
47
|
+
Id: ProductId$CatalogSpec,
|
|
46
48
|
commandSchema: CatalogProduct$OrderingPlugin.commandSchema
|
|
47
49
|
}));
|
|
48
50
|
let CustomerAggregate = Platform.Aggregate.Make({
|
|
49
|
-
Id:
|
|
51
|
+
Id: CustomerId$OrderingPlugin,
|
|
50
52
|
name: Customer$OrderingPlugin.name,
|
|
51
53
|
eventSchema: Customer$OrderingPlugin.eventSchema,
|
|
52
54
|
errorSchema: Customer$OrderingPlugin.errorSchema,
|
|
@@ -63,11 +65,11 @@ function Make(Platform) {
|
|
|
63
65
|
moduleUrl: Customer_Behavior$OrderingPlugin.moduleUrl
|
|
64
66
|
})(NoEventMappings$ReventlessInfra.Make({
|
|
65
67
|
name: Customer$OrderingPlugin.name,
|
|
66
|
-
Id:
|
|
68
|
+
Id: CustomerId$OrderingPlugin,
|
|
67
69
|
commandSchema: Customer$OrderingPlugin.commandSchema
|
|
68
70
|
}));
|
|
69
71
|
let OrderAggregate = Platform.Aggregate.Make({
|
|
70
|
-
Id:
|
|
72
|
+
Id: OrderId$OrderingPlugin,
|
|
71
73
|
name: Order$OrderingPlugin.name,
|
|
72
74
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
73
75
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -88,7 +90,7 @@ function Make(Platform) {
|
|
|
88
90
|
counter: undefined
|
|
89
91
|
});
|
|
90
92
|
let AvailableProductsReadModel = Platform.ReadModel.Make({
|
|
91
|
-
Id:
|
|
93
|
+
Id: ProductId$CatalogSpec,
|
|
92
94
|
name: AvailableProducts$OrderingPlugin.name,
|
|
93
95
|
moduleUrl: AvailableProducts$OrderingPlugin.moduleUrl,
|
|
94
96
|
stateSchema: AvailableProducts$OrderingPlugin.stateSchema,
|
|
@@ -101,7 +103,7 @@ function Make(Platform) {
|
|
|
101
103
|
mappings: AvailableProducts_Projections$OrderingPlugin.mappings
|
|
102
104
|
});
|
|
103
105
|
let CustomersReadModel = Platform.ReadModel.Make({
|
|
104
|
-
Id:
|
|
106
|
+
Id: CustomerId$OrderingPlugin,
|
|
105
107
|
name: Customers$OrderingPlugin.name,
|
|
106
108
|
moduleUrl: Customers$OrderingPlugin.moduleUrl,
|
|
107
109
|
stateSchema: Customers$OrderingPlugin.stateSchema,
|
|
@@ -114,7 +116,7 @@ function Make(Platform) {
|
|
|
114
116
|
mappings: Customers_Projections$OrderingPlugin.mappings
|
|
115
117
|
});
|
|
116
118
|
let OrdersReadModel = Platform.ReadModel.Make({
|
|
117
|
-
Id:
|
|
119
|
+
Id: OrderId$OrderingPlugin,
|
|
118
120
|
name: Orders$OrderingPlugin.name,
|
|
119
121
|
moduleUrl: Orders$OrderingPlugin.moduleUrl,
|
|
120
122
|
stateSchema: Orders$OrderingPlugin.stateSchema,
|
|
@@ -140,7 +142,7 @@ function Make(Platform) {
|
|
|
140
142
|
directiveSchema: Orders_ExtensionPoint$OrderingSpec.directiveSchema
|
|
141
143
|
},
|
|
142
144
|
Delegate: {
|
|
143
|
-
Id:
|
|
145
|
+
Id: OrderId$OrderingPlugin,
|
|
144
146
|
name: Order$OrderingPlugin.name,
|
|
145
147
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
146
148
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -165,7 +167,7 @@ function Make(Platform) {
|
|
|
165
167
|
directiveSchema: Products_ExtensionPoint$CatalogSpec.directiveSchema
|
|
166
168
|
},
|
|
167
169
|
Delegate: {
|
|
168
|
-
Id:
|
|
170
|
+
Id: ProductId$CatalogSpec,
|
|
169
171
|
name: CatalogProduct$OrderingPlugin.name,
|
|
170
172
|
eventSchema: CatalogProduct$OrderingPlugin.eventSchema,
|
|
171
173
|
errorSchema: CatalogProduct$OrderingPlugin.errorSchema,
|
|
@@ -199,7 +201,7 @@ function Make(Platform) {
|
|
|
199
201
|
directiveSchema: Orders_ExtensionPoint$OrderingSpec.directiveSchema
|
|
200
202
|
},
|
|
201
203
|
Delegate: {
|
|
202
|
-
Id:
|
|
204
|
+
Id: OrderId$OrderingPlugin,
|
|
203
205
|
name: Order$OrderingPlugin.name,
|
|
204
206
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
205
207
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -267,4 +269,4 @@ function Make(Platform) {
|
|
|
267
269
|
export {
|
|
268
270
|
Make,
|
|
269
271
|
}
|
|
270
|
-
/*
|
|
272
|
+
/* Order-OrderingPlugin Not a pure module */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as OrderId$OrderingPlugin from "../Order/OrderId.res.mjs";
|
|
4
4
|
import * as Order_EmailNotification$OrderingPlugin from "../Order/SideEffect/Order_EmailNotification.res.mjs";
|
|
5
5
|
|
|
6
6
|
function setup(_queryEngine, _queryBucketName, _opts) {
|
|
@@ -8,7 +8,7 @@ function setup(_queryEngine, _queryBucketName, _opts) {
|
|
|
8
8
|
sideEffects: [{
|
|
9
9
|
Source: {
|
|
10
10
|
name: Order_EmailNotification$OrderingPlugin.Source.name,
|
|
11
|
-
Id:
|
|
11
|
+
Id: OrderId$OrderingPlugin,
|
|
12
12
|
eventSchema: Order_EmailNotification$OrderingPlugin.Source.eventSchema
|
|
13
13
|
},
|
|
14
14
|
moduleUrl: Order_EmailNotification$OrderingPlugin.moduleUrl,
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
setup,
|
|
27
27
|
moduleUrl,
|
|
28
28
|
}
|
|
29
|
-
/*
|
|
29
|
+
/* OrderId-OrderingPlugin Not a pure module */
|
|
@@ -6,16 +6,18 @@
|
|
|
6
6
|
// it surfaces the extension point's events and the delegate's commands.
|
|
7
7
|
open Mapping
|
|
8
8
|
|
|
9
|
+
let p1 = CatalogSpec.ProductId.make("p1")
|
|
10
|
+
|
|
9
11
|
describe("Products Extension delegate", () => {
|
|
10
12
|
test("ProductBecameAvailable issues Sync", () =>
|
|
11
13
|
whenIncomingEvent(
|
|
12
|
-
ExtensionPoint.ProductBecameAvailable({productId:
|
|
14
|
+
ExtensionPoint.ProductBecameAvailable({productId: p1, name: "Book", price: 9.99}),
|
|
13
15
|
)->thenPublishesAggregateCommand("p1", Delegate.Sync({name: "Book", price: 9.99}))
|
|
14
16
|
)
|
|
15
17
|
|
|
16
18
|
test("ProductPriceChanged issues UpdatePrice", () =>
|
|
17
19
|
whenIncomingEvent(
|
|
18
|
-
ExtensionPoint.ProductPriceChanged({productId:
|
|
20
|
+
ExtensionPoint.ProductPriceChanged({productId: p1, price: 7.5}),
|
|
19
21
|
)->thenPublishesAggregateCommand("p1", Delegate.UpdatePrice({price: 7.5}))
|
|
20
22
|
)
|
|
21
23
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
|
|
4
4
|
import * as Delegate_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Delegate_GWT.res.mjs";
|
|
5
5
|
import * as CatalogProduct$OrderingPlugin from "../../src/CatalogProduct/Aggregate/CatalogProduct.res.mjs";
|
|
6
6
|
import * as Products_Extension$OrderingPlugin from "../../src/Extension/Products_Extension.res.mjs";
|
|
@@ -15,7 +15,7 @@ let include = Delegate_GWT$ReventlessGwt.FromExtension({
|
|
|
15
15
|
directiveSchema: Products_ExtensionPoint$CatalogSpec.directiveSchema
|
|
16
16
|
},
|
|
17
17
|
Delegate: {
|
|
18
|
-
Id:
|
|
18
|
+
Id: ProductId$CatalogSpec,
|
|
19
19
|
name: CatalogProduct$OrderingPlugin.name,
|
|
20
20
|
eventSchema: CatalogProduct$OrderingPlugin.eventSchema,
|
|
21
21
|
errorSchema: CatalogProduct$OrderingPlugin.errorSchema,
|
|
@@ -41,10 +41,12 @@ let whenIncomingEvent = include.whenIncomingEvent;
|
|
|
41
41
|
|
|
42
42
|
let thenPublishesAggregateCommand = include.thenPublishesAggregateCommand;
|
|
43
43
|
|
|
44
|
+
let p1 = ProductId$CatalogSpec.make("p1");
|
|
45
|
+
|
|
44
46
|
describe("Products Extension delegate", () => {
|
|
45
47
|
test("ProductBecameAvailable issues Sync", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
|
|
46
48
|
TAG: "ProductBecameAvailable",
|
|
47
|
-
productId:
|
|
49
|
+
productId: p1,
|
|
48
50
|
name: "Book",
|
|
49
51
|
price: 9.99
|
|
50
52
|
}), "p1", {
|
|
@@ -54,7 +56,7 @@ describe("Products Extension delegate", () => {
|
|
|
54
56
|
}));
|
|
55
57
|
test("ProductPriceChanged issues UpdatePrice", undefined, () => thenPublishesAggregateCommand(whenIncomingEvent({
|
|
56
58
|
TAG: "ProductPriceChanged",
|
|
57
|
-
productId:
|
|
59
|
+
productId: p1,
|
|
58
60
|
price: 7.5
|
|
59
61
|
}), "p1", {
|
|
60
62
|
TAG: "UpdatePrice",
|
|
@@ -106,5 +108,6 @@ export {
|
|
|
106
108
|
thenHandlesDirective,
|
|
107
109
|
thenHandlesDirectives,
|
|
108
110
|
thenHandlesNoDirective,
|
|
111
|
+
p1,
|
|
109
112
|
}
|
|
110
113
|
/* include Not a pure module */
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
// into one public per-product event each (one-to-many fan-out).
|
|
3
3
|
@@reventless.gwt
|
|
4
4
|
|
|
5
|
+
let c1 = CustomerId.make("c1")
|
|
6
|
+
let p1 = CatalogSpec.ProductId.make("p1")
|
|
7
|
+
let p2 = CatalogSpec.ProductId.make("p2")
|
|
8
|
+
|
|
5
9
|
describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
|
|
6
10
|
test("Placed fans out to one ItemOrdered per product", () =>
|
|
7
11
|
whenDelegateEvent(
|
|
8
|
-
Delegate.Placed({customerId:
|
|
12
|
+
Delegate.Placed({customerId: c1, productIds: [p1, p2]}),
|
|
9
13
|
)->thenPublishesEvents([
|
|
10
14
|
("p1", ExtensionPoint.ItemOrdered({productId: "p1", orderId: "gwt-id", customerId: "c1"})),
|
|
11
15
|
("p2", ExtensionPoint.ItemOrdered({productId: "p2", orderId: "gwt-id", customerId: "c1"})),
|
|
@@ -13,7 +17,7 @@ describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
|
|
|
13
17
|
)
|
|
14
18
|
|
|
15
19
|
test("Cancelled fans out to one ItemOrderCancelled per product", () =>
|
|
16
|
-
whenDelegateEvent(Delegate.Cancelled({productIds: [
|
|
20
|
+
whenDelegateEvent(Delegate.Cancelled({productIds: [p1, p2]}))->thenPublishesEvents([
|
|
17
21
|
("p1", ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "gwt-id"})),
|
|
18
22
|
("p2", ExtensionPoint.ItemOrderCancelled({productId: "p2", orderId: "gwt-id"})),
|
|
19
23
|
])
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
4
3
|
import * as Order$OrderingPlugin from "../../src/Order/Aggregate/Order.res.mjs";
|
|
4
|
+
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
|
|
5
|
+
import * as OrderId$OrderingPlugin from "../../src/Order/OrderId.res.mjs";
|
|
6
|
+
import * as CustomerId$OrderingPlugin from "../../src/Customer/CustomerId.res.mjs";
|
|
5
7
|
import * as Delegate_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Delegate_GWT.res.mjs";
|
|
6
8
|
import * as Orders_ExtensionPoint$OrderingSpec from "@reventlessdev/online-shop-aggregates-ordering-spec/src/Orders_ExtensionPoint.res.mjs";
|
|
7
9
|
import * as Orders_ExtensionPointMapping$OrderingPlugin from "../../src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs";
|
|
@@ -15,7 +17,7 @@ let include = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
|
|
|
15
17
|
directiveSchema: Orders_ExtensionPoint$OrderingSpec.directiveSchema
|
|
16
18
|
},
|
|
17
19
|
Delegate: {
|
|
18
|
-
Id:
|
|
20
|
+
Id: OrderId$OrderingPlugin,
|
|
19
21
|
name: Order$OrderingPlugin.name,
|
|
20
22
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
21
23
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -42,13 +44,19 @@ let whenDelegateEvent = include.whenDelegateEvent;
|
|
|
42
44
|
|
|
43
45
|
let thenPublishesEvents = include.thenPublishesEvents;
|
|
44
46
|
|
|
47
|
+
let c1 = CustomerId$OrderingPlugin.make("c1");
|
|
48
|
+
|
|
49
|
+
let p1 = ProductId$CatalogSpec.make("p1");
|
|
50
|
+
|
|
51
|
+
let p2 = ProductId$CatalogSpec.make("p2");
|
|
52
|
+
|
|
45
53
|
describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
|
|
46
54
|
test("Placed fans out to one ItemOrdered per product", undefined, () => thenPublishesEvents(whenDelegateEvent({
|
|
47
55
|
TAG: "Placed",
|
|
48
|
-
customerId:
|
|
56
|
+
customerId: c1,
|
|
49
57
|
productIds: [
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
p1,
|
|
59
|
+
p2
|
|
52
60
|
]
|
|
53
61
|
}), [
|
|
54
62
|
[
|
|
@@ -73,8 +81,8 @@ describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
|
|
|
73
81
|
test("Cancelled fans out to one ItemOrderCancelled per product", undefined, () => thenPublishesEvents(whenDelegateEvent({
|
|
74
82
|
TAG: "Cancelled",
|
|
75
83
|
productIds: [
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
p1,
|
|
85
|
+
p2
|
|
78
86
|
]
|
|
79
87
|
}), [
|
|
80
88
|
[
|
|
@@ -143,5 +151,8 @@ export {
|
|
|
143
151
|
thenHandlesDirective,
|
|
144
152
|
thenHandlesDirectives,
|
|
145
153
|
thenHandlesNoDirective,
|
|
154
|
+
c1,
|
|
155
|
+
p1,
|
|
156
|
+
p2,
|
|
146
157
|
}
|
|
147
158
|
/* include Not a pure module */
|
|
@@ -17,13 +17,15 @@ module AutoShipGwtMapping = {
|
|
|
17
17
|
|
|
18
18
|
include ReventlessGwt.Mapping_GWT.Make(AutoShipGwtMapping)
|
|
19
19
|
|
|
20
|
-
let
|
|
20
|
+
let cust1 = CustomerId.make("cust-1")
|
|
21
|
+
let prod1 = CatalogSpec.ProductId.make("prod-1")
|
|
22
|
+
let placedEvent = Order.Placed({customerId: cust1, productIds: [prod1]})
|
|
21
23
|
|
|
22
24
|
describe("Order auto-ship mapping (Placed → Ship)", () => {
|
|
23
25
|
test("Place → AutoShipMapping issues Ship → target emits Shipped", () =>
|
|
24
26
|
givenSourceEvents([])
|
|
25
27
|
->andTargetEvents([("order-1", [placedEvent])])
|
|
26
|
-
->whenSourceCmd("order-1", Place({customerId:
|
|
28
|
+
->whenSourceCmd("order-1", Place({customerId: cust1, productIds: [prod1]}))
|
|
27
29
|
->thenTargetEvent("order-1", Order.Shipped)
|
|
28
30
|
)
|
|
29
31
|
|
|
@@ -42,8 +44,8 @@ describe("Order auto-ship mapping (Placed → Ship)", () => {
|
|
|
42
44
|
)
|
|
43
45
|
|
|
44
46
|
test("Refund command does not fire the mapping (only Placed events do)", () =>
|
|
45
|
-
givenSourceEvents([placedEvent, Order.Cancelled({productIds: [
|
|
46
|
-
->andTargetEvents([("order-1", [placedEvent, Order.Cancelled({productIds: [
|
|
47
|
+
givenSourceEvents([placedEvent, Order.Cancelled({productIds: [prod1]})])
|
|
48
|
+
->andTargetEvents([("order-1", [placedEvent, Order.Cancelled({productIds: [prod1]})])])
|
|
47
49
|
->whenSourceCmd("order-1", Refund({reason: "customer-changed-mind"}))
|
|
48
50
|
->thenNoTargetEvent
|
|
49
51
|
)
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
4
3
|
import * as Order$OrderingPlugin from "../../../src/Order/Aggregate/Order.res.mjs";
|
|
4
|
+
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
|
|
5
|
+
import * as OrderId$OrderingPlugin from "../../../src/Order/OrderId.res.mjs";
|
|
6
|
+
import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
|
|
5
7
|
import * as Mapping_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Mapping_GWT.res.mjs";
|
|
6
8
|
import * as Order_Behavior$OrderingPlugin from "../../../src/Order/Aggregate/Order_Behavior.res.mjs";
|
|
7
9
|
import * as Order_Mappings$OrderingPlugin from "../../../src/Order/Aggregate/Order_Mappings.res.mjs";
|
|
8
10
|
|
|
9
11
|
let OrderSource = Mapping_GWT$ReventlessGwt.FromBehavior({
|
|
10
|
-
Id:
|
|
12
|
+
Id: OrderId$OrderingPlugin,
|
|
11
13
|
name: Order$OrderingPlugin.name,
|
|
12
14
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
13
15
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -18,7 +20,7 @@ let OrderSource = Mapping_GWT$ReventlessGwt.FromBehavior({
|
|
|
18
20
|
traits: Order$OrderingPlugin.traits
|
|
19
21
|
})({
|
|
20
22
|
Spec: {
|
|
21
|
-
Id:
|
|
23
|
+
Id: OrderId$OrderingPlugin,
|
|
22
24
|
name: Order$OrderingPlugin.name,
|
|
23
25
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
24
26
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -36,7 +38,7 @@ let OrderSource = Mapping_GWT$ReventlessGwt.FromBehavior({
|
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
let OrderTarget = Mapping_GWT$ReventlessGwt.FromBehavior({
|
|
39
|
-
Id:
|
|
41
|
+
Id: OrderId$OrderingPlugin,
|
|
40
42
|
name: Order$OrderingPlugin.name,
|
|
41
43
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
42
44
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -47,7 +49,7 @@ let OrderTarget = Mapping_GWT$ReventlessGwt.FromBehavior({
|
|
|
47
49
|
traits: Order$OrderingPlugin.traits
|
|
48
50
|
})({
|
|
49
51
|
Spec: {
|
|
50
|
-
Id:
|
|
52
|
+
Id: OrderId$OrderingPlugin,
|
|
51
53
|
name: Order$OrderingPlugin.name,
|
|
52
54
|
eventSchema: Order$OrderingPlugin.eventSchema,
|
|
53
55
|
errorSchema: Order$OrderingPlugin.errorSchema,
|
|
@@ -92,11 +94,15 @@ let thenTargetEvent = include.thenTargetEvent;
|
|
|
92
94
|
|
|
93
95
|
let thenNoTargetEvent = include.thenNoTargetEvent;
|
|
94
96
|
|
|
95
|
-
let
|
|
97
|
+
let cust1 = CustomerId$OrderingPlugin.make("cust-1");
|
|
98
|
+
|
|
99
|
+
let prod1 = ProductId$CatalogSpec.make("prod-1");
|
|
100
|
+
|
|
101
|
+
let placedEvent_1 = [prod1];
|
|
96
102
|
|
|
97
103
|
let placedEvent = {
|
|
98
104
|
TAG: "Placed",
|
|
99
|
-
customerId:
|
|
105
|
+
customerId: cust1,
|
|
100
106
|
productIds: placedEvent_1
|
|
101
107
|
};
|
|
102
108
|
|
|
@@ -106,8 +112,8 @@ describe("Order auto-ship mapping (Placed → Ship)", () => {
|
|
|
106
112
|
[placedEvent]
|
|
107
113
|
]]), "order-1", {
|
|
108
114
|
TAG: "Place",
|
|
109
|
-
customerId:
|
|
110
|
-
productIds: [
|
|
115
|
+
customerId: cust1,
|
|
116
|
+
productIds: [prod1]
|
|
111
117
|
}), "order-1", "Shipped"));
|
|
112
118
|
test("Ship command does not fire the mapping (only Placed events do)", undefined, () => thenNoTargetEvent(whenSourceCmd(andTargetEvents(givenSourceEvents([placedEvent]), [[
|
|
113
119
|
"order-1",
|
|
@@ -121,7 +127,7 @@ describe("Order auto-ship mapping (Placed → Ship)", () => {
|
|
|
121
127
|
placedEvent,
|
|
122
128
|
{
|
|
123
129
|
TAG: "Cancelled",
|
|
124
|
-
productIds: [
|
|
130
|
+
productIds: [prod1]
|
|
125
131
|
}
|
|
126
132
|
]), [[
|
|
127
133
|
"order-1",
|
|
@@ -129,7 +135,7 @@ describe("Order auto-ship mapping (Placed → Ship)", () => {
|
|
|
129
135
|
placedEvent,
|
|
130
136
|
{
|
|
131
137
|
TAG: "Cancelled",
|
|
132
|
-
productIds: [
|
|
138
|
+
productIds: [prod1]
|
|
133
139
|
}
|
|
134
140
|
]
|
|
135
141
|
]]), "order-1", {
|
|
@@ -167,6 +173,8 @@ export {
|
|
|
167
173
|
thenSourceError,
|
|
168
174
|
thenTargetError,
|
|
169
175
|
thenTargetEventsWithError,
|
|
176
|
+
cust1,
|
|
177
|
+
prod1,
|
|
170
178
|
placedEvent,
|
|
171
179
|
}
|
|
172
180
|
/* OrderSource Not a pure module */
|
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
+
// Ids are typed; the literals are made once, here.
|
|
4
|
+
let cust1 = CustomerId.make("cust-1")
|
|
5
|
+
let prod1 = CatalogSpec.ProductId.make("prod-1")
|
|
6
|
+
let prod2 = CatalogSpec.ProductId.make("prod-2")
|
|
7
|
+
|
|
3
8
|
describe("Order Behavior", () => {
|
|
4
9
|
test("Place on new aggregate produces Placed", () =>
|
|
5
10
|
givenEvents([])
|
|
6
|
-
->whenCmd(Place({customerId:
|
|
7
|
-
->thenEvent(Placed({customerId:
|
|
11
|
+
->whenCmd(Place({customerId: cust1, productIds: [prod1, prod2]}))
|
|
12
|
+
->thenEvent(Placed({customerId: cust1, productIds: [prod1, prod2]}))
|
|
8
13
|
)
|
|
9
14
|
|
|
10
15
|
test("Place on existing order returns OrderAlreadyPlaced", () =>
|
|
11
|
-
givenEvents([Placed({customerId:
|
|
12
|
-
->whenCmd(Place({customerId:
|
|
16
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
|
|
17
|
+
->whenCmd(Place({customerId: cust1, productIds: [prod1]}))
|
|
13
18
|
->thenError(OrderAlreadyPlaced)
|
|
14
19
|
)
|
|
15
20
|
|
|
16
21
|
test("Place on shipped order returns OrderAlreadyShipped", () =>
|
|
17
|
-
givenEvents([Placed({customerId:
|
|
18
|
-
->whenCmd(Place({customerId:
|
|
22
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
|
|
23
|
+
->whenCmd(Place({customerId: cust1, productIds: [prod1]}))
|
|
19
24
|
->thenError(OrderAlreadyShipped)
|
|
20
25
|
)
|
|
21
26
|
|
|
22
27
|
test("Place on cancelled order returns OrderAlreadyCancelled", () =>
|
|
23
28
|
givenEvents([
|
|
24
|
-
Placed({customerId:
|
|
25
|
-
Cancelled({productIds: [
|
|
29
|
+
Placed({customerId: cust1, productIds: [prod1]}),
|
|
30
|
+
Cancelled({productIds: [prod1]}),
|
|
26
31
|
])
|
|
27
|
-
->whenCmd(Place({customerId:
|
|
32
|
+
->whenCmd(Place({customerId: cust1, productIds: [prod1]}))
|
|
28
33
|
->thenError(OrderAlreadyCancelled)
|
|
29
34
|
)
|
|
30
35
|
|
|
@@ -35,21 +40,21 @@ describe("Order Behavior", () => {
|
|
|
35
40
|
)
|
|
36
41
|
|
|
37
42
|
test("Ship on placed order produces Shipped", () =>
|
|
38
|
-
givenEvents([Placed({customerId:
|
|
43
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
|
|
39
44
|
->whenCmd(Ship)
|
|
40
45
|
->thenEvent(Shipped)
|
|
41
46
|
)
|
|
42
47
|
|
|
43
48
|
test("Ship on shipped order produces no events (idempotent)", () =>
|
|
44
|
-
givenEvents([Placed({customerId:
|
|
49
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
|
|
45
50
|
->whenCmd(Ship)
|
|
46
51
|
->thenNoEvent
|
|
47
52
|
)
|
|
48
53
|
|
|
49
54
|
test("Ship on cancelled order returns OrderAlreadyCancelled", () =>
|
|
50
55
|
givenEvents([
|
|
51
|
-
Placed({customerId:
|
|
52
|
-
Cancelled({productIds: [
|
|
56
|
+
Placed({customerId: cust1, productIds: [prod1]}),
|
|
57
|
+
Cancelled({productIds: [prod1]}),
|
|
53
58
|
])
|
|
54
59
|
->whenCmd(Ship)
|
|
55
60
|
->thenError(OrderAlreadyCancelled)
|
|
@@ -62,21 +67,21 @@ describe("Order Behavior", () => {
|
|
|
62
67
|
)
|
|
63
68
|
|
|
64
69
|
test("Cancel on placed order produces Cancelled", () =>
|
|
65
|
-
givenEvents([Placed({customerId:
|
|
70
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
|
|
66
71
|
->whenCmd(Cancel)
|
|
67
|
-
->thenEvent(Cancelled({productIds: [
|
|
72
|
+
->thenEvent(Cancelled({productIds: [prod1]}))
|
|
68
73
|
)
|
|
69
74
|
|
|
70
75
|
test("Cancel on shipped order returns OrderAlreadyShipped", () =>
|
|
71
|
-
givenEvents([Placed({customerId:
|
|
76
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
|
|
72
77
|
->whenCmd(Cancel)
|
|
73
78
|
->thenError(OrderAlreadyShipped)
|
|
74
79
|
)
|
|
75
80
|
|
|
76
81
|
test("Cancel on cancelled order produces no events (idempotent)", () =>
|
|
77
82
|
givenEvents([
|
|
78
|
-
Placed({customerId:
|
|
79
|
-
Cancelled({productIds: [
|
|
83
|
+
Placed({customerId: cust1, productIds: [prod1]}),
|
|
84
|
+
Cancelled({productIds: [prod1]}),
|
|
80
85
|
])
|
|
81
86
|
->whenCmd(Cancel)
|
|
82
87
|
->thenNoEvent
|
|
@@ -89,21 +94,21 @@ describe("Order Behavior", () => {
|
|
|
89
94
|
)
|
|
90
95
|
|
|
91
96
|
test("Refund on placed order returns OrderNotCancelled", () =>
|
|
92
|
-
givenEvents([Placed({customerId:
|
|
97
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]})])
|
|
93
98
|
->whenCmd(Refund({reason: "customer-changed-mind"}))
|
|
94
99
|
->thenError(OrderNotCancelled)
|
|
95
100
|
)
|
|
96
101
|
|
|
97
102
|
test("Refund on shipped order returns OrderNotCancelled", () =>
|
|
98
|
-
givenEvents([Placed({customerId:
|
|
103
|
+
givenEvents([Placed({customerId: cust1, productIds: [prod1]}), Shipped])
|
|
99
104
|
->whenCmd(Refund({reason: "delivered-damaged"}))
|
|
100
105
|
->thenError(OrderNotCancelled)
|
|
101
106
|
)
|
|
102
107
|
|
|
103
108
|
test("Refund on cancelled order produces Refunded", () =>
|
|
104
109
|
givenEvents([
|
|
105
|
-
Placed({customerId:
|
|
106
|
-
Cancelled({productIds: [
|
|
110
|
+
Placed({customerId: cust1, productIds: [prod1]}),
|
|
111
|
+
Cancelled({productIds: [prod1]}),
|
|
107
112
|
])
|
|
108
113
|
->whenCmd(Refund({reason: "customer-changed-mind"}))
|
|
109
114
|
->thenEvent(Refunded({reason: "customer-changed-mind"}))
|
|
@@ -111,8 +116,8 @@ describe("Order Behavior", () => {
|
|
|
111
116
|
|
|
112
117
|
test("Refund on already-refunded order produces no events (idempotent)", () =>
|
|
113
118
|
givenEvents([
|
|
114
|
-
Placed({customerId:
|
|
115
|
-
Cancelled({productIds: [
|
|
119
|
+
Placed({customerId: cust1, productIds: [prod1]}),
|
|
120
|
+
Cancelled({productIds: [prod1]}),
|
|
116
121
|
Refunded({reason: "customer-changed-mind"}),
|
|
117
122
|
])
|
|
118
123
|
->whenCmd(Refund({reason: "customer-changed-mind"}))
|