@reventlessdev/online-shop-aggregates-ordering 3.0.0-alpha.245 → 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 +7 -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
|
@@ -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"}))
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
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 CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
|
|
4
6
|
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
5
7
|
import * as Order_Behavior$OrderingPlugin from "../../../src/Order/Aggregate/Order_Behavior.res.mjs";
|
|
6
8
|
|
|
@@ -37,109 +39,115 @@ let thenNoEvent = include.thenNoEvent;
|
|
|
37
39
|
|
|
38
40
|
let thenError = include.thenError;
|
|
39
41
|
|
|
42
|
+
let cust1 = CustomerId$OrderingPlugin.make("cust-1");
|
|
43
|
+
|
|
44
|
+
let prod1 = ProductId$CatalogSpec.make("prod-1");
|
|
45
|
+
|
|
46
|
+
let prod2 = ProductId$CatalogSpec.make("prod-2");
|
|
47
|
+
|
|
40
48
|
describe("Order Behavior", () => {
|
|
41
49
|
test("Place on new aggregate produces Placed", () => thenEvent(whenCmd(givenEvents([]), {
|
|
42
50
|
TAG: "Place",
|
|
43
|
-
customerId:
|
|
51
|
+
customerId: cust1,
|
|
44
52
|
productIds: [
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
prod1,
|
|
54
|
+
prod2
|
|
47
55
|
]
|
|
48
56
|
}), {
|
|
49
57
|
TAG: "Placed",
|
|
50
|
-
customerId:
|
|
58
|
+
customerId: cust1,
|
|
51
59
|
productIds: [
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
prod1,
|
|
61
|
+
prod2
|
|
54
62
|
]
|
|
55
63
|
}));
|
|
56
64
|
test("Place on existing order returns OrderAlreadyPlaced", () => thenError(whenCmd(givenEvents([{
|
|
57
65
|
TAG: "Placed",
|
|
58
|
-
customerId:
|
|
59
|
-
productIds: [
|
|
66
|
+
customerId: cust1,
|
|
67
|
+
productIds: [prod1]
|
|
60
68
|
}]), {
|
|
61
69
|
TAG: "Place",
|
|
62
|
-
customerId:
|
|
63
|
-
productIds: [
|
|
70
|
+
customerId: cust1,
|
|
71
|
+
productIds: [prod1]
|
|
64
72
|
}), "OrderAlreadyPlaced"));
|
|
65
73
|
test("Place on shipped order returns OrderAlreadyShipped", () => thenError(whenCmd(givenEvents([
|
|
66
74
|
{
|
|
67
75
|
TAG: "Placed",
|
|
68
|
-
customerId:
|
|
69
|
-
productIds: [
|
|
76
|
+
customerId: cust1,
|
|
77
|
+
productIds: [prod1]
|
|
70
78
|
},
|
|
71
79
|
"Shipped"
|
|
72
80
|
]), {
|
|
73
81
|
TAG: "Place",
|
|
74
|
-
customerId:
|
|
75
|
-
productIds: [
|
|
82
|
+
customerId: cust1,
|
|
83
|
+
productIds: [prod1]
|
|
76
84
|
}), "OrderAlreadyShipped"));
|
|
77
85
|
test("Place on cancelled order returns OrderAlreadyCancelled", () => thenError(whenCmd(givenEvents([
|
|
78
86
|
{
|
|
79
87
|
TAG: "Placed",
|
|
80
|
-
customerId:
|
|
81
|
-
productIds: [
|
|
88
|
+
customerId: cust1,
|
|
89
|
+
productIds: [prod1]
|
|
82
90
|
},
|
|
83
91
|
{
|
|
84
92
|
TAG: "Cancelled",
|
|
85
|
-
productIds: [
|
|
93
|
+
productIds: [prod1]
|
|
86
94
|
}
|
|
87
95
|
]), {
|
|
88
96
|
TAG: "Place",
|
|
89
|
-
customerId:
|
|
90
|
-
productIds: [
|
|
97
|
+
customerId: cust1,
|
|
98
|
+
productIds: [prod1]
|
|
91
99
|
}), "OrderAlreadyCancelled"));
|
|
92
100
|
test("Ship on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), "Ship"), "OrderNotFound"));
|
|
93
101
|
test("Ship on placed order produces Shipped", () => thenEvent(whenCmd(givenEvents([{
|
|
94
102
|
TAG: "Placed",
|
|
95
|
-
customerId:
|
|
96
|
-
productIds: [
|
|
103
|
+
customerId: cust1,
|
|
104
|
+
productIds: [prod1]
|
|
97
105
|
}]), "Ship"), "Shipped"));
|
|
98
106
|
test("Ship on shipped order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
|
|
99
107
|
{
|
|
100
108
|
TAG: "Placed",
|
|
101
|
-
customerId:
|
|
102
|
-
productIds: [
|
|
109
|
+
customerId: cust1,
|
|
110
|
+
productIds: [prod1]
|
|
103
111
|
},
|
|
104
112
|
"Shipped"
|
|
105
113
|
]), "Ship")));
|
|
106
114
|
test("Ship on cancelled order returns OrderAlreadyCancelled", () => thenError(whenCmd(givenEvents([
|
|
107
115
|
{
|
|
108
116
|
TAG: "Placed",
|
|
109
|
-
customerId:
|
|
110
|
-
productIds: [
|
|
117
|
+
customerId: cust1,
|
|
118
|
+
productIds: [prod1]
|
|
111
119
|
},
|
|
112
120
|
{
|
|
113
121
|
TAG: "Cancelled",
|
|
114
|
-
productIds: [
|
|
122
|
+
productIds: [prod1]
|
|
115
123
|
}
|
|
116
124
|
]), "Ship"), "OrderAlreadyCancelled"));
|
|
117
125
|
test("Cancel on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), "Cancel"), "OrderNotFound"));
|
|
118
126
|
test("Cancel on placed order produces Cancelled", () => thenEvent(whenCmd(givenEvents([{
|
|
119
127
|
TAG: "Placed",
|
|
120
|
-
customerId:
|
|
121
|
-
productIds: [
|
|
128
|
+
customerId: cust1,
|
|
129
|
+
productIds: [prod1]
|
|
122
130
|
}]), "Cancel"), {
|
|
123
131
|
TAG: "Cancelled",
|
|
124
|
-
productIds: [
|
|
132
|
+
productIds: [prod1]
|
|
125
133
|
}));
|
|
126
134
|
test("Cancel on shipped order returns OrderAlreadyShipped", () => thenError(whenCmd(givenEvents([
|
|
127
135
|
{
|
|
128
136
|
TAG: "Placed",
|
|
129
|
-
customerId:
|
|
130
|
-
productIds: [
|
|
137
|
+
customerId: cust1,
|
|
138
|
+
productIds: [prod1]
|
|
131
139
|
},
|
|
132
140
|
"Shipped"
|
|
133
141
|
]), "Cancel"), "OrderAlreadyShipped"));
|
|
134
142
|
test("Cancel on cancelled order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
|
|
135
143
|
{
|
|
136
144
|
TAG: "Placed",
|
|
137
|
-
customerId:
|
|
138
|
-
productIds: [
|
|
145
|
+
customerId: cust1,
|
|
146
|
+
productIds: [prod1]
|
|
139
147
|
},
|
|
140
148
|
{
|
|
141
149
|
TAG: "Cancelled",
|
|
142
|
-
productIds: [
|
|
150
|
+
productIds: [prod1]
|
|
143
151
|
}
|
|
144
152
|
]), "Cancel")));
|
|
145
153
|
test("Refund on non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
@@ -148,8 +156,8 @@ describe("Order Behavior", () => {
|
|
|
148
156
|
}), "OrderNotFound"));
|
|
149
157
|
test("Refund on placed order returns OrderNotCancelled", () => thenError(whenCmd(givenEvents([{
|
|
150
158
|
TAG: "Placed",
|
|
151
|
-
customerId:
|
|
152
|
-
productIds: [
|
|
159
|
+
customerId: cust1,
|
|
160
|
+
productIds: [prod1]
|
|
153
161
|
}]), {
|
|
154
162
|
TAG: "Refund",
|
|
155
163
|
reason: "customer-changed-mind"
|
|
@@ -157,8 +165,8 @@ describe("Order Behavior", () => {
|
|
|
157
165
|
test("Refund on shipped order returns OrderNotCancelled", () => thenError(whenCmd(givenEvents([
|
|
158
166
|
{
|
|
159
167
|
TAG: "Placed",
|
|
160
|
-
customerId:
|
|
161
|
-
productIds: [
|
|
168
|
+
customerId: cust1,
|
|
169
|
+
productIds: [prod1]
|
|
162
170
|
},
|
|
163
171
|
"Shipped"
|
|
164
172
|
]), {
|
|
@@ -168,12 +176,12 @@ describe("Order Behavior", () => {
|
|
|
168
176
|
test("Refund on cancelled order produces Refunded", () => thenEvent(whenCmd(givenEvents([
|
|
169
177
|
{
|
|
170
178
|
TAG: "Placed",
|
|
171
|
-
customerId:
|
|
172
|
-
productIds: [
|
|
179
|
+
customerId: cust1,
|
|
180
|
+
productIds: [prod1]
|
|
173
181
|
},
|
|
174
182
|
{
|
|
175
183
|
TAG: "Cancelled",
|
|
176
|
-
productIds: [
|
|
184
|
+
productIds: [prod1]
|
|
177
185
|
}
|
|
178
186
|
]), {
|
|
179
187
|
TAG: "Refund",
|
|
@@ -185,12 +193,12 @@ describe("Order Behavior", () => {
|
|
|
185
193
|
test("Refund on already-refunded order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
|
|
186
194
|
{
|
|
187
195
|
TAG: "Placed",
|
|
188
|
-
customerId:
|
|
189
|
-
productIds: [
|
|
196
|
+
customerId: cust1,
|
|
197
|
+
productIds: [prod1]
|
|
190
198
|
},
|
|
191
199
|
{
|
|
192
200
|
TAG: "Cancelled",
|
|
193
|
-
productIds: [
|
|
201
|
+
productIds: [prod1]
|
|
194
202
|
},
|
|
195
203
|
{
|
|
196
204
|
TAG: "Refunded",
|
|
@@ -228,5 +236,8 @@ export {
|
|
|
228
236
|
thenCompareEvents,
|
|
229
237
|
thenEventsWithError,
|
|
230
238
|
thenError,
|
|
239
|
+
cust1,
|
|
240
|
+
prod1,
|
|
241
|
+
prod2,
|
|
231
242
|
}
|
|
232
243
|
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,45 +1,50 @@
|
|
|
1
1
|
@@reventless.gwt(Orders_Projections.OrderMapping)
|
|
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("Orders ReadModel ← Order", () => {
|
|
4
9
|
test("Placed sets initial read model state", () =>
|
|
5
10
|
givenEvents([])
|
|
6
|
-
->whenEvent(Order.Placed({customerId:
|
|
11
|
+
->whenEvent(Order.Placed({customerId: cust1, productIds: [prod1, prod2]}))
|
|
7
12
|
->thenState({
|
|
8
|
-
Orders.customerId:
|
|
9
|
-
productIds: [
|
|
13
|
+
Orders.customerId: cust1,
|
|
14
|
+
productIds: [prod1, prod2],
|
|
10
15
|
lifecycle: Placed,
|
|
11
16
|
})
|
|
12
17
|
)
|
|
13
18
|
|
|
14
19
|
test("Shipped updates status", () =>
|
|
15
|
-
givenEvents([Order.Placed({customerId:
|
|
20
|
+
givenEvents([Order.Placed({customerId: cust1, productIds: [prod1]})])
|
|
16
21
|
->whenEvent(Order.Shipped)
|
|
17
22
|
->thenState({
|
|
18
|
-
Orders.customerId:
|
|
19
|
-
productIds: [
|
|
23
|
+
Orders.customerId: cust1,
|
|
24
|
+
productIds: [prod1],
|
|
20
25
|
lifecycle: Shipped,
|
|
21
26
|
})
|
|
22
27
|
)
|
|
23
28
|
|
|
24
29
|
test("Cancelled updates status", () =>
|
|
25
|
-
givenEvents([Order.Placed({customerId:
|
|
26
|
-
->whenEvent(Order.Cancelled({productIds: [
|
|
30
|
+
givenEvents([Order.Placed({customerId: cust1, productIds: [prod1]})])
|
|
31
|
+
->whenEvent(Order.Cancelled({productIds: [prod1]}))
|
|
27
32
|
->thenState({
|
|
28
|
-
Orders.customerId:
|
|
29
|
-
productIds: [
|
|
33
|
+
Orders.customerId: cust1,
|
|
34
|
+
productIds: [prod1],
|
|
30
35
|
lifecycle: Cancelled,
|
|
31
36
|
})
|
|
32
37
|
)
|
|
33
38
|
|
|
34
39
|
test("Refunded updates status", () =>
|
|
35
40
|
givenEvents([
|
|
36
|
-
Order.Placed({customerId:
|
|
37
|
-
Order.Cancelled({productIds: [
|
|
41
|
+
Order.Placed({customerId: cust1, productIds: [prod1]}),
|
|
42
|
+
Order.Cancelled({productIds: [prod1]}),
|
|
38
43
|
])
|
|
39
44
|
->whenEvent(Order.Refunded({reason: "customer-changed-mind"}))
|
|
40
45
|
->thenState({
|
|
41
|
-
Orders.customerId:
|
|
42
|
-
productIds: [
|
|
46
|
+
Orders.customerId: cust1,
|
|
47
|
+
productIds: [prod1],
|
|
43
48
|
lifecycle: Refunded,
|
|
44
49
|
})
|
|
45
50
|
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
+
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/ProductId.res.mjs";
|
|
4
|
+
import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
|
|
3
5
|
import * as Orders_Projections$OrderingPlugin from "../../../src/Order/ReadModel/Orders_Projections.res.mjs";
|
|
4
6
|
import * as MultiSourceProjection_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/MultiSourceProjection_GWT.res.mjs";
|
|
5
7
|
|
|
@@ -15,59 +17,65 @@ let whenEvent = include.whenEvent;
|
|
|
15
17
|
|
|
16
18
|
let thenState = include.thenState;
|
|
17
19
|
|
|
20
|
+
let cust1 = CustomerId$OrderingPlugin.make("cust-1");
|
|
21
|
+
|
|
22
|
+
let prod1 = ProductId$CatalogSpec.make("prod-1");
|
|
23
|
+
|
|
24
|
+
let prod2 = ProductId$CatalogSpec.make("prod-2");
|
|
25
|
+
|
|
18
26
|
describe("Orders ReadModel ← Order", () => {
|
|
19
27
|
test("Placed sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
|
|
20
28
|
TAG: "Placed",
|
|
21
|
-
customerId:
|
|
29
|
+
customerId: cust1,
|
|
22
30
|
productIds: [
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
prod1,
|
|
32
|
+
prod2
|
|
25
33
|
]
|
|
26
34
|
}), {
|
|
27
|
-
customerId:
|
|
35
|
+
customerId: cust1,
|
|
28
36
|
productIds: [
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
prod1,
|
|
38
|
+
prod2
|
|
31
39
|
],
|
|
32
40
|
lifecycle: "Placed"
|
|
33
41
|
}));
|
|
34
42
|
test("Shipped updates status", undefined, () => thenState(whenEvent(givenEvents([{
|
|
35
43
|
TAG: "Placed",
|
|
36
|
-
customerId:
|
|
37
|
-
productIds: [
|
|
44
|
+
customerId: cust1,
|
|
45
|
+
productIds: [prod1]
|
|
38
46
|
}]), "Shipped"), {
|
|
39
|
-
customerId:
|
|
40
|
-
productIds: [
|
|
47
|
+
customerId: cust1,
|
|
48
|
+
productIds: [prod1],
|
|
41
49
|
lifecycle: "Shipped"
|
|
42
50
|
}));
|
|
43
51
|
test("Cancelled updates status", undefined, () => thenState(whenEvent(givenEvents([{
|
|
44
52
|
TAG: "Placed",
|
|
45
|
-
customerId:
|
|
46
|
-
productIds: [
|
|
53
|
+
customerId: cust1,
|
|
54
|
+
productIds: [prod1]
|
|
47
55
|
}]), {
|
|
48
56
|
TAG: "Cancelled",
|
|
49
|
-
productIds: [
|
|
57
|
+
productIds: [prod1]
|
|
50
58
|
}), {
|
|
51
|
-
customerId:
|
|
52
|
-
productIds: [
|
|
59
|
+
customerId: cust1,
|
|
60
|
+
productIds: [prod1],
|
|
53
61
|
lifecycle: "Cancelled"
|
|
54
62
|
}));
|
|
55
63
|
test("Refunded updates status", undefined, () => thenState(whenEvent(givenEvents([
|
|
56
64
|
{
|
|
57
65
|
TAG: "Placed",
|
|
58
|
-
customerId:
|
|
59
|
-
productIds: [
|
|
66
|
+
customerId: cust1,
|
|
67
|
+
productIds: [prod1]
|
|
60
68
|
},
|
|
61
69
|
{
|
|
62
70
|
TAG: "Cancelled",
|
|
63
|
-
productIds: [
|
|
71
|
+
productIds: [prod1]
|
|
64
72
|
}
|
|
65
73
|
]), {
|
|
66
74
|
TAG: "Refunded",
|
|
67
75
|
reason: "customer-changed-mind"
|
|
68
76
|
}), {
|
|
69
|
-
customerId:
|
|
70
|
-
productIds: [
|
|
77
|
+
customerId: cust1,
|
|
78
|
+
productIds: [prod1],
|
|
71
79
|
lifecycle: "Refunded"
|
|
72
80
|
}));
|
|
73
81
|
});
|
|
@@ -114,5 +122,8 @@ export {
|
|
|
114
122
|
thenNoState,
|
|
115
123
|
thenThrow,
|
|
116
124
|
thenFail,
|
|
125
|
+
cust1,
|
|
126
|
+
prod1,
|
|
127
|
+
prod2,
|
|
117
128
|
}
|
|
118
129
|
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -16,7 +16,10 @@ describe(name ++ " SideEffect", () => {
|
|
|
16
16
|
EmailService_Mock.install()
|
|
17
17
|
givenEventForId(
|
|
18
18
|
Order.Id.makeFromString("o1"),
|
|
19
|
-
Order.Placed({
|
|
19
|
+
Order.Placed({
|
|
20
|
+
customerId: CustomerId.make("alice@example.com"),
|
|
21
|
+
productIds: [CatalogSpec.ProductId.make("p1")],
|
|
22
|
+
}),
|
|
20
23
|
)
|
|
21
24
|
->whenExecuted(EmailService_Mock.mock)
|
|
22
25
|
->thenExternalCalls([
|
|
@@ -33,7 +36,7 @@ describe(name ++ " SideEffect", () => {
|
|
|
33
36
|
|
|
34
37
|
test("Cancelled is a no-op", () => {
|
|
35
38
|
EmailService_Mock.install()
|
|
36
|
-
givenEvent(Order.Cancelled({productIds: ["p1"]}))
|
|
39
|
+
givenEvent(Order.Cancelled({productIds: [CatalogSpec.ProductId.make("p1")]}))
|
|
37
40
|
->whenExecuted(EmailService_Mock.mock)
|
|
38
41
|
->thenNoExternalCalls
|
|
39
42
|
})
|
|
@@ -1,6 +1,8 @@
|
|
|
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
|
+
import * as OrderId$OrderingPlugin from "../../../src/Order/OrderId.res.mjs";
|
|
5
|
+
import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
|
|
4
6
|
import * as SideEffect_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/SideEffect_GWT.res.mjs";
|
|
5
7
|
import * as EmailService_Mock$OrderingPlugin from "./EmailService_Mock.res.mjs";
|
|
6
8
|
import * as Order_EmailNotification$OrderingPlugin from "../../../src/Order/SideEffect/Order_EmailNotification.res.mjs";
|
|
@@ -8,7 +10,7 @@ import * as Order_EmailNotification$OrderingPlugin from "../../../src/Order/Side
|
|
|
8
10
|
let include = SideEffect_GWT$ReventlessGwt.Make({
|
|
9
11
|
Source: {
|
|
10
12
|
name: Order_EmailNotification$OrderingPlugin.Source.name,
|
|
11
|
-
Id:
|
|
13
|
+
Id: OrderId$OrderingPlugin,
|
|
12
14
|
eventSchema: Order_EmailNotification$OrderingPlugin.Source.eventSchema
|
|
13
15
|
},
|
|
14
16
|
moduleUrl: Order_EmailNotification$OrderingPlugin.moduleUrl,
|
|
@@ -32,10 +34,10 @@ let thenExternalCalls = include.thenExternalCalls;
|
|
|
32
34
|
describe(Order_EmailNotification$OrderingPlugin.name + " SideEffect", () => {
|
|
33
35
|
test("Placed triggers a confirmation email", undefined, () => {
|
|
34
36
|
EmailService_Mock$OrderingPlugin.install();
|
|
35
|
-
return thenExternalCalls(whenExecuted(givenEventForId(
|
|
37
|
+
return thenExternalCalls(whenExecuted(givenEventForId(OrderId$OrderingPlugin.makeFromString("o1"), {
|
|
36
38
|
TAG: "Placed",
|
|
37
|
-
customerId: "alice@example.com",
|
|
38
|
-
productIds: ["p1"]
|
|
39
|
+
customerId: CustomerId$OrderingPlugin.make("alice@example.com"),
|
|
40
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
39
41
|
}), EmailService_Mock$OrderingPlugin.mock, undefined), [{
|
|
40
42
|
TAG: "SendOrderConfirmation",
|
|
41
43
|
email: "alice@example.com",
|
|
@@ -50,7 +52,7 @@ describe(Order_EmailNotification$OrderingPlugin.name + " SideEffect", () => {
|
|
|
50
52
|
EmailService_Mock$OrderingPlugin.install();
|
|
51
53
|
return thenNoExternalCalls(whenExecuted(givenEvent({
|
|
52
54
|
TAG: "Cancelled",
|
|
53
|
-
productIds: ["p1"]
|
|
55
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
54
56
|
}), EmailService_Mock$OrderingPlugin.mock, undefined));
|
|
55
57
|
});
|
|
56
58
|
});
|
package/lib/ocaml/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1789994023811)
|
|
2
|
+
#Done(1789994029825)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|