@reventlessdev/online-shop-aggregates-ordering 3.0.0-alpha.169 → 3.0.0-alpha.170

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 (142) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/bs/.compiler.log +2 -2
  3. package/lib/bs/compiler-info.json +1 -1
  4. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmi +0 -0
  5. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmt +0 -0
  6. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  7. package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  8. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmi +0 -0
  9. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmt +0 -0
  10. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  11. package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  12. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmi +0 -0
  13. package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmt +0 -0
  14. package/lib/bs/src/Customer/Aggregate/Customer.ast +0 -0
  15. package/lib/bs/src/Customer/Aggregate/Customer.res +6 -2
  16. package/lib/bs/src/Customer/Aggregate/Customer.res.mjs +3 -2
  17. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmi +0 -0
  18. package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmt +0 -0
  19. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmi +0 -0
  20. package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmt +0 -0
  21. package/lib/bs/src/Customer/ReadModel/Customers.ast +0 -0
  22. package/lib/bs/src/Customer/ReadModel/Customers.res +4 -1
  23. package/lib/bs/src/Customer/ReadModel/Customers.res.mjs +2 -1
  24. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmi +0 -0
  25. package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmt +0 -0
  26. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
  27. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
  28. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  29. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  30. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmi +0 -0
  31. package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmt +0 -0
  32. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmi +0 -0
  33. package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmt +0 -0
  34. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmi +0 -0
  35. package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -0
  36. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmi +0 -0
  37. package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmt +0 -0
  38. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmi +0 -0
  39. package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
  40. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  41. package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  42. package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
  43. package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
  44. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
  45. package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
  46. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  47. package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  48. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  49. package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  50. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmi +0 -0
  51. package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmt +0 -0
  52. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.ast +0 -0
  53. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res +2 -2
  54. package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res.mjs +2 -2
  55. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmi +0 -0
  56. package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmt +0 -0
  57. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  58. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  59. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  60. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  61. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  62. package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  63. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmi +0 -0
  64. package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmt +0 -0
  65. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmi +0 -0
  66. package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmt +0 -0
  67. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmi +0 -0
  68. package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmt +0 -0
  69. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  70. package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  71. package/lib/ocaml/.compiler.log +2 -2
  72. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
  73. package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
  74. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  75. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  76. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
  77. package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
  78. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmi +0 -0
  79. package/lib/ocaml/CatalogProduct-OrderingPlugin.cmt +0 -0
  80. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
  81. package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
  82. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  83. package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  84. package/lib/ocaml/Customer-OrderingPlugin.cmi +0 -0
  85. package/lib/ocaml/Customer-OrderingPlugin.cmt +0 -0
  86. package/lib/ocaml/Customer.ast +0 -0
  87. package/lib/ocaml/Customer.res +6 -2
  88. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmi +0 -0
  89. package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmt +0 -0
  90. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmi +0 -0
  91. package/lib/ocaml/Customer_GWT-OrderingPlugin.cmt +0 -0
  92. package/lib/ocaml/Customer_GWT.ast +0 -0
  93. package/lib/ocaml/Customer_GWT.res +2 -2
  94. package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
  95. package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
  96. package/lib/ocaml/Customers.ast +0 -0
  97. package/lib/ocaml/Customers.res +4 -1
  98. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
  99. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
  100. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
  101. package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
  102. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
  103. package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
  104. package/lib/ocaml/Order-OrderingPlugin.cmi +0 -0
  105. package/lib/ocaml/Order-OrderingPlugin.cmt +0 -0
  106. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
  107. package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
  108. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmi +0 -0
  109. package/lib/ocaml/OrderNotifications-OrderingPlugin.cmt +0 -0
  110. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmi +0 -0
  111. package/lib/ocaml/Order_Behavior-OrderingPlugin.cmt +0 -0
  112. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmi +0 -0
  113. package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmt +0 -0
  114. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
  115. package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
  116. package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +0 -0
  117. package/lib/ocaml/Order_GWT-OrderingPlugin.cmt +0 -0
  118. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmi +0 -0
  119. package/lib/ocaml/Order_Mappings-OrderingPlugin.cmt +0 -0
  120. package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
  121. package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
  122. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  123. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  124. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  125. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  126. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
  127. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
  128. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmi +0 -0
  129. package/lib/ocaml/Orders_Projections-OrderingPlugin.cmt +0 -0
  130. package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
  131. package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
  132. package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
  133. package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
  134. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  135. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  136. package/package.json +7 -7
  137. package/src/Customer/Aggregate/Customer.res +6 -2
  138. package/src/Customer/Aggregate/Customer.res.mjs +3 -2
  139. package/src/Customer/ReadModel/Customers.res +4 -1
  140. package/src/Customer/ReadModel/Customers.res.mjs +2 -1
  141. package/tests/Customer/Aggregate/Customer_GWT.res +2 -2
  142. package/tests/Customer/Aggregate/Customer_GWT.res.mjs +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
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.170 (2026-07-30)
7
+
8
+ ### Features
9
+
10
+ * **spec:** semantic branded scalars — Email, Url, Phone, Percent, Color, Bytes, Duration ([2e64ff9](https://github.com/ReventlessDev/reventless-core/commit/2e64ff992e913c038a71659c731c25a104e3c5a9))
11
+
12
+
6
13
  # 3.0.0-alpha.169 (2026-07-30)
7
14
 
8
15
  ### Features
@@ -1,2 +1,2 @@
1
- #Start(1785388949969)
2
- #Done(1785388955343)
1
+ #Start(1785406695811)
2
+ #Done(1785406701142)
@@ -4,5 +4,5 @@
4
4
  "bsc_hash": "75e3a59c95cc953608fd3dd6ea6ed68141bba4414a20a52f114261b8a48385fa",
5
5
  "rescript_config_hash": "4c884bf958b93b21c77764e35498f269b81377cfcc324135f1ab7a1cc5b569cb",
6
6
  "runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
7
- "generated_at": "1785388955350"
7
+ "generated_at": "1785406701150"
8
8
  }
@@ -3,10 +3,14 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ // The command is where an address is first accepted, so it is where the type
7
+ // belongs — a value that reaches the log is already permanent. The events below
8
+ // stay plain `string`: they record what was accepted, and re-validating history
9
+ // on read is the risk a branded scalar exists to avoid.
6
10
  @schema
7
11
  type command =
8
- | Register({email: string, address: string})
9
- | UpdateEmail({email: string})
12
+ | Register({email: @s.matches(Reventless.Email.schema) string, address: string})
13
+ | UpdateEmail({email: @s.matches(Reventless.Email.schema) string})
10
14
  | UpdateAddress({address: string})
11
15
  | Deactivate
12
16
 
@@ -1,16 +1,17 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as S from "sury/src/S.res.mjs";
4
+ import * as Email$Reventless from "@reventlessdev/reventless-spec/src/semantic/Email.res.mjs";
4
5
 
5
6
  let commandSchema = S.union([
6
7
  S.schema(s => ({
7
8
  TAG: "Register",
8
- email: s.m(S.string),
9
+ email: s.m(Email$Reventless.schema),
9
10
  address: s.m(S.string)
10
11
  })),
11
12
  S.schema(s => ({
12
13
  TAG: "UpdateEmail",
13
- email: s.m(S.string)
14
+ email: s.m(Email$Reventless.schema)
14
15
  })),
15
16
  S.schema(s => ({
16
17
  TAG: "UpdateAddress",
@@ -3,9 +3,12 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ // Marked on the query side too, where it is what makes the field render as a
7
+ // mailto link instead of a text box: the AutoUI reads the semantic off this
8
+ // state schema, not off the command's.
6
9
  @schema
7
10
  type state = {
8
- email: string,
11
+ email: @s.matches(Reventless.Email.schema) string,
9
12
  address: string,
10
13
  deactivated: bool,
11
14
  }
@@ -1,10 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as S from "sury/src/S.res.mjs";
4
+ import * as Email$Reventless from "@reventlessdev/reventless-spec/src/semantic/Email.res.mjs";
4
5
  import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
5
6
 
6
7
  let stateSchema = S.schema(s => ({
7
- email: s.m(S.string),
8
+ email: s.m(Email$Reventless.schema),
8
9
  address: s.m(S.string),
9
10
  deactivated: s.m(S.bool)
10
11
  }));
@@ -24,7 +24,7 @@ describe("Customer Behavior", () => {
24
24
 
25
25
  test("UpdateEmail on non-existent aggregate returns CustomerNotFound", () =>
26
26
  givenEvents([])
27
- ->whenCmd(UpdateEmail({email: "x@y"}))
27
+ ->whenCmd(UpdateEmail({email: "bob@example.com"}))
28
28
  ->thenError(CustomerNotFound)
29
29
  )
30
30
 
@@ -45,7 +45,7 @@ describe("Customer Behavior", () => {
45
45
  Registered({email: "alice@example.com", address: "123 Main St"}),
46
46
  Deactivated,
47
47
  ])
48
- ->whenCmd(UpdateEmail({email: "x@y"}))
48
+ ->whenCmd(UpdateEmail({email: "bob@example.com"}))
49
49
  ->thenError(CustomerAlreadyDeactivated)
50
50
  )
51
51
 
@@ -70,7 +70,7 @@ describe("Customer Behavior", () => {
70
70
  }), "CustomerAlreadyDeactivated"));
71
71
  test("UpdateEmail on non-existent aggregate returns CustomerNotFound", () => thenError(whenCmd(givenEvents([]), {
72
72
  TAG: "UpdateEmail",
73
- email: "x@y"
73
+ email: "bob@example.com"
74
74
  }), "CustomerNotFound"));
75
75
  test("UpdateEmail on active customer produces EmailUpdated", () => thenEvent(whenCmd(givenEvents([{
76
76
  TAG: "Registered",
@@ -100,7 +100,7 @@ describe("Customer Behavior", () => {
100
100
  "Deactivated"
101
101
  ]), {
102
102
  TAG: "UpdateEmail",
103
- email: "x@y"
103
+ email: "bob@example.com"
104
104
  }), "CustomerAlreadyDeactivated"));
105
105
  test("UpdateAddress on non-existent aggregate returns CustomerNotFound", () => thenError(whenCmd(givenEvents([]), {
106
106
  TAG: "UpdateAddress",
@@ -1,2 +1,2 @@
1
- #Start(1785388949969)
2
- #Done(1785388955343)
1
+ #Start(1785406695811)
2
+ #Done(1785406701142)
Binary file
@@ -3,10 +3,14 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ // The command is where an address is first accepted, so it is where the type
7
+ // belongs — a value that reaches the log is already permanent. The events below
8
+ // stay plain `string`: they record what was accepted, and re-validating history
9
+ // on read is the risk a branded scalar exists to avoid.
6
10
  @schema
7
11
  type command =
8
- | Register({email: string, address: string})
9
- | UpdateEmail({email: string})
12
+ | Register({email: @s.matches(Reventless.Email.schema) string, address: string})
13
+ | UpdateEmail({email: @s.matches(Reventless.Email.schema) string})
10
14
  | UpdateAddress({address: string})
11
15
  | Deactivate
12
16
 
Binary file
@@ -24,7 +24,7 @@ describe("Customer Behavior", () => {
24
24
 
25
25
  test("UpdateEmail on non-existent aggregate returns CustomerNotFound", () =>
26
26
  givenEvents([])
27
- ->whenCmd(UpdateEmail({email: "x@y"}))
27
+ ->whenCmd(UpdateEmail({email: "bob@example.com"}))
28
28
  ->thenError(CustomerNotFound)
29
29
  )
30
30
 
@@ -45,7 +45,7 @@ describe("Customer Behavior", () => {
45
45
  Registered({email: "alice@example.com", address: "123 Main St"}),
46
46
  Deactivated,
47
47
  ])
48
- ->whenCmd(UpdateEmail({email: "x@y"}))
48
+ ->whenCmd(UpdateEmail({email: "bob@example.com"}))
49
49
  ->thenError(CustomerAlreadyDeactivated)
50
50
  )
51
51
 
Binary file
@@ -3,9 +3,12 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ // Marked on the query side too, where it is what makes the field render as a
7
+ // mailto link instead of a text box: the AutoUI reads the semantic off this
8
+ // state schema, not off the command's.
6
9
  @schema
7
10
  type state = {
8
- email: string,
11
+ email: @s.matches(Reventless.Email.schema) string,
9
12
  address: string,
10
13
  deactivated: bool,
11
14
  }
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-ordering",
3
- "version": "3.0.0-alpha.169",
3
+ "version": "3.0.0-alpha.170",
4
4
  "description": "Online Shop example — Ordering plugin (Customer & Order 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-alpha.4",
24
- "@reventlessdev/online-shop-aggregates-ordering-spec": "3.0.0-alpha.83",
25
- "@reventlessdev/online-shop-aggregates-catalog-spec": "3.0.0-alpha.83",
26
- "@reventlessdev/reventless-infra": "3.0.0-alpha.110",
27
- "@reventlessdev/reventless-gwt": "1.0.0-alpha.139",
24
+ "@reventlessdev/online-shop-aggregates-catalog-spec": "3.0.0-alpha.84",
28
25
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.17",
29
- "@reventlessdev/reventless-local": "3.0.0-alpha.180",
30
- "@reventlessdev/reventless-spec": "3.0.0-alpha.85"
26
+ "@reventlessdev/online-shop-aggregates-ordering-spec": "3.0.0-alpha.84",
27
+ "@reventlessdev/reventless-gwt": "1.0.0-alpha.140",
28
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.111",
29
+ "@reventlessdev/reventless-local": "3.0.0-alpha.181",
30
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.86"
31
31
  },
32
32
  "devDependencies": {
33
33
  "rescript": "12.3.0",
@@ -3,10 +3,14 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ // The command is where an address is first accepted, so it is where the type
7
+ // belongs — a value that reaches the log is already permanent. The events below
8
+ // stay plain `string`: they record what was accepted, and re-validating history
9
+ // on read is the risk a branded scalar exists to avoid.
6
10
  @schema
7
11
  type command =
8
- | Register({email: string, address: string})
9
- | UpdateEmail({email: string})
12
+ | Register({email: @s.matches(Reventless.Email.schema) string, address: string})
13
+ | UpdateEmail({email: @s.matches(Reventless.Email.schema) string})
10
14
  | UpdateAddress({address: string})
11
15
  | Deactivate
12
16
 
@@ -1,16 +1,17 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as S from "sury/src/S.res.mjs";
4
+ import * as Email$Reventless from "@reventlessdev/reventless-spec/src/semantic/Email.res.mjs";
4
5
 
5
6
  let commandSchema = S.union([
6
7
  S.schema(s => ({
7
8
  TAG: "Register",
8
- email: s.m(S.string),
9
+ email: s.m(Email$Reventless.schema),
9
10
  address: s.m(S.string)
10
11
  })),
11
12
  S.schema(s => ({
12
13
  TAG: "UpdateEmail",
13
- email: s.m(S.string)
14
+ email: s.m(Email$Reventless.schema)
14
15
  })),
15
16
  S.schema(s => ({
16
17
  TAG: "UpdateAddress",
@@ -3,9 +3,12 @@
3
3
 
4
4
  @@reventless.spec
5
5
 
6
+ // Marked on the query side too, where it is what makes the field render as a
7
+ // mailto link instead of a text box: the AutoUI reads the semantic off this
8
+ // state schema, not off the command's.
6
9
  @schema
7
10
  type state = {
8
- email: string,
11
+ email: @s.matches(Reventless.Email.schema) string,
9
12
  address: string,
10
13
  deactivated: bool,
11
14
  }
@@ -1,10 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as S from "sury/src/S.res.mjs";
4
+ import * as Email$Reventless from "@reventlessdev/reventless-spec/src/semantic/Email.res.mjs";
4
5
  import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
5
6
 
6
7
  let stateSchema = S.schema(s => ({
7
- email: s.m(S.string),
8
+ email: s.m(Email$Reventless.schema),
8
9
  address: s.m(S.string),
9
10
  deactivated: s.m(S.bool)
10
11
  }));
@@ -24,7 +24,7 @@ describe("Customer Behavior", () => {
24
24
 
25
25
  test("UpdateEmail on non-existent aggregate returns CustomerNotFound", () =>
26
26
  givenEvents([])
27
- ->whenCmd(UpdateEmail({email: "x@y"}))
27
+ ->whenCmd(UpdateEmail({email: "bob@example.com"}))
28
28
  ->thenError(CustomerNotFound)
29
29
  )
30
30
 
@@ -45,7 +45,7 @@ describe("Customer Behavior", () => {
45
45
  Registered({email: "alice@example.com", address: "123 Main St"}),
46
46
  Deactivated,
47
47
  ])
48
- ->whenCmd(UpdateEmail({email: "x@y"}))
48
+ ->whenCmd(UpdateEmail({email: "bob@example.com"}))
49
49
  ->thenError(CustomerAlreadyDeactivated)
50
50
  )
51
51
 
@@ -70,7 +70,7 @@ describe("Customer Behavior", () => {
70
70
  }), "CustomerAlreadyDeactivated"));
71
71
  test("UpdateEmail on non-existent aggregate returns CustomerNotFound", () => thenError(whenCmd(givenEvents([]), {
72
72
  TAG: "UpdateEmail",
73
- email: "x@y"
73
+ email: "bob@example.com"
74
74
  }), "CustomerNotFound"));
75
75
  test("UpdateEmail on active customer produces EmailUpdated", () => thenEvent(whenCmd(givenEvents([{
76
76
  TAG: "Registered",
@@ -100,7 +100,7 @@ describe("Customer Behavior", () => {
100
100
  "Deactivated"
101
101
  ]), {
102
102
  TAG: "UpdateEmail",
103
- email: "x@y"
103
+ email: "bob@example.com"
104
104
  }), "CustomerAlreadyDeactivated"));
105
105
  test("UpdateAddress on non-existent aggregate returns CustomerNotFound", () => thenError(whenCmd(givenEvents([]), {
106
106
  TAG: "UpdateAddress",