@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.
- package/CHANGELOG.md +7 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/Aggregate/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer.ast +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer.res +6 -2
- package/lib/bs/src/Customer/Aggregate/Customer.res.mjs +3 -2
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers.ast +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers.res +4 -1
- package/lib/bs/src/Customer/ReadModel/Customers.res.mjs +2 -1
- package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Aggregate/Order_Mappings-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/ReadModel/Orders-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/ReadModel/Orders_Projections-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/SideEffect/Order_EmailNotification-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Task/OrderNotifications-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/Aggregate/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/ReadModel/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT.ast +0 -0
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res +2 -2
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res.mjs +2 -2
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/Aggregate/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/Aggregate/Order_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/ReadModel/Orders_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/SideEffect/EmailService_Mock-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/SideEffect/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer.ast +0 -0
- package/lib/ocaml/Customer.res +6 -2
- package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer_GWT.ast +0 -0
- package/lib/ocaml/Customer_GWT.res +2 -2
- package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers.ast +0 -0
- package/lib/ocaml/Customers.res +4 -1
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderMappings_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderNotifications-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderNotifications-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_EmailNotification-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_EmailNotification_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Order_Mappings-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Order_Mappings-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/package.json +7 -7
- package/src/Customer/Aggregate/Customer.res +6 -2
- package/src/Customer/Aggregate/Customer.res.mjs +3 -2
- package/src/Customer/ReadModel/Customers.res +4 -1
- package/src/Customer/ReadModel/Customers.res.mjs +2 -1
- package/tests/Customer/Aggregate/Customer_GWT.res +2 -2
- 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
|
package/lib/bs/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
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": "
|
|
7
|
+
"generated_at": "1785406701150"
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmi
CHANGED
|
Binary file
|
package/lib/bs/src/CatalogProduct/ReadModel/AvailableProducts_Projections-OrderingPlugin.cmt
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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
|
|
|
@@ -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(
|
|
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(
|
|
14
|
+
email: s.m(Email$Reventless.schema)
|
|
14
15
|
})),
|
|
15
16
|
S.schema(s => ({
|
|
16
17
|
TAG: "UpdateAddress",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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
|
}
|
|
@@ -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(
|
|
8
|
+
email: s.m(Email$Reventless.schema),
|
|
8
9
|
address: s.m(S.string),
|
|
9
10
|
deactivated: s.m(S.bool)
|
|
10
11
|
}));
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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",
|
|
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/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1785406695811)
|
|
2
|
+
#Done(1785406701142)
|
|
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/Customer.ast
CHANGED
|
Binary file
|
package/lib/ocaml/Customer.res
CHANGED
|
@@ -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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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: "
|
|
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: "
|
|
48
|
+
->whenCmd(UpdateEmail({email: "bob@example.com"}))
|
|
49
49
|
->thenError(CustomerAlreadyDeactivated)
|
|
50
50
|
)
|
|
51
51
|
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/Customers.ast
CHANGED
|
Binary file
|
package/lib/ocaml/Customers.res
CHANGED
|
@@ -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
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/online-shop-aggregates-ordering",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
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-
|
|
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/
|
|
30
|
-
"@reventlessdev/reventless-
|
|
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(
|
|
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(
|
|
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(
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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",
|