@reventlessdev/online-shop-aggregates-catalog 3.0.0-alpha.279 → 3.0.0-alpha.281
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 +22 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/CatalogPlugin.cmi +0 -0
- package/lib/bs/CatalogPlugin.cmt +0 -0
- package/lib/bs/CatalogPlugin.mlmap +3 -3
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Category/Aggregate/{Category_Behavior-CatalogPlugin.cmi → Category_Decision-CatalogPlugin.cmi} +0 -0
- package/lib/{ocaml/Category_Behavior-CatalogPlugin.cmt → bs/src/Category/Aggregate/Category_Decision-CatalogPlugin.cmt} +0 -0
- package/lib/{ocaml/Category_Behavior.ast → bs/src/Category/Aggregate/Category_Decision.ast} +0 -0
- package/lib/bs/src/Category/Aggregate/{Category_Behavior.res → Category_Decision.res} +2 -2
- package/{src/Category/Aggregate/Category_Behavior.res.mjs → lib/bs/src/Category/Aggregate/Category_Decision.res.mjs} +1 -1
- package/lib/bs/src/Category/CategoryId-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/CategoryId-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/LifecycleModel-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/LifecycleModel-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Plugin-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Plugin.ast +0 -0
- package/lib/bs/src/Plugin.res +3 -3
- package/lib/bs/src/Plugin.res.mjs +16 -16
- package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Product/Aggregate/{Product_Behavior-CatalogPlugin.cmi → Product_Decision-CatalogPlugin.cmi} +0 -0
- package/lib/bs/src/Product/Aggregate/{Product_Behavior-CatalogPlugin.cmt → Product_Decision-CatalogPlugin.cmt} +0 -0
- package/lib/bs/src/Product/Aggregate/{Product_Behavior.ast → Product_Decision.ast} +0 -0
- package/{src/Product/Aggregate/Product_Behavior.res → lib/bs/src/Product/Aggregate/Product_Decision.res} +2 -2
- package/lib/bs/src/Product/Aggregate/{Product_Behavior.res.mjs → Product_Decision.res.mjs} +1 -1
- package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmt +0 -0
- package/lib/{ocaml/ProductDemand_Behavior-CatalogPlugin.cmi → bs/src/ProductDemand/Aggregate/ProductDemand_Decision-CatalogPlugin.cmi} +0 -0
- package/lib/{ocaml/ProductDemand_Behavior-CatalogPlugin.cmt → bs/src/ProductDemand/Aggregate/ProductDemand_Decision-CatalogPlugin.cmt} +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/{ProductDemand_Behavior.ast → ProductDemand_Decision.ast} +0 -0
- package/{src/ProductDemand/Aggregate/ProductDemand_Behavior.res → lib/bs/src/ProductDemand/Aggregate/ProductDemand_Decision.res} +2 -2
- package/lib/bs/src/ProductDemand/Aggregate/{ProductDemand_Behavior.res.mjs → ProductDemand_Decision.res.mjs} +1 -1
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT.ast +0 -0
- package/lib/bs/tests/Category/Aggregate/Category_GWT.res +3 -3
- package/lib/bs/tests/Category/Aggregate/Category_GWT.res.mjs +12 -12
- package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT.ast +0 -0
- package/lib/bs/tests/Product/Aggregate/Product_GWT.res +1 -1
- package/lib/bs/tests/Product/Aggregate/Product_GWT.res.mjs +11 -11
- package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.ast +0 -0
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +1 -1
- package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +10 -10
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/CatalogPlugin.cmi +0 -0
- package/lib/ocaml/CatalogPlugin.cmt +0 -0
- package/lib/ocaml/CatalogPlugin.mlmap +3 -3
- package/lib/ocaml/Categories-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Categories_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Categories_Projections-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories_Projections-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Category-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Category-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/CategoryId-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/CategoryId-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/{Category_Behavior-CatalogPlugin.cmi → Category_Decision-CatalogPlugin.cmi} +0 -0
- package/lib/{bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmt → ocaml/Category_Decision-CatalogPlugin.cmt} +0 -0
- package/lib/{bs/src/Category/Aggregate/Category_Behavior.ast → ocaml/Category_Decision.ast} +0 -0
- package/lib/ocaml/{Category_Behavior.res → Category_Decision.res} +2 -2
- package/lib/ocaml/Category_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Category_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Category_GWT.ast +0 -0
- package/lib/ocaml/Category_GWT.res +3 -3
- package/lib/ocaml/ImportProducts-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ImportProducts-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/LifecycleModel-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/LifecycleModel-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Orders_Extension-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Extension-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Plugin-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Plugin.ast +0 -0
- package/lib/ocaml/Plugin.res +3 -3
- package/lib/ocaml/Product-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Product-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemand-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand-CatalogPlugin.cmt +0 -0
- package/lib/{bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmi → ocaml/ProductDemand_Decision-CatalogPlugin.cmi} +0 -0
- package/lib/{bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmt → ocaml/ProductDemand_Decision-CatalogPlugin.cmt} +0 -0
- package/lib/ocaml/{ProductDemand_Behavior.ast → ProductDemand_Decision.ast} +0 -0
- package/lib/ocaml/{ProductDemand_Behavior.res → ProductDemand_Decision.res} +2 -2
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemand_GWT.ast +0 -0
- package/lib/ocaml/ProductDemand_GWT.res +1 -1
- package/lib/ocaml/ProductDemands-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/{Product_Behavior-CatalogPlugin.cmi → Product_Decision-CatalogPlugin.cmi} +0 -0
- package/lib/ocaml/{Product_Behavior-CatalogPlugin.cmt → Product_Decision-CatalogPlugin.cmt} +0 -0
- package/lib/ocaml/{Product_Behavior.ast → Product_Decision.ast} +0 -0
- package/lib/{bs/src/Product/Aggregate/Product_Behavior.res → ocaml/Product_Decision.res} +2 -2
- package/lib/ocaml/Product_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Product_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Product_GWT.ast +0 -0
- package/lib/ocaml/Product_GWT.res +1 -1
- package/lib/ocaml/Products-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_Projections-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_Projections-CatalogPlugin.cmt +0 -0
- package/package.json +7 -7
- package/src/Category/Aggregate/{Category_Behavior.res → Category_Decision.res} +2 -2
- package/{lib/bs/src/Category/Aggregate/Category_Behavior.res.mjs → src/Category/Aggregate/Category_Decision.res.mjs} +1 -1
- package/src/Plugin.res +3 -3
- package/src/Plugin.res.mjs +16 -16
- package/{lib/ocaml/Product_Behavior.res → src/Product/Aggregate/Product_Decision.res} +2 -2
- package/src/Product/Aggregate/{Product_Behavior.res.mjs → Product_Decision.res.mjs} +1 -1
- package/{lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior.res → src/ProductDemand/Aggregate/ProductDemand_Decision.res} +2 -2
- package/src/ProductDemand/Aggregate/{ProductDemand_Behavior.res.mjs → ProductDemand_Decision.res.mjs} +1 -1
- package/tests/Category/Aggregate/Category_GWT.res +3 -3
- package/tests/Category/Aggregate/Category_GWT.res.mjs +12 -12
- package/tests/Product/Aggregate/Product_GWT.res +1 -1
- package/tests/Product/Aggregate/Product_GWT.res.mjs +11 -11
- package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +1 -1
- package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +10 -10
- /package/lib/bs/src/Category/Aggregate/{Category_Behavior-CatalogPlugin.cmj → Category_Decision-CatalogPlugin.cmj} +0 -0
- /package/lib/bs/src/Product/Aggregate/{Product_Behavior-CatalogPlugin.cmj → Product_Decision-CatalogPlugin.cmj} +0 -0
- /package/lib/bs/src/ProductDemand/Aggregate/{ProductDemand_Behavior-CatalogPlugin.cmj → ProductDemand_Decision-CatalogPlugin.cmj} +0 -0
- /package/lib/ocaml/{Category_Behavior-CatalogPlugin.cmj → Category_Decision-CatalogPlugin.cmj} +0 -0
- /package/lib/ocaml/{ProductDemand_Behavior-CatalogPlugin.cmj → ProductDemand_Decision-CatalogPlugin.cmj} +0 -0
- /package/lib/ocaml/{Product_Behavior-CatalogPlugin.cmj → Product_Decision-CatalogPlugin.cmj} +0 -0
|
@@ -5,7 +5,7 @@ Categories_GWT
|
|
|
5
5
|
Categories_Projections
|
|
6
6
|
Category
|
|
7
7
|
CategoryId
|
|
8
|
-
|
|
8
|
+
Category_Decision
|
|
9
9
|
Category_GWT
|
|
10
10
|
ImportProducts
|
|
11
11
|
LifecycleModel
|
|
@@ -14,12 +14,12 @@ Orders_Extension_GWT
|
|
|
14
14
|
Plugin
|
|
15
15
|
Product
|
|
16
16
|
ProductDemand
|
|
17
|
-
|
|
17
|
+
ProductDemand_Decision
|
|
18
18
|
ProductDemand_GWT
|
|
19
19
|
ProductDemands
|
|
20
20
|
ProductDemands_GWT
|
|
21
21
|
ProductDemands_Projections
|
|
22
|
-
|
|
22
|
+
Product_Decision
|
|
23
23
|
Product_GWT
|
|
24
24
|
Products
|
|
25
25
|
Products_ExtensionPointMapping
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/{Category_Behavior-CatalogPlugin.cmi → Category_Decision-CatalogPlugin.cmi}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
open Catalog_Examples
|
|
4
4
|
|
|
5
|
-
describe("Category
|
|
5
|
+
describe("Category Decision", () => {
|
|
6
6
|
// scenario-id: fb4b109a-87b5-4aa3-a8e2-4fca61d0c050
|
|
7
7
|
test("Add on new aggregate produces Added", () =>
|
|
8
8
|
givenEvents([])
|
|
@@ -74,7 +74,7 @@ describe("Who may Archive", () => {
|
|
|
74
74
|
givenEvents([Added({name: electronics})])
|
|
75
75
|
->asCaller(Caller.owner(shopper))
|
|
76
76
|
->whenCmd(Archive)
|
|
77
|
-
->
|
|
77
|
+
->thenForbidden
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
// scenario-id: c4c8e733-7e07-4f3c-b3f2-01bc6b52f601
|
|
@@ -82,6 +82,6 @@ describe("Who may Archive", () => {
|
|
|
82
82
|
givenEvents([Added({name: electronics})])
|
|
83
83
|
->asCaller(Caller.anonymous)
|
|
84
84
|
->whenCmd(Archive)
|
|
85
|
-
->
|
|
85
|
+
->thenForbidden
|
|
86
86
|
)
|
|
87
87
|
})
|
|
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
|
@@ -6,17 +6,17 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
6
6
|
// Aggregates
|
|
7
7
|
module CategoryAggregate = Platform.Aggregate.Make(
|
|
8
8
|
Category,
|
|
9
|
-
|
|
9
|
+
Category_Decision,
|
|
10
10
|
ReventlessInfra.NoEventMappings.Make(Category),
|
|
11
11
|
)
|
|
12
12
|
module ProductAggregate = Platform.Aggregate.Make(
|
|
13
13
|
Product,
|
|
14
|
-
|
|
14
|
+
Product_Decision,
|
|
15
15
|
ReventlessInfra.NoEventMappings.Make(Product),
|
|
16
16
|
)
|
|
17
17
|
module ProductDemandAggregate = Platform.Aggregate.Make(
|
|
18
18
|
ProductDemand,
|
|
19
|
-
|
|
19
|
+
ProductDemand_Decision,
|
|
20
20
|
ReventlessInfra.NoEventMappings.Make(ProductDemand),
|
|
21
21
|
)
|
|
22
22
|
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Product aggregate
|
|
1
|
+
// Product aggregate decision.
|
|
2
2
|
// Implements the state machine for adding and updating products.
|
|
3
3
|
//
|
|
4
4
|
// Snapshotting is enabled (every 50 events): a long-lived product with many
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// folding full history. See the "Replay cost and snapshots" section of the
|
|
7
7
|
// aggregate component docs.
|
|
8
8
|
|
|
9
|
-
@@reventless.
|
|
9
|
+
@@reventless.decision
|
|
10
10
|
@@reventless.snapshots(50)
|
|
11
11
|
|
|
12
12
|
@schema
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -9,7 +9,7 @@ let added = Added({
|
|
|
9
9
|
imageUrl: "/productImages/laptop.jpg",
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
describe("Product
|
|
12
|
+
describe("Product Decision", () => {
|
|
13
13
|
// scenario-id: 6126c93a-ba4e-4ce0-8d8e-654cf64cd8ba
|
|
14
14
|
test("Add on new aggregate produces Added", () =>
|
|
15
15
|
givenEvents([])
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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-catalog",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.281",
|
|
4
4
|
"description": "Online Shop example — Catalog plugin (Product & Category aggregates)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"sury": "11.0.0",
|
|
24
|
-
"@reventlessdev/online-shop-aggregates-catalog-spec": "3.0.0-alpha.
|
|
24
|
+
"@reventlessdev/online-shop-aggregates-catalog-spec": "3.0.0-alpha.169",
|
|
25
25
|
"@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
|
|
26
|
-
"@reventlessdev/
|
|
27
|
-
"@reventlessdev/reventless-
|
|
28
|
-
"@reventlessdev/
|
|
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.169",
|
|
27
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.249",
|
|
28
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.198",
|
|
29
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.292",
|
|
30
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.170"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"rescript": "12.3.1",
|
|
@@ -93,7 +93,7 @@ let Spec;
|
|
|
93
93
|
|
|
94
94
|
let initialState = "NotCreated";
|
|
95
95
|
|
|
96
|
-
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Category/Aggregate/
|
|
96
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Category/Aggregate/Category_Decision.res.mjs";
|
|
97
97
|
|
|
98
98
|
let snapshot;
|
|
99
99
|
|
package/src/Plugin.res
CHANGED
|
@@ -6,17 +6,17 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
6
6
|
// Aggregates
|
|
7
7
|
module CategoryAggregate = Platform.Aggregate.Make(
|
|
8
8
|
Category,
|
|
9
|
-
|
|
9
|
+
Category_Decision,
|
|
10
10
|
ReventlessInfra.NoEventMappings.Make(Category),
|
|
11
11
|
)
|
|
12
12
|
module ProductAggregate = Platform.Aggregate.Make(
|
|
13
13
|
Product,
|
|
14
|
-
|
|
14
|
+
Product_Decision,
|
|
15
15
|
ReventlessInfra.NoEventMappings.Make(Product),
|
|
16
16
|
)
|
|
17
17
|
module ProductDemandAggregate = Platform.Aggregate.Make(
|
|
18
18
|
ProductDemand,
|
|
19
|
-
|
|
19
|
+
ProductDemand_Decision,
|
|
20
20
|
ReventlessInfra.NoEventMappings.Make(ProductDemand),
|
|
21
21
|
)
|
|
22
22
|
|
package/src/Plugin.res.mjs
CHANGED
|
@@ -12,14 +12,14 @@ import * as ImportProducts$CatalogPlugin from "./Task/ImportProducts.res.mjs";
|
|
|
12
12
|
import * as LifecycleModel$CatalogPlugin from "./LifecycleModel.res.mjs";
|
|
13
13
|
import * as ProductDemands$CatalogPlugin from "./ProductDemand/ReadModel/ProductDemands.res.mjs";
|
|
14
14
|
import * as Orders_Extension$CatalogPlugin from "./Extension/Orders_Extension.res.mjs";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
15
|
+
import * as Product_Decision$CatalogPlugin from "./Product/Aggregate/Product_Decision.res.mjs";
|
|
16
|
+
import * as Category_Decision$CatalogPlugin from "./Category/Aggregate/Category_Decision.res.mjs";
|
|
17
17
|
import * as NoEventMappings$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/NoEventMappings.res.mjs";
|
|
18
18
|
import * as Orders_ExtensionPoint$OrderingSpec from "@reventlessdev/online-shop-aggregates-ordering-spec/src/Orders_ExtensionPoint.res.mjs";
|
|
19
19
|
import * as Products_Projections$CatalogPlugin from "./Product/ReadModel/Products_Projections.res.mjs";
|
|
20
20
|
import * as Products_ExtensionPoint$CatalogSpec from "@reventlessdev/online-shop-aggregates-catalog-spec/src/Products_ExtensionPoint.res.mjs";
|
|
21
21
|
import * as Categories_Projections$CatalogPlugin from "./Category/ReadModel/Categories_Projections.res.mjs";
|
|
22
|
-
import * as
|
|
22
|
+
import * as ProductDemand_Decision$CatalogPlugin from "./ProductDemand/Aggregate/ProductDemand_Decision.res.mjs";
|
|
23
23
|
import * as ProductDemands_Projections$CatalogPlugin from "./ProductDemand/ReadModel/ProductDemands_Projections.res.mjs";
|
|
24
24
|
import * as Products_ExtensionPointMapping$CatalogPlugin from "./ExtensionPoint/Products_ExtensionPointMapping.res.mjs";
|
|
25
25
|
|
|
@@ -35,11 +35,11 @@ function Make(Platform) {
|
|
|
35
35
|
commandTransition: Category$CatalogPlugin.commandTransition,
|
|
36
36
|
traits: Category$CatalogPlugin.traits
|
|
37
37
|
})({
|
|
38
|
-
initialState:
|
|
39
|
-
evolve:
|
|
40
|
-
decide:
|
|
38
|
+
initialState: Category_Decision$CatalogPlugin.initialState,
|
|
39
|
+
evolve: Category_Decision$CatalogPlugin.evolve,
|
|
40
|
+
decide: Category_Decision$CatalogPlugin.decide,
|
|
41
41
|
snapshot: undefined,
|
|
42
|
-
moduleUrl:
|
|
42
|
+
moduleUrl: Category_Decision$CatalogPlugin.moduleUrl
|
|
43
43
|
})(NoEventMappings$ReventlessInfra.Make({
|
|
44
44
|
name: Category$CatalogPlugin.name,
|
|
45
45
|
Id: CategoryId$CatalogPlugin,
|
|
@@ -56,11 +56,11 @@ function Make(Platform) {
|
|
|
56
56
|
commandTransition: Product$CatalogPlugin.commandTransition,
|
|
57
57
|
traits: Product$CatalogPlugin.traits
|
|
58
58
|
})({
|
|
59
|
-
initialState:
|
|
60
|
-
evolve:
|
|
61
|
-
decide:
|
|
62
|
-
snapshot:
|
|
63
|
-
moduleUrl:
|
|
59
|
+
initialState: Product_Decision$CatalogPlugin.initialState,
|
|
60
|
+
evolve: Product_Decision$CatalogPlugin.evolve,
|
|
61
|
+
decide: Product_Decision$CatalogPlugin.decide,
|
|
62
|
+
snapshot: Product_Decision$CatalogPlugin.snapshot,
|
|
63
|
+
moduleUrl: Product_Decision$CatalogPlugin.moduleUrl
|
|
64
64
|
})(NoEventMappings$ReventlessInfra.Make({
|
|
65
65
|
name: Product$CatalogPlugin.name,
|
|
66
66
|
Id: ProductId$CatalogSpec,
|
|
@@ -77,11 +77,11 @@ function Make(Platform) {
|
|
|
77
77
|
commandTransition: ProductDemand$CatalogPlugin.commandTransition,
|
|
78
78
|
traits: ProductDemand$CatalogPlugin.traits
|
|
79
79
|
})({
|
|
80
|
-
initialState:
|
|
81
|
-
evolve:
|
|
82
|
-
decide:
|
|
80
|
+
initialState: ProductDemand_Decision$CatalogPlugin.initialState,
|
|
81
|
+
evolve: ProductDemand_Decision$CatalogPlugin.evolve,
|
|
82
|
+
decide: ProductDemand_Decision$CatalogPlugin.decide,
|
|
83
83
|
snapshot: undefined,
|
|
84
|
-
moduleUrl:
|
|
84
|
+
moduleUrl: ProductDemand_Decision$CatalogPlugin.moduleUrl
|
|
85
85
|
})(NoEventMappings$ReventlessInfra.Make({
|
|
86
86
|
name: ProductDemand$CatalogPlugin.name,
|
|
87
87
|
Id: ProductId$CatalogSpec,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Product aggregate
|
|
1
|
+
// Product aggregate decision.
|
|
2
2
|
// Implements the state machine for adding and updating products.
|
|
3
3
|
//
|
|
4
4
|
// Snapshotting is enabled (every 50 events): a long-lived product with many
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// folding full history. See the "Replay cost and snapshots" section of the
|
|
7
7
|
// aggregate component docs.
|
|
8
8
|
|
|
9
|
-
@@reventless.
|
|
9
|
+
@@reventless.decision
|
|
10
10
|
@@reventless.snapshots(50)
|
|
11
11
|
|
|
12
12
|
@schema
|
|
@@ -173,7 +173,7 @@ let Spec;
|
|
|
173
173
|
|
|
174
174
|
let initialState = "NotCreated";
|
|
175
175
|
|
|
176
|
-
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Product/Aggregate/
|
|
176
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/Product/Aggregate/Product_Decision.res.mjs";
|
|
177
177
|
|
|
178
178
|
export {
|
|
179
179
|
Spec,
|
|
@@ -89,7 +89,7 @@ let Spec;
|
|
|
89
89
|
|
|
90
90
|
let initialState = "NotCreated";
|
|
91
91
|
|
|
92
|
-
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/ProductDemand/Aggregate/
|
|
92
|
+
let moduleUrl = "@reventlessdev/online-shop-aggregates-catalog/src/ProductDemand/Aggregate/ProductDemand_Decision.res.mjs";
|
|
93
93
|
|
|
94
94
|
let snapshot;
|
|
95
95
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
open Catalog_Examples
|
|
4
4
|
|
|
5
|
-
describe("Category
|
|
5
|
+
describe("Category Decision", () => {
|
|
6
6
|
// scenario-id: fb4b109a-87b5-4aa3-a8e2-4fca61d0c050
|
|
7
7
|
test("Add on new aggregate produces Added", () =>
|
|
8
8
|
givenEvents([])
|
|
@@ -74,7 +74,7 @@ describe("Who may Archive", () => {
|
|
|
74
74
|
givenEvents([Added({name: electronics})])
|
|
75
75
|
->asCaller(Caller.owner(shopper))
|
|
76
76
|
->whenCmd(Archive)
|
|
77
|
-
->
|
|
77
|
+
->thenForbidden
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
// scenario-id: c4c8e733-7e07-4f3c-b3f2-01bc6b52f601
|
|
@@ -82,6 +82,6 @@ describe("Who may Archive", () => {
|
|
|
82
82
|
givenEvents([Added({name: electronics})])
|
|
83
83
|
->asCaller(Caller.anonymous)
|
|
84
84
|
->whenCmd(Archive)
|
|
85
|
-
->
|
|
85
|
+
->thenForbidden
|
|
86
86
|
)
|
|
87
87
|
})
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
3
|
import * as Category$CatalogPlugin from "../../../src/Category/Aggregate/Category.res.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as Decision_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Decision_GWT.res.mjs";
|
|
5
5
|
import * as Catalog_Examples$CatalogPlugin from "../../Catalog_Examples.res.mjs";
|
|
6
|
-
import * as
|
|
6
|
+
import * as Category_Decision$CatalogPlugin from "../../../src/Category/Aggregate/Category_Decision.res.mjs";
|
|
7
7
|
|
|
8
|
-
let include =
|
|
8
|
+
let include = Decision_GWT$ReventlessGwt.MakeFromAggregate({
|
|
9
9
|
name: Category$CatalogPlugin.name,
|
|
10
10
|
commandSchema: Category$CatalogPlugin.commandSchema,
|
|
11
11
|
eventSchema: Category$CatalogPlugin.eventSchema,
|
|
@@ -19,11 +19,11 @@ let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
|
|
|
19
19
|
errorSchema: Category$CatalogPlugin.errorSchema,
|
|
20
20
|
authorizationOf: Category$CatalogPlugin.authorizationOf
|
|
21
21
|
},
|
|
22
|
-
initialState:
|
|
23
|
-
evolve:
|
|
24
|
-
decide:
|
|
22
|
+
initialState: Category_Decision$CatalogPlugin.initialState,
|
|
23
|
+
evolve: Category_Decision$CatalogPlugin.evolve,
|
|
24
|
+
decide: Category_Decision$CatalogPlugin.decide,
|
|
25
25
|
snapshot: undefined,
|
|
26
|
-
moduleUrl:
|
|
26
|
+
moduleUrl: Category_Decision$CatalogPlugin.moduleUrl
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
let describe = include.describe;
|
|
@@ -44,9 +44,9 @@ let thenNoEvent = include.thenNoEvent;
|
|
|
44
44
|
|
|
45
45
|
let thenError = include.thenError;
|
|
46
46
|
|
|
47
|
-
let
|
|
47
|
+
let thenForbidden = include.thenForbidden;
|
|
48
48
|
|
|
49
|
-
describe("Category
|
|
49
|
+
describe("Category Decision", () => {
|
|
50
50
|
test("Add on new aggregate produces Added", () => thenEvent(whenCmd(givenEvents([]), {
|
|
51
51
|
TAG: "Add",
|
|
52
52
|
name: Catalog_Examples$CatalogPlugin.electronics
|
|
@@ -110,11 +110,11 @@ describe("Who may Archive", () => {
|
|
|
110
110
|
TAG: "Added",
|
|
111
111
|
name: Catalog_Examples$CatalogPlugin.electronics
|
|
112
112
|
}]), Caller.inRoles(["Admin"])), "Archive"), "Archived"));
|
|
113
|
-
test("a shopper may not archive a category", () =>
|
|
113
|
+
test("a shopper may not archive a category", () => thenForbidden(whenCmd(asCaller(givenEvents([{
|
|
114
114
|
TAG: "Added",
|
|
115
115
|
name: Catalog_Examples$CatalogPlugin.electronics
|
|
116
116
|
}]), Caller.owner(Catalog_Examples$CatalogPlugin.shopper, undefined)), "Archive")));
|
|
117
|
-
test("an anonymous caller may not archive a category", () =>
|
|
117
|
+
test("an anonymous caller may not archive a category", () => thenForbidden(whenCmd(asCaller(givenEvents([{
|
|
118
118
|
TAG: "Added",
|
|
119
119
|
name: Catalog_Examples$CatalogPlugin.electronics
|
|
120
120
|
}]), Caller.anonymous), "Archive")));
|
|
@@ -148,6 +148,6 @@ export {
|
|
|
148
148
|
thenCompareEvents,
|
|
149
149
|
thenEventsWithError,
|
|
150
150
|
thenError,
|
|
151
|
-
|
|
151
|
+
thenForbidden,
|
|
152
152
|
}
|
|
153
153
|
/* include Not a pure module */
|
|
@@ -9,7 +9,7 @@ let added = Added({
|
|
|
9
9
|
imageUrl: "/productImages/laptop.jpg",
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
describe("Product
|
|
12
|
+
describe("Product Decision", () => {
|
|
13
13
|
// scenario-id: 6126c93a-ba4e-4ce0-8d8e-654cf64cd8ba
|
|
14
14
|
test("Add on new aggregate produces Added", () =>
|
|
15
15
|
givenEvents([])
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
3
|
import * as Product$CatalogPlugin from "../../../src/Product/Aggregate/Product.res.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as Decision_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Decision_GWT.res.mjs";
|
|
5
5
|
import * as Catalog_Examples$CatalogPlugin from "../../Catalog_Examples.res.mjs";
|
|
6
|
-
import * as
|
|
6
|
+
import * as Product_Decision$CatalogPlugin from "../../../src/Product/Aggregate/Product_Decision.res.mjs";
|
|
7
7
|
|
|
8
|
-
let include =
|
|
8
|
+
let include = Decision_GWT$ReventlessGwt.MakeFromAggregate({
|
|
9
9
|
name: Product$CatalogPlugin.name,
|
|
10
10
|
commandSchema: Product$CatalogPlugin.commandSchema,
|
|
11
11
|
eventSchema: Product$CatalogPlugin.eventSchema,
|
|
@@ -19,11 +19,11 @@ let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
|
|
|
19
19
|
errorSchema: Product$CatalogPlugin.errorSchema,
|
|
20
20
|
authorizationOf: Product$CatalogPlugin.authorizationOf
|
|
21
21
|
},
|
|
22
|
-
initialState:
|
|
23
|
-
evolve:
|
|
24
|
-
decide:
|
|
25
|
-
snapshot:
|
|
26
|
-
moduleUrl:
|
|
22
|
+
initialState: Product_Decision$CatalogPlugin.initialState,
|
|
23
|
+
evolve: Product_Decision$CatalogPlugin.evolve,
|
|
24
|
+
decide: Product_Decision$CatalogPlugin.decide,
|
|
25
|
+
snapshot: Product_Decision$CatalogPlugin.snapshot,
|
|
26
|
+
moduleUrl: Product_Decision$CatalogPlugin.moduleUrl
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
let describe = include.describe;
|
|
@@ -48,7 +48,7 @@ let added = {
|
|
|
48
48
|
imageUrl: "/productImages/laptop.jpg"
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
describe("Product
|
|
51
|
+
describe("Product Decision", () => {
|
|
52
52
|
test("Add on new aggregate produces Added", () => thenEvent(whenCmd(givenEvents([]), {
|
|
53
53
|
TAG: "Add",
|
|
54
54
|
name: Catalog_Examples$CatalogPlugin.laptop,
|
|
@@ -141,7 +141,7 @@ let thenCompareEvents = include.thenCompareEvents;
|
|
|
141
141
|
|
|
142
142
|
let thenEventsWithError = include.thenEventsWithError;
|
|
143
143
|
|
|
144
|
-
let
|
|
144
|
+
let thenForbidden = include.thenForbidden;
|
|
145
145
|
|
|
146
146
|
export {
|
|
147
147
|
Spec,
|
|
@@ -159,7 +159,7 @@ export {
|
|
|
159
159
|
thenCompareEvents,
|
|
160
160
|
thenEventsWithError,
|
|
161
161
|
thenError,
|
|
162
|
-
|
|
162
|
+
thenForbidden,
|
|
163
163
|
added,
|
|
164
164
|
}
|
|
165
165
|
/* include Not a pure module */
|