@reventlessdev/online-shop-aggregates-catalog 3.0.0-alpha.237 → 3.0.0-alpha.239
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/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 +0 -0
- package/lib/bs/src/Category/Aggregate/Category_Behavior-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.res +0 -1
- 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/ExtensionPoint/Products_ExtensionPointMapping.ast +0 -0
- package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.res +17 -10
- package/lib/bs/src/LifecycleModel-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/LifecycleModel-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/LifecycleModel.ast +0 -0
- package/lib/bs/src/LifecycleModel.res +1 -2
- 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 +33 -7
- 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 +0 -0
- package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmt +0 -0
- 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.res +0 -1
- 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/Product/ReadModel/Products_Projections.ast +0 -0
- package/lib/bs/src/Product/ReadModel/Products_Projections.res +2 -3
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
- 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.res +0 -1
- 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/ProductDemand/ReadModel/ProductDemands_Projections.ast +0 -0
- package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.res +5 -3
- 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/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/ExtensionPoint/Products_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +6 -1
- 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/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/ReadModel/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.ast +0 -0
- package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +32 -4
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/Categories-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Categories.res +0 -1
- 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/Category_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Category_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Category_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Category_GWT-CatalogPlugin.cmt +0 -0
- 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/LifecycleModel.ast +0 -0
- package/lib/ocaml/LifecycleModel.res +1 -2
- 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 +33 -7
- 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/ocaml/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands.res +0 -1
- package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands_GWT.ast +0 -0
- package/lib/ocaml/ProductDemands_GWT.res +32 -4
- package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemands_Projections.ast +0 -0
- package/lib/ocaml/ProductDemands_Projections.res +5 -3
- package/lib/ocaml/Product_Behavior-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Product_Behavior-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Product_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Product_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products.res +0 -1
- package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping.ast +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping.res +17 -10
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT.res +6 -1
- 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/lib/ocaml/Products_Projections.ast +0 -0
- package/lib/ocaml/Products_Projections.res +2 -3
- package/package.json +8 -8
- package/src/Category/ReadModel/Categories.res +0 -1
- package/src/ExtensionPoint/Products_ExtensionPointMapping.res +17 -10
- package/src/LifecycleModel.res +1 -2
- package/src/Plugin.res +33 -7
- package/src/Product/ReadModel/Products.res +0 -1
- package/src/Product/ReadModel/Products_Projections.res +2 -3
- package/src/ProductDemand/ReadModel/ProductDemands.res +0 -1
- package/src/ProductDemand/ReadModel/ProductDemands_Projections.res +5 -3
- package/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +6 -1
- package/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +32 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.239 (2026-09-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/online-shop-aggregates-catalog
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 3.0.0-alpha.238 (2026-09-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/online-shop-aggregates-catalog
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# 3.0.0-alpha.237 (2026-09-08)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @reventlessdev/online-shop-aggregates-catalog
|
package/lib/bs/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1789087727040)
|
|
2
|
+
#Done(1789087733109)
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"bsc_hash": "75e3a59c95cc953608fd3dd6ea6ed68141bba4414a20a52f114261b8a48385fa",
|
|
5
5
|
"rescript_config_hash": "50d5358a2cbe328e82ae9b442e4615b86dbfe6b2ce05e9eca04a0c78da0e4708",
|
|
6
6
|
"runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
|
|
7
|
-
"generated_at": "
|
|
7
|
+
"generated_at": "1789087733117"
|
|
8
8
|
}
|
|
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
|
|
@@ -6,14 +6,21 @@ module Delegate = Product
|
|
|
6
6
|
|
|
7
7
|
let mapIncomingCommand = (_id, _command, _meta) => []
|
|
8
8
|
|
|
9
|
-
let mapOutgoingEvent = Some(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
let mapOutgoingEvent = Some(
|
|
10
|
+
(id, event, _meta, _queryEngine) =>
|
|
11
|
+
switch event {
|
|
12
|
+
| Product.Added({name, price}) => [
|
|
13
|
+
PublishEvent(
|
|
14
|
+
id,
|
|
15
|
+
CatalogSpec.Products_ExtensionPoint.ProductBecameAvailable({productId: id, name, price}),
|
|
16
|
+
),
|
|
17
|
+
]
|
|
18
|
+
| Product.PriceUpdated({price}) => [
|
|
19
|
+
PublishEvent(
|
|
20
|
+
id,
|
|
21
|
+
CatalogSpec.Products_ExtensionPoint.ProductPriceChanged({productId: id, price}),
|
|
22
|
+
),
|
|
23
|
+
]
|
|
24
|
+
| _ => []
|
|
25
|
+
},
|
|
19
26
|
)
|
|
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
|
@@ -22,7 +22,10 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
22
22
|
|
|
23
23
|
// ReadModels
|
|
24
24
|
module CategoriesReadModel = Platform.ReadModel.Make(Categories, Categories_Projections)
|
|
25
|
-
module ProductDemandsReadModel = Platform.ReadModel.Make(
|
|
25
|
+
module ProductDemandsReadModel = Platform.ReadModel.Make(
|
|
26
|
+
ProductDemands,
|
|
27
|
+
ProductDemands_Projections,
|
|
28
|
+
)
|
|
26
29
|
module ProductsReadModel = Platform.ReadModel.Make(Products, Products_Projections)
|
|
27
30
|
|
|
28
31
|
// Tasks
|
|
@@ -36,11 +39,26 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
36
39
|
|
|
37
40
|
let pluginStructure = Platform.Plugin.makePluginDefinition(
|
|
38
41
|
~name="Catalog",
|
|
39
|
-
~aggregates=[
|
|
40
|
-
|
|
42
|
+
~aggregates=[
|
|
43
|
+
module(CategoryAggregate),
|
|
44
|
+
module(ProductAggregate),
|
|
45
|
+
module(ProductDemandAggregate),
|
|
46
|
+
],
|
|
47
|
+
~readModels=[
|
|
48
|
+
module(CategoriesReadModel),
|
|
49
|
+
module(ProductDemandsReadModel),
|
|
50
|
+
module(ProductsReadModel),
|
|
51
|
+
],
|
|
41
52
|
~extensions=[module(Orders_Extension)],
|
|
42
53
|
~extensionPoints=[module(Products_ExtensionPointMapping)],
|
|
43
|
-
~componentChapters=Dict.fromArray([
|
|
54
|
+
~componentChapters=Dict.fromArray([
|
|
55
|
+
("Categories", "Category"),
|
|
56
|
+
("Category", "Category"),
|
|
57
|
+
("Product", "Product"),
|
|
58
|
+
("ProductDemand", "ProductDemand"),
|
|
59
|
+
("ProductDemands", "ProductDemand"),
|
|
60
|
+
("Products", "Product"),
|
|
61
|
+
]),
|
|
44
62
|
~lifecycleModel=LifecycleModel.model,
|
|
45
63
|
)
|
|
46
64
|
|
|
@@ -50,10 +68,18 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
50
68
|
~heartbeatInterval=5,
|
|
51
69
|
~extensionPoints=[module(Products_ExtensionPoint)],
|
|
52
70
|
~extensions=[module(Orders_Extension)],
|
|
53
|
-
~aggregates=[
|
|
54
|
-
|
|
71
|
+
~aggregates=[
|
|
72
|
+
module(CategoryAggregate),
|
|
73
|
+
module(ProductAggregate),
|
|
74
|
+
module(ProductDemandAggregate),
|
|
75
|
+
],
|
|
76
|
+
~readModels=[
|
|
77
|
+
module(CategoriesReadModel),
|
|
78
|
+
module(ProductDemandsReadModel),
|
|
79
|
+
module(ProductsReadModel),
|
|
80
|
+
],
|
|
55
81
|
~tasks=[module(ImportProductsTask)],
|
|
56
|
-
~pluginStructure
|
|
82
|
+
~pluginStructure,
|
|
57
83
|
~uiFragments=?uiBundleUrl->Option.map(url =>
|
|
58
84
|
Platform.Plugin.makeAutoUIManifest(
|
|
59
85
|
~remoteEntryUrl=url,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -10,10 +10,9 @@ module ProductMapping = Mapping.Make(
|
|
|
10
10
|
let project = ({event, id, _}) =>
|
|
11
11
|
switch event {
|
|
12
12
|
| Added({name, description, price, imageUrl}) =>
|
|
13
|
-
Set(id, {Products.name
|
|
13
|
+
Set(id, {Products.name, description, price, imageUrl})
|
|
14
14
|
| NameUpdated({name}) => Update(id, state => {...state, name})
|
|
15
|
-
| DescriptionUpdated({description}) =>
|
|
16
|
-
Update(id, state => {...state, description})
|
|
15
|
+
| DescriptionUpdated({description}) => Update(id, state => {...state, description})
|
|
17
16
|
| PriceUpdated({price}) => Update(id, state => {...state, price})
|
|
18
17
|
| ImageUpdated({imageUrl}) => Update(id, state => {...state, imageUrl})
|
|
19
18
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,8 +11,7 @@ module ProductMapping = Mapping.Make(
|
|
|
11
11
|
open Product
|
|
12
12
|
let project = ({event, id, _}) =>
|
|
13
13
|
switch event {
|
|
14
|
-
| Added({name}) =>
|
|
15
|
-
Set(id, {ProductDemands.name: name, orderCount: 0})
|
|
14
|
+
| Added({name}) => Set(id, {ProductDemands.name, orderCount: 0})
|
|
16
15
|
| _ => Ignore
|
|
17
16
|
}
|
|
18
17
|
},
|
|
@@ -28,7 +27,10 @@ module ProductDemandMapping = Mapping.Make(
|
|
|
28
27
|
| Recorded(_) =>
|
|
29
28
|
Update(id, (state: ProductDemands.state) => {...state, orderCount: state.orderCount + 1})
|
|
30
29
|
| Revoked(_) =>
|
|
31
|
-
Update(
|
|
30
|
+
Update(
|
|
31
|
+
id,
|
|
32
|
+
(state: ProductDemands.state) => {...state, orderCount: max(0, state.orderCount - 1)},
|
|
33
|
+
)
|
|
32
34
|
}
|
|
33
35
|
},
|
|
34
36
|
)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
describe("Products ExtensionPoint mapping", () => {
|
|
6
6
|
test("Added publishes ProductBecameAvailable", () =>
|
|
7
7
|
whenDelegateEvent(
|
|
8
|
-
Delegate.Added({
|
|
8
|
+
Delegate.Added({
|
|
9
|
+
name: "Book",
|
|
10
|
+
description: "A good book",
|
|
11
|
+
price: 9.99,
|
|
12
|
+
imageUrl: "/productImages/book.jpg",
|
|
13
|
+
}),
|
|
9
14
|
)->thenPublishesEvent(
|
|
10
15
|
"gwt-id",
|
|
11
16
|
ExtensionPoint.ProductBecameAvailable({productId: "gwt-id", name: "Book", price: 9.99}),
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -12,24 +12,52 @@ module ProductDemandGwt = ReventlessGwt.MultiSourceProjection_GWT.Make(
|
|
|
12
12
|
ProductGwt.describe("ProductDemands ReadModel ← Product", () => {
|
|
13
13
|
ProductGwt.test("Added initialises the entry with orderCount = 0", () =>
|
|
14
14
|
ProductGwt.givenEvents([])
|
|
15
|
-
->ProductGwt.whenEvent(
|
|
15
|
+
->ProductGwt.whenEvent(
|
|
16
|
+
Product.Added({
|
|
17
|
+
name: "Laptop",
|
|
18
|
+
description: "x",
|
|
19
|
+
price: 1.0,
|
|
20
|
+
imageUrl: "/productImages/laptop.jpg",
|
|
21
|
+
}),
|
|
22
|
+
)
|
|
16
23
|
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
17
24
|
)
|
|
18
25
|
|
|
19
26
|
ProductGwt.test("NameUpdated is ignored (handled by Products read model)", () =>
|
|
20
|
-
ProductGwt.givenEvents([
|
|
27
|
+
ProductGwt.givenEvents([
|
|
28
|
+
Product.Added({
|
|
29
|
+
name: "Laptop",
|
|
30
|
+
description: "x",
|
|
31
|
+
price: 1.0,
|
|
32
|
+
imageUrl: "/productImages/laptop.jpg",
|
|
33
|
+
}),
|
|
34
|
+
])
|
|
21
35
|
->ProductGwt.whenEvent(Product.NameUpdated({name: "Gaming Laptop"}))
|
|
22
36
|
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
23
37
|
)
|
|
24
38
|
|
|
25
39
|
ProductGwt.test("DescriptionUpdated is ignored", () =>
|
|
26
|
-
ProductGwt.givenEvents([
|
|
40
|
+
ProductGwt.givenEvents([
|
|
41
|
+
Product.Added({
|
|
42
|
+
name: "Laptop",
|
|
43
|
+
description: "x",
|
|
44
|
+
price: 1.0,
|
|
45
|
+
imageUrl: "/productImages/laptop.jpg",
|
|
46
|
+
}),
|
|
47
|
+
])
|
|
27
48
|
->ProductGwt.whenEvent(Product.DescriptionUpdated({description: "y"}))
|
|
28
49
|
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
29
50
|
)
|
|
30
51
|
|
|
31
52
|
ProductGwt.test("PriceUpdated is ignored", () =>
|
|
32
|
-
ProductGwt.givenEvents([
|
|
53
|
+
ProductGwt.givenEvents([
|
|
54
|
+
Product.Added({
|
|
55
|
+
name: "Laptop",
|
|
56
|
+
description: "x",
|
|
57
|
+
price: 1.0,
|
|
58
|
+
imageUrl: "/productImages/laptop.jpg",
|
|
59
|
+
}),
|
|
60
|
+
])
|
|
33
61
|
->ProductGwt.whenEvent(Product.PriceUpdated({price: 2.0}))
|
|
34
62
|
->ProductGwt.thenState({ProductDemands.name: "Laptop", orderCount: 0})
|
|
35
63
|
)
|
package/lib/ocaml/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1789087727040)
|
|
2
|
+
#Done(1789087733109)
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/Categories.res
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/Plugin.ast
CHANGED
|
Binary file
|
package/lib/ocaml/Plugin.res
CHANGED
|
@@ -22,7 +22,10 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
22
22
|
|
|
23
23
|
// ReadModels
|
|
24
24
|
module CategoriesReadModel = Platform.ReadModel.Make(Categories, Categories_Projections)
|
|
25
|
-
module ProductDemandsReadModel = Platform.ReadModel.Make(
|
|
25
|
+
module ProductDemandsReadModel = Platform.ReadModel.Make(
|
|
26
|
+
ProductDemands,
|
|
27
|
+
ProductDemands_Projections,
|
|
28
|
+
)
|
|
26
29
|
module ProductsReadModel = Platform.ReadModel.Make(Products, Products_Projections)
|
|
27
30
|
|
|
28
31
|
// Tasks
|
|
@@ -36,11 +39,26 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
36
39
|
|
|
37
40
|
let pluginStructure = Platform.Plugin.makePluginDefinition(
|
|
38
41
|
~name="Catalog",
|
|
39
|
-
~aggregates=[
|
|
40
|
-
|
|
42
|
+
~aggregates=[
|
|
43
|
+
module(CategoryAggregate),
|
|
44
|
+
module(ProductAggregate),
|
|
45
|
+
module(ProductDemandAggregate),
|
|
46
|
+
],
|
|
47
|
+
~readModels=[
|
|
48
|
+
module(CategoriesReadModel),
|
|
49
|
+
module(ProductDemandsReadModel),
|
|
50
|
+
module(ProductsReadModel),
|
|
51
|
+
],
|
|
41
52
|
~extensions=[module(Orders_Extension)],
|
|
42
53
|
~extensionPoints=[module(Products_ExtensionPointMapping)],
|
|
43
|
-
~componentChapters=Dict.fromArray([
|
|
54
|
+
~componentChapters=Dict.fromArray([
|
|
55
|
+
("Categories", "Category"),
|
|
56
|
+
("Category", "Category"),
|
|
57
|
+
("Product", "Product"),
|
|
58
|
+
("ProductDemand", "ProductDemand"),
|
|
59
|
+
("ProductDemands", "ProductDemand"),
|
|
60
|
+
("Products", "Product"),
|
|
61
|
+
]),
|
|
44
62
|
~lifecycleModel=LifecycleModel.model,
|
|
45
63
|
)
|
|
46
64
|
|
|
@@ -50,10 +68,18 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
50
68
|
~heartbeatInterval=5,
|
|
51
69
|
~extensionPoints=[module(Products_ExtensionPoint)],
|
|
52
70
|
~extensions=[module(Orders_Extension)],
|
|
53
|
-
~aggregates=[
|
|
54
|
-
|
|
71
|
+
~aggregates=[
|
|
72
|
+
module(CategoryAggregate),
|
|
73
|
+
module(ProductAggregate),
|
|
74
|
+
module(ProductDemandAggregate),
|
|
75
|
+
],
|
|
76
|
+
~readModels=[
|
|
77
|
+
module(CategoriesReadModel),
|
|
78
|
+
module(ProductDemandsReadModel),
|
|
79
|
+
module(ProductsReadModel),
|
|
80
|
+
],
|
|
55
81
|
~tasks=[module(ImportProductsTask)],
|
|
56
|
-
~pluginStructure
|
|
82
|
+
~pluginStructure,
|
|
57
83
|
~uiFragments=?uiBundleUrl->Option.map(url =>
|
|
58
84
|
Platform.Plugin.makeAutoUIManifest(
|
|
59
85
|
~remoteEntryUrl=url,
|
|
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
|