@reventlessdev/online-shop-aggregates-ordering 3.0.0-alpha.233 → 3.0.0-alpha.235
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 +1 -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.mjs +1 -1
- 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_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
- 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.mjs +1 -1
- 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/ReadModel/Customers-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmt +0 -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/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/LifecycleModel-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/LifecycleModel-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/LifecycleModel-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/LifecycleModel.ast +0 -0
- package/lib/bs/src/LifecycleModel.res +14 -0
- package/lib/bs/src/LifecycleModel.res.mjs +38 -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 +4 -1
- package/lib/bs/src/Order/Aggregate/Order.res.mjs +4 -1
- 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_Mappings-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -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_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
- 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/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin.ast +0 -0
- package/lib/bs/src/Plugin.res +1 -0
- package/lib/bs/src/Plugin.res.mjs +2 -1
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
- 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/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
- 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/ReadModel/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmt +0 -0
- 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/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_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_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_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_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.cmj +0 -0
- package/lib/ocaml/LifecycleModel-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/LifecycleModel.ast +0 -0
- package/lib/ocaml/LifecycleModel.res +14 -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 +4 -1
- package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
- 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_EmailNotification-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmt +0 -0
- 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 +1 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -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_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
- 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/Plugin.ast +0 -0
- package/lib/ocaml/Plugin.res +1 -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/package.json +8 -8
- package/src/CatalogProduct/Aggregate/CatalogProduct.res.mjs +1 -1
- package/src/Customer/Aggregate/Customer.res.mjs +1 -1
- package/src/LifecycleModel.res +14 -0
- package/src/LifecycleModel.res.mjs +38 -0
- package/src/Order/Aggregate/Order.res +4 -1
- package/src/Order/Aggregate/Order.res.mjs +4 -1
- package/src/Plugin.res +1 -0
- package/src/Plugin.res.mjs +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.235 (2026-09-07)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **core:** a command's lifecycle edge comes from its scenarios, not its claim ([1879d05](https://github.com/ReventlessDev/reventless-core/commit/1879d0570a981e7fae5bcd3808f8a36e898bd0fd))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# 3.0.0-alpha.234 (2026-09-04)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @reventlessdev/online-shop-aggregates-ordering
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
# 3.0.0-alpha.233 (2026-09-04)
|
|
7
22
|
|
|
8
23
|
**Note:** Version bump only for package @reventlessdev/online-shop-aggregates-ordering
|
package/lib/bs/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1788762246366)
|
|
2
|
+
#Done(1788762252176)
|
|
Binary file
|
|
Binary file
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"bsc_hash": "75e3a59c95cc953608fd3dd6ea6ed68141bba4414a20a52f114261b8a48385fa",
|
|
5
5
|
"rescript_config_hash": "4c884bf958b93b21c77764e35498f269b81377cfcc324135f1ab7a1cc5b569cb",
|
|
6
6
|
"runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
|
|
7
|
-
"generated_at": "
|
|
7
|
+
"generated_at": "1788762252180"
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi
CHANGED
|
Binary file
|
package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// AUTO-GENERATED — do not edit. Run `pnpm run check:lifecycle:update` to update.
|
|
2
|
+
//
|
|
3
|
+
// What ordering's own given/when/then scenarios say about each command: the
|
|
4
|
+
// states one shows it taking effect from, the states those land in, and whether
|
|
5
|
+
// it brings a row into existence. `Plugin_Structure` prefers this to the
|
|
6
|
+
// `@transition` annotation where it says anything, and falls back to the
|
|
7
|
+
// annotation where it is silent.
|
|
8
|
+
|
|
9
|
+
let model: array<Reventless.Plugin.derivedEdge> = [
|
|
10
|
+
{component: "Order", command: "Cancel", level: Reventless.Plugin.Instance, allowedStates: ["Placed"], targets: ["Cancelled"]},
|
|
11
|
+
{component: "Order", command: "Place", level: Reventless.Plugin.Collection, allowedStates: [], targets: ["Placed"]},
|
|
12
|
+
{component: "Order", command: "Refund", level: Reventless.Plugin.Instance, allowedStates: ["Cancelled"], targets: ["Refunded"]},
|
|
13
|
+
{component: "Order", command: "Ship", level: Reventless.Plugin.Instance, allowedStates: ["Placed"], targets: ["Shipped"]},
|
|
14
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
let model = [
|
|
5
|
+
{
|
|
6
|
+
component: "Order",
|
|
7
|
+
command: "Cancel",
|
|
8
|
+
level: "Instance",
|
|
9
|
+
allowedStates: ["Placed"],
|
|
10
|
+
targets: ["Cancelled"]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
component: "Order",
|
|
14
|
+
command: "Place",
|
|
15
|
+
level: "Collection",
|
|
16
|
+
allowedStates: [],
|
|
17
|
+
targets: ["Placed"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
component: "Order",
|
|
21
|
+
command: "Refund",
|
|
22
|
+
level: "Instance",
|
|
23
|
+
allowedStates: ["Cancelled"],
|
|
24
|
+
targets: ["Refunded"]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
component: "Order",
|
|
28
|
+
command: "Ship",
|
|
29
|
+
level: "Instance",
|
|
30
|
+
allowedStates: ["Placed"],
|
|
31
|
+
targets: ["Shipped"]
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
model,
|
|
37
|
+
}
|
|
38
|
+
/* No side effect */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -33,7 +33,10 @@ type lifecycleState = Orders.lifecycle
|
|
|
33
33
|
let commandTransition = (command: command): Reventless.Transition.t<lifecycleState> => {
|
|
34
34
|
open Reventless.Transition
|
|
35
35
|
switch command {
|
|
36
|
-
|
|
36
|
+
// Brings the row into existence, so there is no state it could come from.
|
|
37
|
+
// Not `Unrestricted`: the scenarios show it inert on an order already placed,
|
|
38
|
+
// shipped or cancelled, which is the opposite of legal in every state.
|
|
39
|
+
| Place(_) => Creates(Orders.Placed)
|
|
37
40
|
| Ship => Moves([Orders.Placed], Orders.Shipped)
|
|
38
41
|
| Cancel => Moves([Orders.Placed], Orders.Cancelled)
|
|
39
42
|
| Refund(_) => Moves([Orders.Cancelled], Orders.Refunded)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/bs/src/Plugin.ast
CHANGED
|
Binary file
|
package/lib/bs/src/Plugin.res
CHANGED
|
@@ -41,6 +41,7 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
41
41
|
~extensions=[module(Products_Extension)],
|
|
42
42
|
~extensionPoints=[module(Orders_ExtensionPointMapping)],
|
|
43
43
|
~componentChapters=Dict.fromArray([("AvailableProducts", "CatalogProduct"), ("CatalogProduct", "CatalogProduct"), ("Customer", "Customer"), ("Customers", "Customer"), ("Order", "Order"), ("Orders", "Order")]),
|
|
44
|
+
~lifecycleModel=LifecycleModel.model,
|
|
44
45
|
)
|
|
45
46
|
|
|
46
47
|
let make = () =>
|
|
@@ -7,6 +7,7 @@ import * as Orders$OrderingPlugin from "./Order/ReadModel/Orders.res.mjs";
|
|
|
7
7
|
import * as Customer$OrderingPlugin from "./Customer/Aggregate/Customer.res.mjs";
|
|
8
8
|
import * as Customers$OrderingPlugin from "./Customer/ReadModel/Customers.res.mjs";
|
|
9
9
|
import * as CatalogProduct$OrderingPlugin from "./CatalogProduct/Aggregate/CatalogProduct.res.mjs";
|
|
10
|
+
import * as LifecycleModel$OrderingPlugin from "./LifecycleModel.res.mjs";
|
|
10
11
|
import * as Order_Behavior$OrderingPlugin from "./Order/Aggregate/Order_Behavior.res.mjs";
|
|
11
12
|
import * as Order_Mappings$OrderingPlugin from "./Order/Aggregate/Order_Mappings.res.mjs";
|
|
12
13
|
import * as NoEventMappings$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/NoEventMappings.res.mjs";
|
|
@@ -238,7 +239,7 @@ function Make(Platform) {
|
|
|
238
239
|
"Orders",
|
|
239
240
|
"Order"
|
|
240
241
|
]
|
|
241
|
-
]));
|
|
242
|
+
]), LifecycleModel$OrderingPlugin.model);
|
|
242
243
|
let make = () => Platform.Plugin.make("Ordering", 5, [Orders_ExtensionPoint], [Products_Extension], [
|
|
243
244
|
CatalogProductAggregate,
|
|
244
245
|
CustomerAggregate,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1788762246366)
|
|
2
|
+
#Done(1788762252176)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/Customer.ast
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// AUTO-GENERATED — do not edit. Run `pnpm run check:lifecycle:update` to update.
|
|
2
|
+
//
|
|
3
|
+
// What ordering's own given/when/then scenarios say about each command: the
|
|
4
|
+
// states one shows it taking effect from, the states those land in, and whether
|
|
5
|
+
// it brings a row into existence. `Plugin_Structure` prefers this to the
|
|
6
|
+
// `@transition` annotation where it says anything, and falls back to the
|
|
7
|
+
// annotation where it is silent.
|
|
8
|
+
|
|
9
|
+
let model: array<Reventless.Plugin.derivedEdge> = [
|
|
10
|
+
{component: "Order", command: "Cancel", level: Reventless.Plugin.Instance, allowedStates: ["Placed"], targets: ["Cancelled"]},
|
|
11
|
+
{component: "Order", command: "Place", level: Reventless.Plugin.Collection, allowedStates: [], targets: ["Placed"]},
|
|
12
|
+
{component: "Order", command: "Refund", level: Reventless.Plugin.Instance, allowedStates: ["Cancelled"], targets: ["Refunded"]},
|
|
13
|
+
{component: "Order", command: "Ship", level: Reventless.Plugin.Instance, allowedStates: ["Placed"], targets: ["Shipped"]},
|
|
14
|
+
]
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/Order.ast
CHANGED
|
Binary file
|
package/lib/ocaml/Order.res
CHANGED
|
@@ -33,7 +33,10 @@ type lifecycleState = Orders.lifecycle
|
|
|
33
33
|
let commandTransition = (command: command): Reventless.Transition.t<lifecycleState> => {
|
|
34
34
|
open Reventless.Transition
|
|
35
35
|
switch command {
|
|
36
|
-
|
|
36
|
+
// Brings the row into existence, so there is no state it could come from.
|
|
37
|
+
// Not `Unrestricted`: the scenarios show it inert on an order already placed,
|
|
38
|
+
// shipped or cancelled, which is the opposite of legal in every state.
|
|
39
|
+
| Place(_) => Creates(Orders.Placed)
|
|
37
40
|
| Ship => Moves([Orders.Placed], Orders.Shipped)
|
|
38
41
|
| Cancel => Moves([Orders.Placed], Orders.Cancelled)
|
|
39
42
|
| Refund(_) => Moves([Orders.Cancelled], Orders.Refunded)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/Plugin.ast
CHANGED
|
Binary file
|
package/lib/ocaml/Plugin.res
CHANGED
|
@@ -41,6 +41,7 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
41
41
|
~extensions=[module(Products_Extension)],
|
|
42
42
|
~extensionPoints=[module(Orders_ExtensionPointMapping)],
|
|
43
43
|
~componentChapters=Dict.fromArray([("AvailableProducts", "CatalogProduct"), ("CatalogProduct", "CatalogProduct"), ("Customer", "Customer"), ("Customers", "Customer"), ("Order", "Order"), ("Orders", "Order")]),
|
|
44
|
+
~lifecycleModel=LifecycleModel.model,
|
|
44
45
|
)
|
|
45
46
|
|
|
46
47
|
let make = () =>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/online-shop-aggregates-ordering",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.235",
|
|
4
4
|
"description": "Online Shop example — Ordering plugin (Customer & Order aggregates)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"sury": "11.0.0-rc.2",
|
|
24
|
-
"@reventlessdev/online-shop-aggregates-catalog-spec": "3.0.0-alpha.
|
|
24
|
+
"@reventlessdev/online-shop-aggregates-catalog-spec": "3.0.0-alpha.129",
|
|
25
25
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
|
|
26
|
-
"@reventlessdev/online-shop-aggregates-ordering-spec": "3.0.0-alpha.
|
|
27
|
-
"@reventlessdev/reventless-
|
|
28
|
-
"@reventlessdev/reventless-
|
|
29
|
-
"@reventlessdev/reventless-local": "3.0.0-alpha.
|
|
30
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.
|
|
26
|
+
"@reventlessdev/online-shop-aggregates-ordering-spec": "3.0.0-alpha.129",
|
|
27
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.158",
|
|
28
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.204",
|
|
29
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.246",
|
|
30
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.130"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"rescript": "12.3.0",
|
|
34
34
|
"sury-ppx": "11.0.0-rc.2",
|
|
35
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
35
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.78"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"rescript": "12.3.0"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// AUTO-GENERATED — do not edit. Run `pnpm run check:lifecycle:update` to update.
|
|
2
|
+
//
|
|
3
|
+
// What ordering's own given/when/then scenarios say about each command: the
|
|
4
|
+
// states one shows it taking effect from, the states those land in, and whether
|
|
5
|
+
// it brings a row into existence. `Plugin_Structure` prefers this to the
|
|
6
|
+
// `@transition` annotation where it says anything, and falls back to the
|
|
7
|
+
// annotation where it is silent.
|
|
8
|
+
|
|
9
|
+
let model: array<Reventless.Plugin.derivedEdge> = [
|
|
10
|
+
{component: "Order", command: "Cancel", level: Reventless.Plugin.Instance, allowedStates: ["Placed"], targets: ["Cancelled"]},
|
|
11
|
+
{component: "Order", command: "Place", level: Reventless.Plugin.Collection, allowedStates: [], targets: ["Placed"]},
|
|
12
|
+
{component: "Order", command: "Refund", level: Reventless.Plugin.Instance, allowedStates: ["Cancelled"], targets: ["Refunded"]},
|
|
13
|
+
{component: "Order", command: "Ship", level: Reventless.Plugin.Instance, allowedStates: ["Placed"], targets: ["Shipped"]},
|
|
14
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
let model = [
|
|
5
|
+
{
|
|
6
|
+
component: "Order",
|
|
7
|
+
command: "Cancel",
|
|
8
|
+
level: "Instance",
|
|
9
|
+
allowedStates: ["Placed"],
|
|
10
|
+
targets: ["Cancelled"]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
component: "Order",
|
|
14
|
+
command: "Place",
|
|
15
|
+
level: "Collection",
|
|
16
|
+
allowedStates: [],
|
|
17
|
+
targets: ["Placed"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
component: "Order",
|
|
21
|
+
command: "Refund",
|
|
22
|
+
level: "Instance",
|
|
23
|
+
allowedStates: ["Cancelled"],
|
|
24
|
+
targets: ["Refunded"]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
component: "Order",
|
|
28
|
+
command: "Ship",
|
|
29
|
+
level: "Instance",
|
|
30
|
+
allowedStates: ["Placed"],
|
|
31
|
+
targets: ["Shipped"]
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
model,
|
|
37
|
+
}
|
|
38
|
+
/* No side effect */
|
|
@@ -33,7 +33,10 @@ type lifecycleState = Orders.lifecycle
|
|
|
33
33
|
let commandTransition = (command: command): Reventless.Transition.t<lifecycleState> => {
|
|
34
34
|
open Reventless.Transition
|
|
35
35
|
switch command {
|
|
36
|
-
|
|
36
|
+
// Brings the row into existence, so there is no state it could come from.
|
|
37
|
+
// Not `Unrestricted`: the scenarios show it inert on an order already placed,
|
|
38
|
+
// shipped or cancelled, which is the opposite of legal in every state.
|
|
39
|
+
| Place(_) => Creates(Orders.Placed)
|
|
37
40
|
| Ship => Moves([Orders.Placed], Orders.Shipped)
|
|
38
41
|
| Cancel => Moves([Orders.Placed], Orders.Cancelled)
|
|
39
42
|
| Refund(_) => Moves([Orders.Cancelled], Orders.Refunded)
|
package/src/Plugin.res
CHANGED
|
@@ -41,6 +41,7 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
41
41
|
~extensions=[module(Products_Extension)],
|
|
42
42
|
~extensionPoints=[module(Orders_ExtensionPointMapping)],
|
|
43
43
|
~componentChapters=Dict.fromArray([("AvailableProducts", "CatalogProduct"), ("CatalogProduct", "CatalogProduct"), ("Customer", "Customer"), ("Customers", "Customer"), ("Order", "Order"), ("Orders", "Order")]),
|
|
44
|
+
~lifecycleModel=LifecycleModel.model,
|
|
44
45
|
)
|
|
45
46
|
|
|
46
47
|
let make = () =>
|
package/src/Plugin.res.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import * as Orders$OrderingPlugin from "./Order/ReadModel/Orders.res.mjs";
|
|
|
7
7
|
import * as Customer$OrderingPlugin from "./Customer/Aggregate/Customer.res.mjs";
|
|
8
8
|
import * as Customers$OrderingPlugin from "./Customer/ReadModel/Customers.res.mjs";
|
|
9
9
|
import * as CatalogProduct$OrderingPlugin from "./CatalogProduct/Aggregate/CatalogProduct.res.mjs";
|
|
10
|
+
import * as LifecycleModel$OrderingPlugin from "./LifecycleModel.res.mjs";
|
|
10
11
|
import * as Order_Behavior$OrderingPlugin from "./Order/Aggregate/Order_Behavior.res.mjs";
|
|
11
12
|
import * as Order_Mappings$OrderingPlugin from "./Order/Aggregate/Order_Mappings.res.mjs";
|
|
12
13
|
import * as NoEventMappings$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/NoEventMappings.res.mjs";
|
|
@@ -238,7 +239,7 @@ function Make(Platform) {
|
|
|
238
239
|
"Orders",
|
|
239
240
|
"Order"
|
|
240
241
|
]
|
|
241
|
-
]));
|
|
242
|
+
]), LifecycleModel$OrderingPlugin.model);
|
|
242
243
|
let make = () => Platform.Plugin.make("Ordering", 5, [Orders_ExtensionPoint], [Products_Extension], [
|
|
243
244
|
CatalogProductAggregate,
|
|
244
245
|
CustomerAggregate,
|