@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.
Files changed (149) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lib/bs/.compiler.log +2 -2
  3. package/lib/bs/compiler-info.json +1 -1
  4. package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmi +0 -0
  5. package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmt +0 -0
  6. package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmi +0 -0
  7. package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmt +0 -0
  8. package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmi +0 -0
  9. package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmt +0 -0
  10. package/lib/bs/src/Category/ReadModel/Categories.res +0 -1
  11. package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmi +0 -0
  12. package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmt +0 -0
  13. package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmi +0 -0
  14. package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmt +0 -0
  15. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
  16. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
  17. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.ast +0 -0
  18. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping.res +17 -10
  19. package/lib/bs/src/LifecycleModel-CatalogPlugin.cmi +0 -0
  20. package/lib/bs/src/LifecycleModel-CatalogPlugin.cmt +0 -0
  21. package/lib/bs/src/LifecycleModel.ast +0 -0
  22. package/lib/bs/src/LifecycleModel.res +1 -2
  23. package/lib/bs/src/Plugin-CatalogPlugin.cmi +0 -0
  24. package/lib/bs/src/Plugin-CatalogPlugin.cmt +0 -0
  25. package/lib/bs/src/Plugin.ast +0 -0
  26. package/lib/bs/src/Plugin.res +33 -7
  27. package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmi +0 -0
  28. package/lib/bs/src/Product/Aggregate/Product-CatalogPlugin.cmt +0 -0
  29. package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmi +0 -0
  30. package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmt +0 -0
  31. package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmi +0 -0
  32. package/lib/bs/src/Product/ReadModel/Products-CatalogPlugin.cmt +0 -0
  33. package/lib/bs/src/Product/ReadModel/Products.res +0 -1
  34. package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmi +0 -0
  35. package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmt +0 -0
  36. package/lib/bs/src/Product/ReadModel/Products_Projections.ast +0 -0
  37. package/lib/bs/src/Product/ReadModel/Products_Projections.res +2 -3
  38. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmi +0 -0
  39. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand-CatalogPlugin.cmt +0 -0
  40. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
  41. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
  42. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmi +0 -0
  43. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands-CatalogPlugin.cmt +0 -0
  44. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands.res +0 -1
  45. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
  46. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
  47. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.ast +0 -0
  48. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections.res +5 -3
  49. package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmi +0 -0
  50. package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmt +0 -0
  51. package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmi +0 -0
  52. package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmt +0 -0
  53. package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmi +0 -0
  54. package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmt +0 -0
  55. package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
  56. package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
  57. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
  58. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
  59. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.ast +0 -0
  60. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +6 -1
  61. package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmi +0 -0
  62. package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmt +0 -0
  63. package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmi +0 -0
  64. package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmt +0 -0
  65. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
  66. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
  67. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
  68. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
  69. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.ast +0 -0
  70. package/lib/bs/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +32 -4
  71. package/lib/ocaml/.compiler.log +2 -2
  72. package/lib/ocaml/Categories-CatalogPlugin.cmi +0 -0
  73. package/lib/ocaml/Categories-CatalogPlugin.cmt +0 -0
  74. package/lib/ocaml/Categories.res +0 -1
  75. package/lib/ocaml/Categories_GWT-CatalogPlugin.cmi +0 -0
  76. package/lib/ocaml/Categories_GWT-CatalogPlugin.cmt +0 -0
  77. package/lib/ocaml/Categories_Projections-CatalogPlugin.cmi +0 -0
  78. package/lib/ocaml/Categories_Projections-CatalogPlugin.cmt +0 -0
  79. package/lib/ocaml/Category-CatalogPlugin.cmi +0 -0
  80. package/lib/ocaml/Category-CatalogPlugin.cmt +0 -0
  81. package/lib/ocaml/Category_Behavior-CatalogPlugin.cmi +0 -0
  82. package/lib/ocaml/Category_Behavior-CatalogPlugin.cmt +0 -0
  83. package/lib/ocaml/Category_GWT-CatalogPlugin.cmi +0 -0
  84. package/lib/ocaml/Category_GWT-CatalogPlugin.cmt +0 -0
  85. package/lib/ocaml/ImportProducts-CatalogPlugin.cmi +0 -0
  86. package/lib/ocaml/ImportProducts-CatalogPlugin.cmt +0 -0
  87. package/lib/ocaml/LifecycleModel-CatalogPlugin.cmi +0 -0
  88. package/lib/ocaml/LifecycleModel-CatalogPlugin.cmt +0 -0
  89. package/lib/ocaml/LifecycleModel.ast +0 -0
  90. package/lib/ocaml/LifecycleModel.res +1 -2
  91. package/lib/ocaml/Orders_Extension-CatalogPlugin.cmi +0 -0
  92. package/lib/ocaml/Orders_Extension-CatalogPlugin.cmt +0 -0
  93. package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
  94. package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
  95. package/lib/ocaml/Plugin-CatalogPlugin.cmi +0 -0
  96. package/lib/ocaml/Plugin-CatalogPlugin.cmt +0 -0
  97. package/lib/ocaml/Plugin.ast +0 -0
  98. package/lib/ocaml/Plugin.res +33 -7
  99. package/lib/ocaml/Product-CatalogPlugin.cmi +0 -0
  100. package/lib/ocaml/Product-CatalogPlugin.cmt +0 -0
  101. package/lib/ocaml/ProductDemand-CatalogPlugin.cmi +0 -0
  102. package/lib/ocaml/ProductDemand-CatalogPlugin.cmt +0 -0
  103. package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
  104. package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
  105. package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
  106. package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
  107. package/lib/ocaml/ProductDemands-CatalogPlugin.cmi +0 -0
  108. package/lib/ocaml/ProductDemands-CatalogPlugin.cmt +0 -0
  109. package/lib/ocaml/ProductDemands.res +0 -1
  110. package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
  111. package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
  112. package/lib/ocaml/ProductDemands_GWT.ast +0 -0
  113. package/lib/ocaml/ProductDemands_GWT.res +32 -4
  114. package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
  115. package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
  116. package/lib/ocaml/ProductDemands_Projections.ast +0 -0
  117. package/lib/ocaml/ProductDemands_Projections.res +5 -3
  118. package/lib/ocaml/Product_Behavior-CatalogPlugin.cmi +0 -0
  119. package/lib/ocaml/Product_Behavior-CatalogPlugin.cmt +0 -0
  120. package/lib/ocaml/Product_GWT-CatalogPlugin.cmi +0 -0
  121. package/lib/ocaml/Product_GWT-CatalogPlugin.cmt +0 -0
  122. package/lib/ocaml/Products-CatalogPlugin.cmi +0 -0
  123. package/lib/ocaml/Products-CatalogPlugin.cmt +0 -0
  124. package/lib/ocaml/Products.res +0 -1
  125. package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
  126. package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
  127. package/lib/ocaml/Products_ExtensionPointMapping.ast +0 -0
  128. package/lib/ocaml/Products_ExtensionPointMapping.res +17 -10
  129. package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
  130. package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
  131. package/lib/ocaml/Products_ExtensionPointMapping_GWT.ast +0 -0
  132. package/lib/ocaml/Products_ExtensionPointMapping_GWT.res +6 -1
  133. package/lib/ocaml/Products_GWT-CatalogPlugin.cmi +0 -0
  134. package/lib/ocaml/Products_GWT-CatalogPlugin.cmt +0 -0
  135. package/lib/ocaml/Products_Projections-CatalogPlugin.cmi +0 -0
  136. package/lib/ocaml/Products_Projections-CatalogPlugin.cmt +0 -0
  137. package/lib/ocaml/Products_Projections.ast +0 -0
  138. package/lib/ocaml/Products_Projections.res +2 -3
  139. package/package.json +8 -8
  140. package/src/Category/ReadModel/Categories.res +0 -1
  141. package/src/ExtensionPoint/Products_ExtensionPointMapping.res +17 -10
  142. package/src/LifecycleModel.res +1 -2
  143. package/src/Plugin.res +33 -7
  144. package/src/Product/ReadModel/Products.res +0 -1
  145. package/src/Product/ReadModel/Products_Projections.res +2 -3
  146. package/src/ProductDemand/ReadModel/ProductDemands.res +0 -1
  147. package/src/ProductDemand/ReadModel/ProductDemands_Projections.res +5 -3
  148. package/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +6 -1
  149. 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
@@ -1,2 +1,2 @@
1
- #Start(1788869294227)
2
- #Done(1788869299890)
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": "1788869299892"
7
+ "generated_at": "1789087733117"
8
8
  }
@@ -8,4 +8,3 @@ type state = {
8
8
  name: string,
9
9
  archived: bool,
10
10
  }
11
-
@@ -6,14 +6,21 @@ module Delegate = Product
6
6
 
7
7
  let mapIncomingCommand = (_id, _command, _meta) => []
8
8
 
9
- let mapOutgoingEvent = Some((id, event, _meta, _queryEngine) =>
10
- switch event {
11
- | Product.Added({name, price}) => [
12
- PublishEvent(id, CatalogSpec.Products_ExtensionPoint.ProductBecameAvailable({productId: id, name, price})),
13
- ]
14
- | Product.PriceUpdated({price}) => [
15
- PublishEvent(id, CatalogSpec.Products_ExtensionPoint.ProductPriceChanged({productId: id, price})),
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
@@ -6,5 +6,4 @@
6
6
  // `@transition` annotation where it says anything, and falls back to the
7
7
  // annotation where it is silent.
8
8
 
9
- let model: array<Reventless.Plugin.derivedEdge> = [
10
- ]
9
+ let model: array<Reventless.Plugin.derivedEdge> = []
Binary file
Binary file
Binary file
@@ -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(ProductDemands, ProductDemands_Projections)
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=[module(CategoryAggregate), module(ProductAggregate), module(ProductDemandAggregate)],
40
- ~readModels=[module(CategoriesReadModel), module(ProductDemandsReadModel), module(ProductsReadModel)],
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([("Categories", "Category"), ("Category", "Category"), ("Product", "Product"), ("ProductDemand", "ProductDemand"), ("ProductDemands", "ProductDemand"), ("Products", "Product")]),
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=[module(CategoryAggregate), module(ProductAggregate), module(ProductDemandAggregate)],
54
- ~readModels=[module(CategoriesReadModel), module(ProductDemandsReadModel), module(ProductsReadModel)],
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=pluginStructure,
82
+ ~pluginStructure,
57
83
  ~uiFragments=?uiBundleUrl->Option.map(url =>
58
84
  Platform.Plugin.makeAutoUIManifest(
59
85
  ~remoteEntryUrl=url,
@@ -10,4 +10,3 @@ type state = {
10
10
  price: float,
11
11
  @storageRef("productImages") imageUrl: string,
12
12
  }
13
-
@@ -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: name, description, price, imageUrl})
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
  }
@@ -5,4 +5,3 @@
5
5
 
6
6
  @schema
7
7
  type state = {name: string, orderCount: int}
8
-
@@ -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(id, (state: ProductDemands.state) => {...state, orderCount: max(0, state.orderCount - 1)})
30
+ Update(
31
+ id,
32
+ (state: ProductDemands.state) => {...state, orderCount: max(0, state.orderCount - 1)},
33
+ )
32
34
  }
33
35
  },
34
36
  )
@@ -5,7 +5,12 @@
5
5
  describe("Products ExtensionPoint mapping", () => {
6
6
  test("Added publishes ProductBecameAvailable", () =>
7
7
  whenDelegateEvent(
8
- Delegate.Added({name: "Book", description: "A good book", price: 9.99, imageUrl: "/productImages/book.jpg"}),
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}),
@@ -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(Product.Added({name: "Laptop", description: "x", price: 1.0, imageUrl: "/productImages/laptop.jpg"}))
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([Product.Added({name: "Laptop", description: "x", price: 1.0, imageUrl: "/productImages/laptop.jpg"})])
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([Product.Added({name: "Laptop", description: "x", price: 1.0, imageUrl: "/productImages/laptop.jpg"})])
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([Product.Added({name: "Laptop", description: "x", price: 1.0, imageUrl: "/productImages/laptop.jpg"})])
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
  )
@@ -1,2 +1,2 @@
1
- #Start(1788869294227)
2
- #Done(1788869299890)
1
+ #Start(1789087727040)
2
+ #Done(1789087733109)
@@ -8,4 +8,3 @@ type state = {
8
8
  name: string,
9
9
  archived: bool,
10
10
  }
11
-
Binary file
@@ -6,5 +6,4 @@
6
6
  // `@transition` annotation where it says anything, and falls back to the
7
7
  // annotation where it is silent.
8
8
 
9
- let model: array<Reventless.Plugin.derivedEdge> = [
10
- ]
9
+ let model: array<Reventless.Plugin.derivedEdge> = []
Binary file
Binary file
Binary file
@@ -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(ProductDemands, ProductDemands_Projections)
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=[module(CategoryAggregate), module(ProductAggregate), module(ProductDemandAggregate)],
40
- ~readModels=[module(CategoriesReadModel), module(ProductDemandsReadModel), module(ProductsReadModel)],
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([("Categories", "Category"), ("Category", "Category"), ("Product", "Product"), ("ProductDemand", "ProductDemand"), ("ProductDemands", "ProductDemand"), ("Products", "Product")]),
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=[module(CategoryAggregate), module(ProductAggregate), module(ProductDemandAggregate)],
54
- ~readModels=[module(CategoriesReadModel), module(ProductDemandsReadModel), module(ProductsReadModel)],
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=pluginStructure,
82
+ ~pluginStructure,
57
83
  ~uiFragments=?uiBundleUrl->Option.map(url =>
58
84
  Platform.Plugin.makeAutoUIManifest(
59
85
  ~remoteEntryUrl=url,
Binary file
Binary file
@@ -5,4 +5,3 @@
5
5
 
6
6
  @schema
7
7
  type state = {name: string, orderCount: int}
8
-
Binary file