@reventlessdev/online-shop-aggregates-catalog 3.0.0-alpha.248 → 3.0.0-alpha.249

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 (148) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/bs/.compiler.log +2 -2
  3. package/lib/bs/CatalogPlugin.cmi +0 -0
  4. package/lib/bs/CatalogPlugin.cmt +0 -0
  5. package/lib/bs/CatalogPlugin.mlmap +1 -0
  6. package/lib/bs/compiler-info.json +1 -1
  7. package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmi +0 -0
  8. package/lib/bs/src/Category/Aggregate/Category-CatalogPlugin.cmt +0 -0
  9. package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmi +0 -0
  10. package/lib/bs/src/Category/Aggregate/Category_Behavior-CatalogPlugin.cmt +0 -0
  11. package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmi +0 -0
  12. package/lib/bs/src/Category/ReadModel/Categories-CatalogPlugin.cmt +0 -0
  13. package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmi +0 -0
  14. package/lib/bs/src/Category/ReadModel/Categories_Projections-CatalogPlugin.cmt +0 -0
  15. package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmi +0 -0
  16. package/lib/bs/src/Extension/Orders_Extension-CatalogPlugin.cmt +0 -0
  17. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
  18. package/lib/bs/src/ExtensionPoint/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
  19. package/lib/bs/src/Plugin-CatalogPlugin.cmi +0 -0
  20. package/lib/bs/src/Plugin-CatalogPlugin.cmt +0 -0
  21. package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmi +0 -0
  22. package/lib/bs/src/Product/Aggregate/Product_Behavior-CatalogPlugin.cmt +0 -0
  23. package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmi +0 -0
  24. package/lib/bs/src/Product/ReadModel/Products_Projections-CatalogPlugin.cmt +0 -0
  25. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
  26. package/lib/bs/src/ProductDemand/Aggregate/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
  27. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
  28. package/lib/bs/src/ProductDemand/ReadModel/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
  29. package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmt +0 -0
  30. package/lib/bs/tests/Catalog_Examples-CatalogPlugin.cmi +0 -0
  31. package/lib/bs/tests/Catalog_Examples-CatalogPlugin.cmj +0 -0
  32. package/lib/bs/tests/Catalog_Examples-CatalogPlugin.cmt +0 -0
  33. package/lib/bs/tests/Catalog_Examples.ast +0 -0
  34. package/lib/bs/tests/Catalog_Examples.res +9 -0
  35. package/lib/bs/tests/Catalog_Examples.res.mjs +27 -0
  36. package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmi +0 -0
  37. package/lib/bs/tests/Category/Aggregate/Category_GWT-CatalogPlugin.cmt +0 -0
  38. package/lib/bs/tests/Category/Aggregate/Category_GWT.ast +0 -0
  39. package/lib/bs/tests/Category/Aggregate/Category_GWT.res +21 -11
  40. package/lib/bs/tests/Category/Aggregate/Category_GWT.res.mjs +12 -11
  41. package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmi +0 -0
  42. package/lib/bs/tests/Category/ReadModel/Categories_GWT-CatalogPlugin.cmt +0 -0
  43. package/lib/bs/tests/Category/ReadModel/Categories_GWT.ast +0 -0
  44. package/lib/bs/tests/Category/ReadModel/Categories_GWT.res +3 -0
  45. package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
  46. package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
  47. package/lib/bs/tests/Extension/Orders_Extension_GWT.ast +0 -0
  48. package/lib/bs/tests/Extension/Orders_Extension_GWT.res +2 -0
  49. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
  50. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
  51. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.ast +0 -0
  52. package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +4 -0
  53. package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmi +0 -0
  54. package/lib/bs/tests/Product/Aggregate/Product_GWT-CatalogPlugin.cmt +0 -0
  55. package/lib/bs/tests/Product/Aggregate/Product_GWT.ast +0 -0
  56. package/lib/bs/tests/Product/Aggregate/Product_GWT.res +24 -8
  57. package/lib/bs/tests/Product/Aggregate/Product_GWT.res.mjs +9 -8
  58. package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmi +0 -0
  59. package/lib/bs/tests/Product/ReadModel/Products_GWT-CatalogPlugin.cmt +0 -0
  60. package/lib/bs/tests/Product/ReadModel/Products_GWT.ast +0 -0
  61. package/lib/bs/tests/Product/ReadModel/Products_GWT.res +5 -0
  62. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
  63. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
  64. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.ast +0 -0
  65. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +21 -13
  66. package/lib/bs/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +14 -13
  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 +6 -0
  71. package/lib/ocaml/.compiler.log +2 -2
  72. package/lib/ocaml/CatalogPlugin.cmi +0 -0
  73. package/lib/ocaml/CatalogPlugin.cmt +0 -0
  74. package/lib/ocaml/CatalogPlugin.mlmap +1 -0
  75. package/lib/ocaml/Catalog_Examples-CatalogPlugin.cmi +0 -0
  76. package/lib/ocaml/Catalog_Examples-CatalogPlugin.cmj +0 -0
  77. package/lib/ocaml/Catalog_Examples-CatalogPlugin.cmt +0 -0
  78. package/lib/ocaml/Catalog_Examples.ast +0 -0
  79. package/lib/ocaml/Catalog_Examples.res +9 -0
  80. package/lib/ocaml/Categories-CatalogPlugin.cmi +0 -0
  81. package/lib/ocaml/Categories-CatalogPlugin.cmt +0 -0
  82. package/lib/ocaml/Categories_GWT-CatalogPlugin.cmi +0 -0
  83. package/lib/ocaml/Categories_GWT-CatalogPlugin.cmt +0 -0
  84. package/lib/ocaml/Categories_GWT.ast +0 -0
  85. package/lib/ocaml/Categories_GWT.res +3 -0
  86. package/lib/ocaml/Categories_Projections-CatalogPlugin.cmi +0 -0
  87. package/lib/ocaml/Categories_Projections-CatalogPlugin.cmt +0 -0
  88. package/lib/ocaml/Category-CatalogPlugin.cmi +0 -0
  89. package/lib/ocaml/Category-CatalogPlugin.cmt +0 -0
  90. package/lib/ocaml/Category_Behavior-CatalogPlugin.cmi +0 -0
  91. package/lib/ocaml/Category_Behavior-CatalogPlugin.cmt +0 -0
  92. package/lib/ocaml/Category_GWT-CatalogPlugin.cmi +0 -0
  93. package/lib/ocaml/Category_GWT-CatalogPlugin.cmt +0 -0
  94. package/lib/ocaml/Category_GWT.ast +0 -0
  95. package/lib/ocaml/Category_GWT.res +21 -11
  96. package/lib/ocaml/ImportProducts-CatalogPlugin.cmt +0 -0
  97. package/lib/ocaml/Orders_Extension-CatalogPlugin.cmi +0 -0
  98. package/lib/ocaml/Orders_Extension-CatalogPlugin.cmt +0 -0
  99. package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
  100. package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
  101. package/lib/ocaml/Orders_Extension_GWT.ast +0 -0
  102. package/lib/ocaml/Orders_Extension_GWT.res +2 -0
  103. package/lib/ocaml/Plugin-CatalogPlugin.cmi +0 -0
  104. package/lib/ocaml/Plugin-CatalogPlugin.cmt +0 -0
  105. package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmi +0 -0
  106. package/lib/ocaml/ProductDemand_Behavior-CatalogPlugin.cmt +0 -0
  107. package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
  108. package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
  109. package/lib/ocaml/ProductDemand_GWT.ast +0 -0
  110. package/lib/ocaml/ProductDemand_GWT.res +21 -13
  111. package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmi +0 -0
  112. package/lib/ocaml/ProductDemands_GWT-CatalogPlugin.cmt +0 -0
  113. package/lib/ocaml/ProductDemands_GWT.ast +0 -0
  114. package/lib/ocaml/ProductDemands_GWT.res +6 -0
  115. package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmi +0 -0
  116. package/lib/ocaml/ProductDemands_Projections-CatalogPlugin.cmt +0 -0
  117. package/lib/ocaml/Product_Behavior-CatalogPlugin.cmi +0 -0
  118. package/lib/ocaml/Product_Behavior-CatalogPlugin.cmt +0 -0
  119. package/lib/ocaml/Product_GWT-CatalogPlugin.cmi +0 -0
  120. package/lib/ocaml/Product_GWT-CatalogPlugin.cmt +0 -0
  121. package/lib/ocaml/Product_GWT.ast +0 -0
  122. package/lib/ocaml/Product_GWT.res +24 -8
  123. package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmi +0 -0
  124. package/lib/ocaml/Products_ExtensionPointMapping-CatalogPlugin.cmt +0 -0
  125. package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
  126. package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
  127. package/lib/ocaml/Products_ExtensionPointMapping_GWT.ast +0 -0
  128. package/lib/ocaml/Products_ExtensionPointMapping_GWT.res +4 -0
  129. package/lib/ocaml/Products_GWT-CatalogPlugin.cmi +0 -0
  130. package/lib/ocaml/Products_GWT-CatalogPlugin.cmt +0 -0
  131. package/lib/ocaml/Products_GWT.ast +0 -0
  132. package/lib/ocaml/Products_GWT.res +5 -0
  133. package/lib/ocaml/Products_Projections-CatalogPlugin.cmi +0 -0
  134. package/lib/ocaml/Products_Projections-CatalogPlugin.cmt +0 -0
  135. package/package.json +6 -6
  136. package/tests/Catalog_Examples.res +9 -0
  137. package/tests/Catalog_Examples.res.mjs +27 -0
  138. package/tests/Category/Aggregate/Category_GWT.res +21 -11
  139. package/tests/Category/Aggregate/Category_GWT.res.mjs +12 -11
  140. package/tests/Category/ReadModel/Categories_GWT.res +3 -0
  141. package/tests/Extension/Orders_Extension_GWT.res +2 -0
  142. package/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT.res +4 -0
  143. package/tests/Product/Aggregate/Product_GWT.res +24 -8
  144. package/tests/Product/Aggregate/Product_GWT.res.mjs +9 -8
  145. package/tests/Product/ReadModel/Products_GWT.res +5 -0
  146. package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res +21 -13
  147. package/tests/ProductDemand/Aggregate/ProductDemand_GWT.res.mjs +14 -13
  148. package/tests/ProductDemand/ReadModel/ProductDemands_GWT.res +6 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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.249 (2026-09-23)
7
+
8
+ **Note:** Version bump only for package @reventlessdev/online-shop-aggregates-catalog
9
+
10
+
11
+
12
+
13
+
6
14
  # 3.0.0-alpha.248 (2026-09-22)
7
15
 
8
16
  **Note:** Version bump only for package @reventlessdev/online-shop-aggregates-catalog
@@ -1,2 +1,2 @@
1
- #Start(1790058025501)
2
- #Done(1790058029622)
1
+ #Start(1790168165422)
2
+ #Done(1790168171023)
Binary file
Binary file
@@ -1,4 +1,5 @@
1
1
  randjbuildsystem
2
+ Catalog_Examples
2
3
  Categories
3
4
  Categories_GWT
4
5
  Categories_Projections
@@ -4,5 +4,5 @@
4
4
  "bsc_hash": "1006241435e8d5052329c523202a7fe6359a37e1e1688c023d37d6a7ebb5fb6d",
5
5
  "rescript_config_hash": "50d5358a2cbe328e82ae9b442e4615b86dbfe6b2ce05e9eca04a0c78da0e4708",
6
6
  "runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
7
- "generated_at": "1790058029631"
7
+ "generated_at": "1790168171026"
8
8
  }
Binary file
Binary file
@@ -0,0 +1,9 @@
1
+ @@reventless.examples
2
+
3
+ let electronics: string = "Electronics"
4
+ let laptop: string = "Laptop"
5
+ let laptopDescription: string = "A laptop"
6
+ let laptopImage: string = "/productImages/laptop.jpg"
7
+ let order1: string = "order-1"
8
+ let order2: string = "order-2"
9
+ let renamedTo: string = "New Name"
@@ -0,0 +1,27 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let electronics = "Electronics";
5
+
6
+ let laptop = "Laptop";
7
+
8
+ let laptopDescription = "A laptop";
9
+
10
+ let laptopImage = "/productImages/laptop.jpg";
11
+
12
+ let order1 = "order-1";
13
+
14
+ let order2 = "order-2";
15
+
16
+ let renamedTo = "New Name";
17
+
18
+ export {
19
+ electronics,
20
+ laptop,
21
+ laptopDescription,
22
+ laptopImage,
23
+ order1,
24
+ order2,
25
+ renamedTo,
26
+ }
27
+ /* No side effect */
@@ -1,50 +1,60 @@
1
1
  @@reventless.gwt
2
2
 
3
+ open Catalog_Examples
4
+
3
5
  describe("Category Behavior", () => {
6
+ // scenario-id: fb4b109a-87b5-4aa3-a8e2-4fca61d0c050
4
7
  test("Add on new aggregate produces Added", () =>
5
8
  givenEvents([])
6
- ->whenCmd(Add({name: "Electronics"}))
7
- ->thenEvent(Added({name: "Electronics"}))
9
+ ->whenCmd(Add({name: electronics}))
10
+ ->thenEvent(Added({name: electronics}))
8
11
  )
9
12
 
13
+ // scenario-id: a071dd62-8b9a-4fad-923a-6e740c4995dc
10
14
  test("Add on existing aggregate returns CategoryAlreadyExists", () =>
11
- givenEvents([Added({name: "Electronics"})])
15
+ givenEvents([Added({name: electronics})])
12
16
  ->whenCmd(Add({name: "Electronics 2"}))
13
17
  ->thenError(CategoryAlreadyExists)
14
18
  )
15
19
 
20
+ // scenario-id: 0b4584cf-8399-4511-bedf-422ad0283251
16
21
  test("Rename on non-existent aggregate returns CategoryNotFound", () =>
17
22
  givenEvents([])
18
- ->whenCmd(Rename({name: "New Name"}))
23
+ ->whenCmd(Rename({name: renamedTo}))
19
24
  ->thenError(CategoryNotFound)
20
25
  )
21
26
 
27
+ // scenario-id: 4115f220-9d7e-4b6a-bfd1-cc18a5c9916b
22
28
  test("Rename on active category produces Renamed", () =>
23
- givenEvents([Added({name: "Electronics"})])
29
+ givenEvents([Added({name: electronics})])
24
30
  ->whenCmd(Rename({name: "Consumer Electronics"}))
25
31
  ->thenEvent(Renamed({name: "Consumer Electronics"}))
26
32
  )
27
33
 
34
+ // scenario-id: c703e462-c659-496d-a910-6d4507ac351e
28
35
  test("Rename to same name produces no events (idempotent)", () =>
29
- givenEvents([Added({name: "Electronics"})])
30
- ->whenCmd(Rename({name: "Electronics"}))
36
+ givenEvents([Added({name: electronics})])
37
+ ->whenCmd(Rename({name: electronics}))
31
38
  ->thenNoEvent
32
39
  )
33
40
 
41
+ // scenario-id: b164ce1f-5f38-4a36-a5c6-26c5491f3735
34
42
  test("Rename on archived category returns CategoryAlreadyArchived", () =>
35
- givenEvents([Added({name: "Electronics"}), Archived])
36
- ->whenCmd(Rename({name: "New Name"}))
43
+ givenEvents([Added({name: electronics}), Archived])
44
+ ->whenCmd(Rename({name: renamedTo}))
37
45
  ->thenError(CategoryAlreadyArchived)
38
46
  )
39
47
 
48
+ // scenario-id: a251a06c-44d3-403f-b5ed-664a94e78376
40
49
  test("Archive on active category produces Archived", () =>
41
- givenEvents([Added({name: "Electronics"})])
50
+ givenEvents([Added({name: electronics})])
42
51
  ->whenCmd(Archive)
43
52
  ->thenEvent(Archived)
44
53
  )
45
54
 
55
+ // scenario-id: 4be3d8db-9f51-4967-8ac1-7862ab1a2436
46
56
  test("Archive on archived category produces no events (idempotent)", () =>
47
- givenEvents([Added({name: "Electronics"}), Archived])
57
+ givenEvents([Added({name: electronics}), Archived])
48
58
  ->whenCmd(Archive)
49
59
  ->thenNoEvent
50
60
  )
@@ -2,6 +2,7 @@
2
2
 
3
3
  import * as Category$CatalogPlugin from "../../../src/Category/Aggregate/Category.res.mjs";
4
4
  import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
5
+ import * as Catalog_Examples$CatalogPlugin from "../../Catalog_Examples.res.mjs";
5
6
  import * as Category_Behavior$CatalogPlugin from "../../../src/Category/Aggregate/Category_Behavior.res.mjs";
6
7
 
7
8
  let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
@@ -40,25 +41,25 @@ let thenError = include.thenError;
40
41
  describe("Category Behavior", () => {
41
42
  test("Add on new aggregate produces Added", () => thenEvent(whenCmd(givenEvents([]), {
42
43
  TAG: "Add",
43
- name: "Electronics"
44
+ name: Catalog_Examples$CatalogPlugin.electronics
44
45
  }), {
45
46
  TAG: "Added",
46
- name: "Electronics"
47
+ name: Catalog_Examples$CatalogPlugin.electronics
47
48
  }));
48
49
  test("Add on existing aggregate returns CategoryAlreadyExists", () => thenError(whenCmd(givenEvents([{
49
50
  TAG: "Added",
50
- name: "Electronics"
51
+ name: Catalog_Examples$CatalogPlugin.electronics
51
52
  }]), {
52
53
  TAG: "Add",
53
54
  name: "Electronics 2"
54
55
  }), "CategoryAlreadyExists"));
55
56
  test("Rename on non-existent aggregate returns CategoryNotFound", () => thenError(whenCmd(givenEvents([]), {
56
57
  TAG: "Rename",
57
- name: "New Name"
58
+ name: Catalog_Examples$CatalogPlugin.renamedTo
58
59
  }), "CategoryNotFound"));
59
60
  test("Rename on active category produces Renamed", () => thenEvent(whenCmd(givenEvents([{
60
61
  TAG: "Added",
61
- name: "Electronics"
62
+ name: Catalog_Examples$CatalogPlugin.electronics
62
63
  }]), {
63
64
  TAG: "Rename",
64
65
  name: "Consumer Electronics"
@@ -68,29 +69,29 @@ describe("Category Behavior", () => {
68
69
  }));
69
70
  test("Rename to same name produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([{
70
71
  TAG: "Added",
71
- name: "Electronics"
72
+ name: Catalog_Examples$CatalogPlugin.electronics
72
73
  }]), {
73
74
  TAG: "Rename",
74
- name: "Electronics"
75
+ name: Catalog_Examples$CatalogPlugin.electronics
75
76
  })));
76
77
  test("Rename on archived category returns CategoryAlreadyArchived", () => thenError(whenCmd(givenEvents([
77
78
  {
78
79
  TAG: "Added",
79
- name: "Electronics"
80
+ name: Catalog_Examples$CatalogPlugin.electronics
80
81
  },
81
82
  "Archived"
82
83
  ]), {
83
84
  TAG: "Rename",
84
- name: "New Name"
85
+ name: Catalog_Examples$CatalogPlugin.renamedTo
85
86
  }), "CategoryAlreadyArchived"));
86
87
  test("Archive on active category produces Archived", () => thenEvent(whenCmd(givenEvents([{
87
88
  TAG: "Added",
88
- name: "Electronics"
89
+ name: Catalog_Examples$CatalogPlugin.electronics
89
90
  }]), "Archive"), "Archived"));
90
91
  test("Archive on archived category produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
91
92
  {
92
93
  TAG: "Added",
93
- name: "Electronics"
94
+ name: Catalog_Examples$CatalogPlugin.electronics
94
95
  },
95
96
  "Archived"
96
97
  ]), "Archive")));
@@ -1,18 +1,21 @@
1
1
  @@reventless.gwt(Categories_Projections.CategoryMapping)
2
2
 
3
3
  describe("Categories ReadModel ← Category", () => {
4
+ // scenario-id: d3a10976-599d-4ced-b604-25f57a15d2db
4
5
  test("Added sets initial read model state", () =>
5
6
  givenEvents([])
6
7
  ->whenEvent(Category.Added({name: "Electronics"}))
7
8
  ->thenState({Categories.name: "Electronics", archived: false})
8
9
  )
9
10
 
11
+ // scenario-id: 700b948d-9773-4c84-90b4-8167c4240ce0
10
12
  test("Renamed updates the name", () =>
11
13
  givenEvents([Category.Added({name: "Electronics"})])
12
14
  ->whenEvent(Category.Renamed({name: "Consumer Electronics"}))
13
15
  ->thenState({Categories.name: "Consumer Electronics", archived: false})
14
16
  )
15
17
 
18
+ // scenario-id: 5ad0dd16-f778-4df9-b4cb-8f5b86548dbd
16
19
  test("Archived sets archived flag", () =>
17
20
  givenEvents([Category.Added({name: "Electronics"})])
18
21
  ->whenEvent(Category.Archived)
@@ -7,12 +7,14 @@
7
7
  open Mapping
8
8
 
9
9
  describe("Orders Extension delegate", () => {
10
+ // scenario-id: b0d0ddb4-b8a4-46c1-8e33-cc16498ebba8
10
11
  test("ItemOrdered records demand for the product", () =>
11
12
  whenIncomingEvent(
12
13
  ExtensionPoint.ItemOrdered({productId: "p1", orderId: "o1", customerId: "c1"}),
13
14
  )->thenPublishesAggregateCommand("p1", Delegate.Record({orderId: "o1"}))
14
15
  )
15
16
 
17
+ // scenario-id: b84d3667-cce1-4532-9fa3-702e43fb6c23
16
18
  test("ItemOrderCancelled revokes demand for the product", () =>
17
19
  whenIncomingEvent(
18
20
  ExtensionPoint.ItemOrderCancelled({productId: "p1", orderId: "o1"}),
@@ -5,6 +5,7 @@
5
5
  let gwtId = CatalogSpec.ProductId.make("gwt-id")
6
6
 
7
7
  describe("Products ExtensionPoint mapping", () => {
8
+ // scenario-id: 44692d81-7898-460c-9315-f4b13bd7876a
8
9
  test("Added publishes ProductBecameAvailable", () =>
9
10
  whenDelegateEvent(
10
11
  Delegate.Added({
@@ -19,6 +20,7 @@ describe("Products ExtensionPoint mapping", () => {
19
20
  )
20
21
  )
21
22
 
23
+ // scenario-id: 5d399774-d4db-4dd5-a36f-59c6efd6d33b
22
24
  test("PriceUpdated publishes ProductPriceChanged", () =>
23
25
  whenDelegateEvent(Delegate.PriceUpdated({price: 7.5}))->thenPublishesEvent(
24
26
  "gwt-id",
@@ -26,10 +28,12 @@ describe("Products ExtensionPoint mapping", () => {
26
28
  )
27
29
  )
28
30
 
31
+ // scenario-id: 3867eb1c-0b12-43df-8525-267e410b4d96
29
32
  test("NameUpdated publishes nothing", () =>
30
33
  whenDelegateEvent(Delegate.NameUpdated({name: "Better Book"}))->thenPublishesNothing
31
34
  )
32
35
 
36
+ // scenario-id: b42bf31d-fb05-4b2c-9d7b-393e46686a40
33
37
  test("DescriptionUpdated publishes nothing", () =>
34
38
  whenDelegateEvent(
35
39
  Delegate.DescriptionUpdated({description: "A really good book"}),
@@ -1,5 +1,7 @@
1
1
  @@reventless.gwt
2
2
 
3
+ open Catalog_Examples
4
+
3
5
  let added = Added({
4
6
  name: "Laptop",
5
7
  description: "A laptop",
@@ -8,19 +10,21 @@ let added = Added({
8
10
  })
9
11
 
10
12
  describe("Product Behavior", () => {
13
+ // scenario-id: 6126c93a-ba4e-4ce0-8d8e-654cf64cd8ba
11
14
  test("Add on new aggregate produces Added", () =>
12
15
  givenEvents([])
13
16
  ->whenCmd(
14
17
  Add({
15
- name: "Laptop",
16
- description: "A laptop",
18
+ name: laptop,
19
+ description: laptopDescription,
17
20
  price: 999.99,
18
- imageUrl: "/productImages/laptop.jpg",
21
+ imageUrl: laptopImage,
19
22
  }),
20
23
  )
21
24
  ->thenEvent(added)
22
25
  )
23
26
 
27
+ // scenario-id: d26cb18d-cb83-4dfd-8c5c-437ba96db7fe
24
28
  test("Add on existing aggregate returns ProductAlreadyExists", () =>
25
29
  givenEvents([added])
26
30
  ->whenCmd(
@@ -34,67 +38,79 @@ describe("Product Behavior", () => {
34
38
  ->thenError(ProductAlreadyExists)
35
39
  )
36
40
 
41
+ // scenario-id: dcde1d71-c3c7-4ae8-8d2e-d92ccc9c7d64
37
42
  test("UpdateName on non-existent aggregate returns ProductNotFound", () =>
38
43
  givenEvents([])
39
- ->whenCmd(UpdateName({name: "New Name"}))
44
+ ->whenCmd(UpdateName({name: renamedTo}))
40
45
  ->thenError(ProductNotFound)
41
46
  )
42
47
 
48
+ // scenario-id: f5245b0a-f5d3-4764-b855-357e54d61115
43
49
  test("UpdateName on existing product produces NameUpdated", () =>
44
50
  givenEvents([added])
45
51
  ->whenCmd(UpdateName({name: "Gaming Laptop"}))
46
52
  ->thenEvent(NameUpdated({name: "Gaming Laptop"}))
47
53
  )
48
54
 
55
+ // scenario-id: 39bf5156-c629-44cd-81bf-34b15a8d86b6
49
56
  test("UpdateName to same name produces no events (idempotent)", () =>
50
- givenEvents([added])->whenCmd(UpdateName({name: "Laptop"}))->thenNoEvent
57
+ givenEvents([added])->whenCmd(UpdateName({name: laptop}))->thenNoEvent
51
58
  )
52
59
 
60
+ // scenario-id: b6864b7c-1040-4080-ad5b-7ffda32911f1
53
61
  test("UpdateDescription on non-existent aggregate returns ProductNotFound", () =>
54
62
  givenEvents([])
55
63
  ->whenCmd(UpdateDescription({description: "x"}))
56
64
  ->thenError(ProductNotFound)
57
65
  )
58
66
 
67
+ // scenario-id: 86557de4-56b3-4a05-8927-8cab2f2b35fe
59
68
  test("UpdateDescription on existing product produces DescriptionUpdated", () =>
60
69
  givenEvents([added])
61
70
  ->whenCmd(UpdateDescription({description: "A high-end laptop"}))
62
71
  ->thenEvent(DescriptionUpdated({description: "A high-end laptop"}))
63
72
  )
64
73
 
74
+ // scenario-id: 7cbdd22a-7839-4e52-9dc0-159f9b0a7b36
65
75
  test("UpdateDescription to same description produces no events (idempotent)", () =>
66
- givenEvents([added])->whenCmd(UpdateDescription({description: "A laptop"}))->thenNoEvent
76
+ givenEvents([added])->whenCmd(UpdateDescription({description: laptopDescription}))->thenNoEvent
67
77
  )
68
78
 
79
+ // scenario-id: ec726191-3c04-45c4-a22b-fa4838746382
69
80
  test("UpdatePrice on non-existent aggregate returns ProductNotFound", () =>
70
81
  givenEvents([])->whenCmd(UpdatePrice({price: 1.0}))->thenError(ProductNotFound)
71
82
  )
72
83
 
84
+ // scenario-id: 6bda772b-cf1e-4518-8d38-95ec8475de32
73
85
  test("UpdatePrice on existing product produces PriceUpdated", () =>
74
86
  givenEvents([added])
75
87
  ->whenCmd(UpdatePrice({price: 899.99}))
76
88
  ->thenEvent(PriceUpdated({price: 899.99}))
77
89
  )
78
90
 
91
+ // scenario-id: ab5a7433-da99-4431-9da1-99448de475fd
79
92
  test("UpdatePrice to same price produces no events (idempotent)", () =>
80
93
  givenEvents([added])->whenCmd(UpdatePrice({price: 999.99}))->thenNoEvent
81
94
  )
82
95
 
96
+ // scenario-id: 992cdc4f-957f-4f4a-9838-9ba83f1855b0
83
97
  test("UpdateImage on non-existent aggregate returns ProductNotFound", () =>
84
98
  givenEvents([])
85
- ->whenCmd(UpdateImage({imageUrl: "/productImages/laptop.jpg"}))
99
+ ->whenCmd(UpdateImage({imageUrl: laptopImage}))
86
100
  ->thenError(ProductNotFound)
87
101
  )
88
102
 
103
+ // scenario-id: ef70aef6-3d4f-4b7f-90ea-2413940879e0
89
104
  test("UpdateImage on existing product produces ImageUpdated", () =>
90
105
  givenEvents([added])
91
106
  ->whenCmd(UpdateImage({imageUrl: "/productImages/laptop-v2.jpg"}))
92
107
  ->thenEvent(ImageUpdated({imageUrl: "/productImages/laptop-v2.jpg"}))
93
108
  )
94
109
 
110
+ // scenario-id: 13499dc4-536c-491b-b3ff-b0bc9f879b10
95
111
  test("UpdateImage to the same ref produces no events (idempotent)", () =>
96
112
  givenEvents([added])
97
- ->whenCmd(UpdateImage({imageUrl: "/productImages/laptop.jpg"}))
113
+ ->whenCmd(UpdateImage({imageUrl: laptopImage}))
98
114
  ->thenNoEvent
99
115
  )
100
116
  })
@@ -2,6 +2,7 @@
2
2
 
3
3
  import * as Product$CatalogPlugin from "../../../src/Product/Aggregate/Product.res.mjs";
4
4
  import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
5
+ import * as Catalog_Examples$CatalogPlugin from "../../Catalog_Examples.res.mjs";
5
6
  import * as Product_Behavior$CatalogPlugin from "../../../src/Product/Aggregate/Product_Behavior.res.mjs";
6
7
 
7
8
  let include = Behavior_GWT$ReventlessGwt.MakeFromAggregate({
@@ -48,10 +49,10 @@ let added = {
48
49
  describe("Product Behavior", () => {
49
50
  test("Add on new aggregate produces Added", () => thenEvent(whenCmd(givenEvents([]), {
50
51
  TAG: "Add",
51
- name: "Laptop",
52
- description: "A laptop",
52
+ name: Catalog_Examples$CatalogPlugin.laptop,
53
+ description: Catalog_Examples$CatalogPlugin.laptopDescription,
53
54
  price: 999.99,
54
- imageUrl: "/productImages/laptop.jpg"
55
+ imageUrl: Catalog_Examples$CatalogPlugin.laptopImage
55
56
  }), added));
56
57
  test("Add on existing aggregate returns ProductAlreadyExists", () => thenError(whenCmd(givenEvents([added]), {
57
58
  TAG: "Add",
@@ -62,7 +63,7 @@ describe("Product Behavior", () => {
62
63
  }), "ProductAlreadyExists"));
63
64
  test("UpdateName on non-existent aggregate returns ProductNotFound", () => thenError(whenCmd(givenEvents([]), {
64
65
  TAG: "UpdateName",
65
- name: "New Name"
66
+ name: Catalog_Examples$CatalogPlugin.renamedTo
66
67
  }), "ProductNotFound"));
67
68
  test("UpdateName on existing product produces NameUpdated", () => thenEvent(whenCmd(givenEvents([added]), {
68
69
  TAG: "UpdateName",
@@ -73,7 +74,7 @@ describe("Product Behavior", () => {
73
74
  }));
74
75
  test("UpdateName to same name produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([added]), {
75
76
  TAG: "UpdateName",
76
- name: "Laptop"
77
+ name: Catalog_Examples$CatalogPlugin.laptop
77
78
  })));
78
79
  test("UpdateDescription on non-existent aggregate returns ProductNotFound", () => thenError(whenCmd(givenEvents([]), {
79
80
  TAG: "UpdateDescription",
@@ -88,7 +89,7 @@ describe("Product Behavior", () => {
88
89
  }));
89
90
  test("UpdateDescription to same description produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([added]), {
90
91
  TAG: "UpdateDescription",
91
- description: "A laptop"
92
+ description: Catalog_Examples$CatalogPlugin.laptopDescription
92
93
  })));
93
94
  test("UpdatePrice on non-existent aggregate returns ProductNotFound", () => thenError(whenCmd(givenEvents([]), {
94
95
  TAG: "UpdatePrice",
@@ -107,7 +108,7 @@ describe("Product Behavior", () => {
107
108
  })));
108
109
  test("UpdateImage on non-existent aggregate returns ProductNotFound", () => thenError(whenCmd(givenEvents([]), {
109
110
  TAG: "UpdateImage",
110
- imageUrl: "/productImages/laptop.jpg"
111
+ imageUrl: Catalog_Examples$CatalogPlugin.laptopImage
111
112
  }), "ProductNotFound"));
112
113
  test("UpdateImage on existing product produces ImageUpdated", () => thenEvent(whenCmd(givenEvents([added]), {
113
114
  TAG: "UpdateImage",
@@ -118,7 +119,7 @@ describe("Product Behavior", () => {
118
119
  }));
119
120
  test("UpdateImage to the same ref produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([added]), {
120
121
  TAG: "UpdateImage",
121
- imageUrl: "/productImages/laptop.jpg"
122
+ imageUrl: Catalog_Examples$CatalogPlugin.laptopImage
122
123
  })));
123
124
  });
124
125
 
@@ -8,6 +8,7 @@ let added = Product.Added({
8
8
  })
9
9
 
10
10
  describe("Products ReadModel ← Product", () => {
11
+ // scenario-id: 81836c9a-93ca-4326-ad59-deceb23d8ab0
11
12
  test("Added sets initial read model state", () =>
12
13
  givenEvents([])
13
14
  ->whenEvent(added)
@@ -19,6 +20,7 @@ describe("Products ReadModel ← Product", () => {
19
20
  })
20
21
  )
21
22
 
23
+ // scenario-id: aaf1e1d4-f6b6-4d1d-904f-1cbb2e0af1dc
22
24
  test("NameUpdated updates the name", () =>
23
25
  givenEvents([added])
24
26
  ->whenEvent(Product.NameUpdated({name: "Gaming Laptop"}))
@@ -30,6 +32,7 @@ describe("Products ReadModel ← Product", () => {
30
32
  })
31
33
  )
32
34
 
35
+ // scenario-id: 30def838-8ffc-449c-be89-3632e993b1c7
33
36
  test("DescriptionUpdated updates the description", () =>
34
37
  givenEvents([added])
35
38
  ->whenEvent(Product.DescriptionUpdated({description: "A high-end laptop"}))
@@ -41,6 +44,7 @@ describe("Products ReadModel ← Product", () => {
41
44
  })
42
45
  )
43
46
 
47
+ // scenario-id: 087f6d0c-7258-4d90-a78e-90e0f2832f95
44
48
  test("PriceUpdated updates the price", () =>
45
49
  givenEvents([added])
46
50
  ->whenEvent(Product.PriceUpdated({price: 899.99}))
@@ -52,6 +56,7 @@ describe("Products ReadModel ← Product", () => {
52
56
  })
53
57
  )
54
58
 
59
+ // scenario-id: dbebb7b6-7db1-4405-8d4d-d5b5a6cc87df
55
60
  test("ImageUpdated updates the stored ref", () =>
56
61
  givenEvents([added])
57
62
  ->whenEvent(Product.ImageUpdated({imageUrl: "/productImages/laptop-v2.jpg"}))