@reventlessdev/online-shop-dcb-ordering 1.0.0-alpha.250 → 1.0.0-alpha.252
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 +16 -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 +1 -0
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts_Projection-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts_Projection-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/RegisterCustomer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/RegisterCustomer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateView/Customers_Projection-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateView/Customers_Projection-OrderingPlugin.cmt +0 -0
- 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/Order/Automation/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateView/Orders_Projection-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateView/Orders_Projection-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.ast +0 -0
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res +14 -10
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +13 -16
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.ast +0 -0
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.res +8 -6
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.res.mjs +10 -12
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.res +13 -9
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.res.mjs +14 -17
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.res +13 -9
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.res.mjs +14 -17
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.res +8 -5
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.res.mjs +5 -8
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.res +6 -6
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.res.mjs +8 -11
- package/lib/bs/tests/Customer/StateView/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateView/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateView/Customers_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateView/Customers_GWT.res +16 -20
- package/lib/bs/tests/Customer/StateView/Customers_GWT.res.mjs +30 -32
- 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 +7 -7
- package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +5 -8
- 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 +7 -7
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +8 -19
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.res +13 -8
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.res.mjs +8 -11
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.ast +0 -0
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res +7 -6
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res.mjs +9 -16
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.res +13 -10
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.res.mjs +12 -19
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.res +19 -18
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +31 -42
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.res +10 -6
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.res.mjs +6 -9
- package/lib/bs/tests/Order/StateView/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateView/Orders_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateView/Orders_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateView/Orders_GWT.res +14 -21
- package/lib/bs/tests/Order/StateView/Orders_GWT.res.mjs +23 -33
- package/lib/bs/tests/Ordering_Examples-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Ordering_Examples-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Ordering_Examples-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Ordering_Examples.ast +0 -0
- package/lib/bs/tests/Ordering_Examples.res +15 -0
- package/lib/bs/tests/Ordering_Examples.res.mjs +39 -0
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AutoShipOrder_GWT.ast +0 -0
- package/lib/ocaml/AutoShipOrder_GWT.res +13 -8
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +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 +8 -6
- package/lib/ocaml/AvailableProducts_Projection-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_Projection-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder_GWT.ast +0 -0
- package/lib/ocaml/CancelOrder_GWT.res +13 -10
- package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeAddress_GWT.ast +0 -0
- package/lib/ocaml/ChangeAddress_GWT.res +13 -9
- package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeEmail_GWT.ast +0 -0
- package/lib/ocaml/ChangeEmail_GWT.res +13 -9
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +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 +16 -20
- package/lib/ocaml/Customers_Projection-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_Projection-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT.ast +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT.res +8 -5
- package/lib/ocaml/OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderingPlugin.mlmap +1 -0
- package/lib/ocaml/Ordering_Examples-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Ordering_Examples-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/Ordering_Examples-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Ordering_Examples.ast +0 -0
- package/lib/ocaml/Ordering_Examples.res +15 -0
- 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 +7 -7
- 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 +14 -21
- package/lib/ocaml/Orders_Projection-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Projection-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder_GWT.ast +0 -0
- package/lib/ocaml/PlaceOrder_GWT.res +19 -18
- 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_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 +7 -7
- package/lib/ocaml/RegisterCustomer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/RegisterCustomer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/RegisterCustomer_GWT.ast +0 -0
- package/lib/ocaml/RegisterCustomer_GWT.res +6 -6
- package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT.ast +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT.res +7 -6
- package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder_GWT.ast +0 -0
- package/lib/ocaml/ShipOrder_GWT.res +10 -6
- package/lib/ocaml/SyncCatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SyncCatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT.ast +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT.res +14 -10
- package/package.json +8 -8
- package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res +14 -10
- package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +13 -16
- package/tests/CatalogProduct/StateView/AvailableProducts_GWT.res +8 -6
- package/tests/CatalogProduct/StateView/AvailableProducts_GWT.res.mjs +10 -12
- package/tests/Customer/StateChange/ChangeAddress_GWT.res +13 -9
- package/tests/Customer/StateChange/ChangeAddress_GWT.res.mjs +14 -17
- package/tests/Customer/StateChange/ChangeEmail_GWT.res +13 -9
- package/tests/Customer/StateChange/ChangeEmail_GWT.res.mjs +14 -17
- package/tests/Customer/StateChange/DeactivateCustomer_GWT.res +8 -5
- package/tests/Customer/StateChange/DeactivateCustomer_GWT.res.mjs +5 -8
- package/tests/Customer/StateChange/RegisterCustomer_GWT.res +6 -6
- package/tests/Customer/StateChange/RegisterCustomer_GWT.res.mjs +8 -11
- package/tests/Customer/StateView/Customers_GWT.res +16 -20
- package/tests/Customer/StateView/Customers_GWT.res.mjs +30 -32
- package/tests/Extension/Products_Extension_GWT.res +7 -7
- package/tests/Extension/Products_Extension_GWT.res.mjs +5 -8
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +7 -7
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +8 -19
- package/tests/Order/Automation/AutoShipOrder_GWT.res +13 -8
- package/tests/Order/Automation/AutoShipOrder_GWT.res.mjs +8 -11
- package/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res +7 -6
- package/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res.mjs +9 -16
- package/tests/Order/StateChange/CancelOrder_GWT.res +13 -10
- package/tests/Order/StateChange/CancelOrder_GWT.res.mjs +12 -19
- package/tests/Order/StateChange/PlaceOrder_GWT.res +19 -18
- package/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +31 -42
- package/tests/Order/StateChange/ShipOrder_GWT.res +10 -6
- package/tests/Order/StateChange/ShipOrder_GWT.res.mjs +6 -9
- package/tests/Order/StateView/Orders_GWT.res +14 -21
- package/tests/Order/StateView/Orders_GWT.res.mjs +23 -33
- package/tests/Ordering_Examples.res +15 -0
- package/tests/Ordering_Examples.res.mjs +39 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@@reventless.examples
|
|
2
|
+
|
|
3
|
+
let p1: CatalogSpec.ProductId.t = CatalogSpec.ProductId.makeFromString("p1")
|
|
4
|
+
let p2: CatalogSpec.ProductId.t = CatalogSpec.ProductId.makeFromString("p2")
|
|
5
|
+
|
|
6
|
+
let c1: CustomerId.t = CustomerId.makeFromString("c1")
|
|
7
|
+
|
|
8
|
+
let o1: OrderId.t = OrderId.makeFromString("o1")
|
|
9
|
+
let o2: OrderId.t = OrderId.makeFromString("o2")
|
|
10
|
+
|
|
11
|
+
let aliceEmail: string = "alice@x.y"
|
|
12
|
+
let aliceNewEmail: string = "alice2@x.y"
|
|
13
|
+
let laptop: string = "Laptop"
|
|
14
|
+
let mainStreet: string = "123 Main"
|
|
15
|
+
let pineStreet: string = "789 Pine"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
// into one public per-product event each (one-to-many fan-out).
|
|
3
3
|
@@reventless.gwt
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
let oid = OrderId.make
|
|
7
|
-
let pid = CatalogSpec.ProductId.make
|
|
5
|
+
open Ordering_Examples
|
|
8
6
|
|
|
9
7
|
describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
|
|
8
|
+
// scenario-id: 1a9119c4-48fe-4f5f-b357-a3326dcd4ae9
|
|
10
9
|
test("OrderPlaced fans out to one ItemOrdered per product", () =>
|
|
11
10
|
whenDelegateEvent(
|
|
12
11
|
Delegate.OrderPlaced({
|
|
13
|
-
orderId:
|
|
14
|
-
customerId:
|
|
15
|
-
productIds: [
|
|
12
|
+
orderId: o1,
|
|
13
|
+
customerId: c1,
|
|
14
|
+
productIds: [p1, p2],
|
|
16
15
|
}),
|
|
17
16
|
)->thenPublishesEvents([
|
|
18
17
|
("p1", ExtensionPoint.ItemOrdered({productId: "p1", orderId: "o1", customerId: "c1"})),
|
|
@@ -20,9 +19,10 @@ describe("Orders ExtensionPoint mapping — per-product fan-out", () => {
|
|
|
20
19
|
])
|
|
21
20
|
)
|
|
22
21
|
|
|
22
|
+
// scenario-id: c8a2bb56-33d0-4f1d-a9f0-220e4e04f755
|
|
23
23
|
test("OrderCancelled fans out to one ItemOrderCancelled per product", () =>
|
|
24
24
|
whenDelegateEvent(
|
|
25
|
-
Delegate.OrderCancelled({orderId:
|
|
25
|
+
Delegate.OrderCancelled({orderId: o1, productIds: [p1, p2]}),
|
|
26
26
|
)->thenPublishesEvents([
|
|
27
27
|
("p1", ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "o1"})),
|
|
28
28
|
("p2", ExtensionPoint.ItemOrderCancelled({productId: "p2", orderId: "o1"})),
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/Orders_GWT.ast
CHANGED
|
Binary file
|
package/lib/ocaml/Orders_GWT.res
CHANGED
|
@@ -1,41 +1,34 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
let oid = OrderId.make
|
|
5
|
-
let pid = CatalogSpec.ProductId.make
|
|
3
|
+
open Ordering_Examples
|
|
6
4
|
|
|
7
5
|
describe("Orders StateViewSlice", () => {
|
|
6
|
+
// scenario-id: 7967e51a-49fb-4f1e-81f8-a4feabeccf8a
|
|
8
7
|
test("OrderPlaced creates a row with status Placed", () =>
|
|
9
8
|
givenEvents([])
|
|
10
|
-
->whenEvent(
|
|
11
|
-
OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1"), pid("p2")]}),
|
|
12
|
-
)
|
|
9
|
+
->whenEvent(OrderPlaced({orderId: o1, customerId: c1, productIds: [p1, p2]}))
|
|
13
10
|
->thenStateWithId(
|
|
14
11
|
"o1",
|
|
15
12
|
{
|
|
16
|
-
orderId:
|
|
17
|
-
customerId:
|
|
18
|
-
productIds: [
|
|
13
|
+
orderId: o1,
|
|
14
|
+
customerId: c1,
|
|
15
|
+
productIds: [p1, p2],
|
|
19
16
|
lifecycle: Placed,
|
|
20
17
|
},
|
|
21
18
|
)
|
|
22
19
|
)
|
|
23
20
|
|
|
21
|
+
// scenario-id: e97d9c01-c2e6-48c1-82d2-3cc2e7c8e401
|
|
24
22
|
test("OrderShipped updates status to Shipped", () =>
|
|
25
|
-
givenEvents([OrderPlaced({orderId:
|
|
26
|
-
->whenEvent(OrderShipped({orderId:
|
|
27
|
-
->thenStateWithId(
|
|
28
|
-
"o1",
|
|
29
|
-
{orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")], lifecycle: Shipped},
|
|
30
|
-
)
|
|
23
|
+
givenEvents([OrderPlaced({orderId: o1, customerId: c1, productIds: [p1]})])
|
|
24
|
+
->whenEvent(OrderShipped({orderId: o1}))
|
|
25
|
+
->thenStateWithId("o1", {orderId: o1, customerId: c1, productIds: [p1], lifecycle: Shipped})
|
|
31
26
|
)
|
|
32
27
|
|
|
28
|
+
// scenario-id: 94ff556f-1d4d-444d-8eda-0a9192715489
|
|
33
29
|
test("OrderCancelled updates status to Cancelled", () =>
|
|
34
|
-
givenEvents([OrderPlaced({orderId:
|
|
35
|
-
->whenEvent(OrderCancelled({orderId:
|
|
36
|
-
->thenStateWithId(
|
|
37
|
-
"o1",
|
|
38
|
-
{orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")], lifecycle: Cancelled},
|
|
39
|
-
)
|
|
30
|
+
givenEvents([OrderPlaced({orderId: o1, customerId: c1, productIds: [p1]})])
|
|
31
|
+
->whenEvent(OrderCancelled({orderId: o1}))
|
|
32
|
+
->thenStateWithId("o1", {orderId: o1, customerId: c1, productIds: [p1], lifecycle: Cancelled})
|
|
40
33
|
)
|
|
41
34
|
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
let oid = OrderId.make
|
|
5
|
-
let pid = CatalogSpec.ProductId.make
|
|
3
|
+
open Ordering_Examples
|
|
6
4
|
|
|
7
5
|
describe("PlaceOrder StateChangeSlice", () => {
|
|
6
|
+
// scenario-id: 2165f9d4-87c0-4f25-a4f6-c3e0ac59a41b
|
|
8
7
|
test("requires referenced products to be synced first", () =>
|
|
9
8
|
givenEvents([])
|
|
10
|
-
->whenCmd(PlaceOrder({orderId:
|
|
11
|
-
->thenError(ProductsNotAvailable({missing: [
|
|
9
|
+
->whenCmd(PlaceOrder({orderId: o1, customerId: c1, productIds: [p1]}))
|
|
10
|
+
->thenError(ProductsNotAvailable({missing: [p1]}))
|
|
12
11
|
)
|
|
13
12
|
|
|
13
|
+
// scenario-id: d20adf8e-1883-4e2f-8d22-10f2470a1f44
|
|
14
14
|
test("placement succeeds when products are available", () =>
|
|
15
|
-
givenEvents([CatalogProductSynced({productId:
|
|
16
|
-
->whenCmd(PlaceOrder({orderId:
|
|
17
|
-
->thenEvent(OrderPlaced({orderId:
|
|
15
|
+
givenEvents([CatalogProductSynced({productId: p1})])
|
|
16
|
+
->whenCmd(PlaceOrder({orderId: o1, customerId: c1, productIds: [p1]}))
|
|
17
|
+
->thenEvent(OrderPlaced({orderId: o1, customerId: c1, productIds: [p1]}))
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
+
// scenario-id: 7594b170-f241-4eb9-83d1-aaa651a80f66
|
|
20
21
|
test("partial product availability returns ProductsNotAvailable with missing list", () =>
|
|
21
|
-
givenEvents([CatalogProductSynced({productId:
|
|
22
|
-
->whenCmd(
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
->thenError(ProductsNotAvailable({missing: [pid("p2")]}))
|
|
22
|
+
givenEvents([CatalogProductSynced({productId: p1})])
|
|
23
|
+
->whenCmd(PlaceOrder({orderId: o1, customerId: c1, productIds: [p1, p2]}))
|
|
24
|
+
->thenError(ProductsNotAvailable({missing: [p2]}))
|
|
26
25
|
)
|
|
27
26
|
|
|
27
|
+
// scenario-id: 2d259e4c-b8d5-40ae-b5f5-018cbf31eaa4
|
|
28
28
|
test("re-placing the same orderId returns OrderAlreadyPlaced", () =>
|
|
29
|
-
givenEvents([CatalogProductSynced({productId:
|
|
30
|
-
->whenCmd(PlaceOrder({orderId:
|
|
29
|
+
givenEvents([CatalogProductSynced({productId: p1}), OrderPlaced({orderId: o1})])
|
|
30
|
+
->whenCmd(PlaceOrder({orderId: o1, customerId: c1, productIds: [p1]}))
|
|
31
31
|
->thenError(OrderAlreadyPlaced)
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
+
// scenario-id: 2fc00acf-df4c-4c2e-8280-a82dedad5fb0
|
|
34
35
|
test("a sibling OrderPlaced for a different orderId does not block placement", () =>
|
|
35
|
-
givenEvents([CatalogProductSynced({productId:
|
|
36
|
-
->whenCmd(PlaceOrder({orderId:
|
|
37
|
-
->thenEvent(OrderPlaced({orderId:
|
|
36
|
+
givenEvents([CatalogProductSynced({productId: p1}), OrderPlaced({orderId: o2})])
|
|
37
|
+
->whenCmd(PlaceOrder({orderId: o1, customerId: c1, productIds: [p1]}))
|
|
38
|
+
->thenEvent(OrderPlaced({orderId: o1, customerId: c1, productIds: [p1]}))
|
|
38
39
|
)
|
|
39
40
|
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
// SyncCatalogProduct commands on Ordering's local shadow slice.
|
|
3
3
|
@@reventless.gwt
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
open Ordering_Examples
|
|
6
6
|
|
|
7
7
|
// `Mapping` is brought into scope by the PPX `open Products_Extension`; opening
|
|
8
8
|
// it surfaces the extension point's events and the delegate's commands.
|
|
9
9
|
open Mapping
|
|
10
10
|
|
|
11
11
|
describe("Products Extension delegate", () => {
|
|
12
|
+
// scenario-id: a4680fe3-1546-4669-9334-d8971e2b7162
|
|
12
13
|
test("ProductBecameAvailable issues SyncNewProduct", () =>
|
|
13
14
|
whenIncomingEvent(
|
|
14
|
-
ExtensionPoint.ProductBecameAvailable({productId:
|
|
15
|
-
)->thenPublishesCommand(
|
|
16
|
-
Delegate.SyncNewProduct({productId: pid("p1"), name: "Book", price: 9.99}),
|
|
17
|
-
)
|
|
15
|
+
ExtensionPoint.ProductBecameAvailable({productId: p1, name: "Book", price: 9.99}),
|
|
16
|
+
)->thenPublishesCommand(Delegate.SyncNewProduct({productId: p1, name: "Book", price: 9.99}))
|
|
18
17
|
)
|
|
19
18
|
|
|
19
|
+
// scenario-id: b8178540-b81e-4d82-9b93-9f2f68b968c6
|
|
20
20
|
test("ProductPriceChanged issues ChangeSyncedPrice", () =>
|
|
21
21
|
whenIncomingEvent(
|
|
22
|
-
ExtensionPoint.ProductPriceChanged({productId:
|
|
23
|
-
)->thenPublishesCommand(Delegate.ChangeSyncedPrice({productId:
|
|
22
|
+
ExtensionPoint.ProductPriceChanged({productId: p1, price: 7.5}),
|
|
23
|
+
)->thenPublishesCommand(Delegate.ChangeSyncedPrice({productId: p1, price: 7.5}))
|
|
24
24
|
)
|
|
25
25
|
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
open Ordering_Examples
|
|
4
4
|
|
|
5
5
|
describe("RegisterCustomer StateChangeSlice", () => {
|
|
6
|
+
// scenario-id: fd616ac0-6ee3-47ef-b74f-212a7befac4a
|
|
6
7
|
test("empty event log produces CustomerRegistered", () =>
|
|
7
8
|
givenEvents([])
|
|
8
|
-
->whenCmd(RegisterCustomer({customerId:
|
|
9
|
-
->thenEvent(
|
|
10
|
-
CustomerRegistered({customerId: cid("c1"), email: "alice@x.y", address: "123 Main"}),
|
|
11
|
-
)
|
|
9
|
+
->whenCmd(RegisterCustomer({customerId: c1, email: aliceEmail, address: mainStreet}))
|
|
10
|
+
->thenEvent(CustomerRegistered({customerId: c1, email: aliceEmail, address: mainStreet}))
|
|
12
11
|
)
|
|
13
12
|
|
|
13
|
+
// scenario-id: d99db741-d659-456e-b84f-9af30a7d8a41
|
|
14
14
|
test("existing customer returns CustomerAlreadyRegistered", () =>
|
|
15
15
|
givenEvents([CustomerRegistered])
|
|
16
|
-
->whenCmd(RegisterCustomer({customerId:
|
|
16
|
+
->whenCmd(RegisterCustomer({customerId: c1, email: "bob@x.y", address: "456 Oak"}))
|
|
17
17
|
->thenError(CustomerAlreadyRegistered)
|
|
18
18
|
)
|
|
19
19
|
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -12,24 +12,25 @@ module SendOrderConfirmationSlice = {
|
|
|
12
12
|
|
|
13
13
|
@@reventless.gwt
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
let oid = OrderId.make
|
|
15
|
+
open Ordering_Examples
|
|
17
16
|
|
|
18
17
|
describe("SendOrderConfirmation OutboundTranslationSlice", () => {
|
|
19
18
|
testSync("collect: OrderPlaced queues an outbound TODO", () =>
|
|
20
|
-
givenEvent(OrderPlaced({orderId:
|
|
19
|
+
givenEvent(OrderPlaced({orderId: o1, customerId: c1}))
|
|
21
20
|
->whenCollect
|
|
22
|
-
->thenTodos([("o1", {orderId:
|
|
21
|
+
->thenTodos([("o1", {orderId: o1, customerId: c1})])
|
|
23
22
|
)
|
|
24
23
|
|
|
24
|
+
// scenario-id: f72032f8-25ba-482e-be6e-4c765908bb70
|
|
25
25
|
test("translate success marks the TODO Completed", () =>
|
|
26
|
-
givenTodo("o1", {orderId:
|
|
26
|
+
givenTodo("o1", {orderId: o1, customerId: c1})
|
|
27
27
|
->whenTranslateMocked((_id, _item) => Promise.resolve(Ok(None)))
|
|
28
28
|
->thenTodoStatus("o1", #Completed)
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
+
// scenario-id: a4563058-8777-4756-8e12-983fcd0e8f20
|
|
31
32
|
test("translate failure leaves the TODO Pending for retry", () =>
|
|
32
|
-
givenTodo("o1", {orderId:
|
|
33
|
+
givenTodo("o1", {orderId: o1, customerId: c1})
|
|
33
34
|
->whenTranslateMocked((_id, _item) => Promise.resolve(Error("smtp down")))
|
|
34
35
|
->thenTodoStatus("o1", #Pending)
|
|
35
36
|
)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
open Ordering_Examples
|
|
4
4
|
|
|
5
5
|
describe("ShipOrder StateChangeSlice", () => {
|
|
6
|
+
// scenario-id: 2146c7ce-d052-4b18-8d15-373916445f80
|
|
6
7
|
test("non-existent order returns OrderNotFound", () =>
|
|
7
8
|
givenEvents([])
|
|
8
|
-
->whenCmd(ShipOrder({orderId:
|
|
9
|
+
->whenCmd(ShipOrder({orderId: o1}))
|
|
9
10
|
->thenError(OrderNotFound)
|
|
10
11
|
)
|
|
11
12
|
|
|
13
|
+
// scenario-id: 76062151-57bb-468b-9fee-915e35e8d67e
|
|
12
14
|
test("placed order produces OrderShipped", () =>
|
|
13
15
|
givenEvents([OrderPlaced])
|
|
14
|
-
->whenCmd(ShipOrder({orderId:
|
|
15
|
-
->thenEvent(OrderShipped({orderId:
|
|
16
|
+
->whenCmd(ShipOrder({orderId: o1}))
|
|
17
|
+
->thenEvent(OrderShipped({orderId: o1}))
|
|
16
18
|
)
|
|
17
19
|
|
|
20
|
+
// scenario-id: 3ffc1f1f-8611-4c99-90b3-435b441140d3
|
|
18
21
|
test("already shipped order produces no events (idempotent)", () =>
|
|
19
22
|
givenEvents([OrderPlaced, OrderShipped])
|
|
20
|
-
->whenCmd(ShipOrder({orderId:
|
|
23
|
+
->whenCmd(ShipOrder({orderId: o1}))
|
|
21
24
|
->thenNoEvent
|
|
22
25
|
)
|
|
23
26
|
|
|
27
|
+
// scenario-id: 23a22483-510c-458d-aa40-17c442470b22
|
|
24
28
|
test("cancelled order returns OrderAlreadyCancelled", () =>
|
|
25
29
|
givenEvents([OrderPlaced, OrderCancelled])
|
|
26
|
-
->whenCmd(ShipOrder({orderId:
|
|
30
|
+
->whenCmd(ShipOrder({orderId: o1}))
|
|
27
31
|
->thenError(OrderAlreadyCancelled)
|
|
28
32
|
)
|
|
29
33
|
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
open Ordering_Examples
|
|
4
4
|
|
|
5
5
|
describe("SyncCatalogProduct StateChangeSlice", () => {
|
|
6
|
+
// scenario-id: 7aa368ea-aa0c-4643-9ac1-73fa767d66ee
|
|
6
7
|
test("SyncNewProduct produces CatalogProductSynced", () =>
|
|
7
8
|
givenEvents([])
|
|
8
|
-
->whenCmd(SyncNewProduct({productId:
|
|
9
|
-
->thenEvent(CatalogProductSynced({productId:
|
|
9
|
+
->whenCmd(SyncNewProduct({productId: p1, name: laptop, price: 999.99}))
|
|
10
|
+
->thenEvent(CatalogProductSynced({productId: p1, name: laptop, price: 999.99}))
|
|
10
11
|
)
|
|
11
12
|
|
|
13
|
+
// scenario-id: ec4e7784-783e-4b2c-855c-d2c111333658
|
|
12
14
|
test("ChangeSyncedPrice produces CatalogProductPriceChanged", () =>
|
|
13
|
-
givenEvents([CatalogProductSynced({name:
|
|
14
|
-
->whenCmd(ChangeSyncedPrice({productId:
|
|
15
|
-
->thenEvent(CatalogProductPriceChanged({productId:
|
|
15
|
+
givenEvents([CatalogProductSynced({name: laptop, price: 999.99})])
|
|
16
|
+
->whenCmd(ChangeSyncedPrice({productId: p1, price: 899.99}))
|
|
17
|
+
->thenEvent(CatalogProductPriceChanged({productId: p1, price: 899.99}))
|
|
16
18
|
)
|
|
17
19
|
|
|
20
|
+
// scenario-id: 20c38820-28d3-4fb4-b9c6-64000e089de9
|
|
18
21
|
test("re-syncing identical product data produces no events (idempotent)", () =>
|
|
19
|
-
givenEvents([CatalogProductSynced({name:
|
|
20
|
-
->whenCmd(SyncNewProduct({productId:
|
|
22
|
+
givenEvents([CatalogProductSynced({name: laptop, price: 999.99})])
|
|
23
|
+
->whenCmd(SyncNewProduct({productId: p1, name: laptop, price: 999.99}))
|
|
21
24
|
->thenNoEvent
|
|
22
25
|
)
|
|
23
26
|
|
|
27
|
+
// scenario-id: 9d1cebd5-19ce-4352-905f-00353c078b9b
|
|
24
28
|
test("re-applying the current price produces no events (idempotent)", () =>
|
|
25
|
-
givenEvents([CatalogProductSynced({name:
|
|
26
|
-
->whenCmd(ChangeSyncedPrice({productId:
|
|
29
|
+
givenEvents([CatalogProductSynced({name: laptop, price: 999.99})])
|
|
30
|
+
->whenCmd(ChangeSyncedPrice({productId: p1, price: 999.99}))
|
|
27
31
|
->thenNoEvent
|
|
28
32
|
)
|
|
29
33
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/online-shop-dcb-ordering",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.252",
|
|
4
4
|
"description": "Online Shop example — Ordering bounded context (Customer & Order) using the DCB pattern",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"sury": "11.0.0",
|
|
24
|
-
"@reventlessdev/
|
|
25
|
-
"@reventlessdev/online-shop-dcb-catalog-spec": "1.0.0-alpha.142",
|
|
26
|
-
"@reventlessdev/reventless-gwt": "1.0.0-alpha.217",
|
|
24
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.218",
|
|
27
25
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.22",
|
|
28
|
-
"@reventlessdev/
|
|
29
|
-
"@reventlessdev/reventless-
|
|
30
|
-
"@reventlessdev/
|
|
26
|
+
"@reventlessdev/online-shop-dcb-catalog-spec": "1.0.0-alpha.143",
|
|
27
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.171",
|
|
28
|
+
"@reventlessdev/online-shop-dcb-ordering-spec": "1.0.0-alpha.143",
|
|
29
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.261",
|
|
30
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.143"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"rescript": "12.3.1",
|
|
34
34
|
"sury-ppx": "11.0.0",
|
|
35
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
35
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.89"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"rescript": "^12.3.1"
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
open Ordering_Examples
|
|
4
4
|
|
|
5
5
|
describe("SyncCatalogProduct StateChangeSlice", () => {
|
|
6
|
+
// scenario-id: 7aa368ea-aa0c-4643-9ac1-73fa767d66ee
|
|
6
7
|
test("SyncNewProduct produces CatalogProductSynced", () =>
|
|
7
8
|
givenEvents([])
|
|
8
|
-
->whenCmd(SyncNewProduct({productId:
|
|
9
|
-
->thenEvent(CatalogProductSynced({productId:
|
|
9
|
+
->whenCmd(SyncNewProduct({productId: p1, name: laptop, price: 999.99}))
|
|
10
|
+
->thenEvent(CatalogProductSynced({productId: p1, name: laptop, price: 999.99}))
|
|
10
11
|
)
|
|
11
12
|
|
|
13
|
+
// scenario-id: ec4e7784-783e-4b2c-855c-d2c111333658
|
|
12
14
|
test("ChangeSyncedPrice produces CatalogProductPriceChanged", () =>
|
|
13
|
-
givenEvents([CatalogProductSynced({name:
|
|
14
|
-
->whenCmd(ChangeSyncedPrice({productId:
|
|
15
|
-
->thenEvent(CatalogProductPriceChanged({productId:
|
|
15
|
+
givenEvents([CatalogProductSynced({name: laptop, price: 999.99})])
|
|
16
|
+
->whenCmd(ChangeSyncedPrice({productId: p1, price: 899.99}))
|
|
17
|
+
->thenEvent(CatalogProductPriceChanged({productId: p1, price: 899.99}))
|
|
16
18
|
)
|
|
17
19
|
|
|
20
|
+
// scenario-id: 20c38820-28d3-4fb4-b9c6-64000e089de9
|
|
18
21
|
test("re-syncing identical product data produces no events (idempotent)", () =>
|
|
19
|
-
givenEvents([CatalogProductSynced({name:
|
|
20
|
-
->whenCmd(SyncNewProduct({productId:
|
|
22
|
+
givenEvents([CatalogProductSynced({name: laptop, price: 999.99})])
|
|
23
|
+
->whenCmd(SyncNewProduct({productId: p1, name: laptop, price: 999.99}))
|
|
21
24
|
->thenNoEvent
|
|
22
25
|
)
|
|
23
26
|
|
|
27
|
+
// scenario-id: 9d1cebd5-19ce-4352-905f-00353c078b9b
|
|
24
28
|
test("re-applying the current price produces no events (idempotent)", () =>
|
|
25
|
-
givenEvents([CatalogProductSynced({name:
|
|
26
|
-
->whenCmd(ChangeSyncedPrice({productId:
|
|
29
|
+
givenEvents([CatalogProductSynced({name: laptop, price: 999.99})])
|
|
30
|
+
->whenCmd(ChangeSyncedPrice({productId: p1, price: 999.99}))
|
|
27
31
|
->thenNoEvent
|
|
28
32
|
)
|
|
29
33
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-dcb-catalog-spec/src/ProductId.res.mjs";
|
|
4
3
|
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
4
|
+
import * as Ordering_Examples$OrderingPlugin from "../../Ordering_Examples.res.mjs";
|
|
5
5
|
import * as SyncCatalogProduct$OrderingPlugin from "../../../src/CatalogProduct/StateChange/SyncCatalogProduct.res.mjs";
|
|
6
6
|
import * as SyncCatalogProduct_Behavior$OrderingPlugin from "../../../src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior.res.mjs";
|
|
7
7
|
|
|
@@ -32,45 +32,45 @@ let thenNoEvent = include.thenNoEvent;
|
|
|
32
32
|
describe("SyncCatalogProduct StateChangeSlice", () => {
|
|
33
33
|
test("SyncNewProduct produces CatalogProductSynced", () => thenEvent(whenCmd(givenEvents([]), {
|
|
34
34
|
TAG: "SyncNewProduct",
|
|
35
|
-
productId:
|
|
36
|
-
name:
|
|
35
|
+
productId: Ordering_Examples$OrderingPlugin.p1,
|
|
36
|
+
name: Ordering_Examples$OrderingPlugin.laptop,
|
|
37
37
|
price: 999.99
|
|
38
38
|
}), {
|
|
39
39
|
TAG: "CatalogProductSynced",
|
|
40
|
-
productId:
|
|
41
|
-
name:
|
|
40
|
+
productId: Ordering_Examples$OrderingPlugin.p1,
|
|
41
|
+
name: Ordering_Examples$OrderingPlugin.laptop,
|
|
42
42
|
price: 999.99
|
|
43
43
|
}));
|
|
44
44
|
test("ChangeSyncedPrice produces CatalogProductPriceChanged", () => thenEvent(whenCmd(givenEvents([{
|
|
45
45
|
TAG: "CatalogProductSynced",
|
|
46
|
-
name:
|
|
46
|
+
name: Ordering_Examples$OrderingPlugin.laptop,
|
|
47
47
|
price: 999.99
|
|
48
48
|
}]), {
|
|
49
49
|
TAG: "ChangeSyncedPrice",
|
|
50
|
-
productId:
|
|
50
|
+
productId: Ordering_Examples$OrderingPlugin.p1,
|
|
51
51
|
price: 899.99
|
|
52
52
|
}), {
|
|
53
53
|
TAG: "CatalogProductPriceChanged",
|
|
54
|
-
productId:
|
|
54
|
+
productId: Ordering_Examples$OrderingPlugin.p1,
|
|
55
55
|
price: 899.99
|
|
56
56
|
}));
|
|
57
57
|
test("re-syncing identical product data produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
58
58
|
TAG: "CatalogProductSynced",
|
|
59
|
-
name:
|
|
59
|
+
name: Ordering_Examples$OrderingPlugin.laptop,
|
|
60
60
|
price: 999.99
|
|
61
61
|
}]), {
|
|
62
62
|
TAG: "SyncNewProduct",
|
|
63
|
-
productId:
|
|
64
|
-
name:
|
|
63
|
+
productId: Ordering_Examples$OrderingPlugin.p1,
|
|
64
|
+
name: Ordering_Examples$OrderingPlugin.laptop,
|
|
65
65
|
price: 999.99
|
|
66
66
|
})));
|
|
67
67
|
test("re-applying the current price produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
|
|
68
68
|
TAG: "CatalogProductSynced",
|
|
69
|
-
name:
|
|
69
|
+
name: Ordering_Examples$OrderingPlugin.laptop,
|
|
70
70
|
price: 999.99
|
|
71
71
|
}]), {
|
|
72
72
|
TAG: "ChangeSyncedPrice",
|
|
73
|
-
productId:
|
|
73
|
+
productId: Ordering_Examples$OrderingPlugin.p1,
|
|
74
74
|
price: 999.99
|
|
75
75
|
})));
|
|
76
76
|
});
|
|
@@ -91,8 +91,6 @@ let thenAppendsConditionedOn = include.thenAppendsConditionedOn;
|
|
|
91
91
|
|
|
92
92
|
let thenAppendsConditionedOnExactly = include.thenAppendsConditionedOnExactly;
|
|
93
93
|
|
|
94
|
-
let pid = ProductId$CatalogSpec.make;
|
|
95
|
-
|
|
96
94
|
export {
|
|
97
95
|
Spec,
|
|
98
96
|
describe,
|
|
@@ -108,6 +106,5 @@ export {
|
|
|
108
106
|
thenError,
|
|
109
107
|
thenAppendsConditionedOn,
|
|
110
108
|
thenAppendsConditionedOnExactly,
|
|
111
|
-
pid,
|
|
112
109
|
}
|
|
113
110
|
/* include Not a pure module */
|