@reventlessdev/online-shop-aggregates-ordering 3.0.0-alpha.300 → 3.0.0-alpha.302
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 +15 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/compiler-info.json +1 -1
- 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 -6
- package/lib/bs/src/Customer/Aggregate/Customer.res.mjs +9 -8
- package/lib/bs/src/Customer/Aggregate/Customer_Decision-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Decision-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Decision.ast +0 -0
- package/lib/bs/src/Customer/Aggregate/Customer_Decision.res +11 -7
- package/lib/bs/src/Customer/Aggregate/Customer_Decision.res.mjs +46 -33
- 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/Customer/ReadModel/Customers_Projections.ast +0 -0
- package/lib/bs/src/Customer/ReadModel/Customers_Projections.res +15 -3
- package/lib/bs/src/Customer/ReadModel/Customers_Projections.res.mjs +5 -4
- 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/LifecycleModel-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/LifecycleModel-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/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 +12 -12
- package/lib/bs/tests/Customer/Aggregate/Customer_GWT.res.mjs +88 -22
- 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/Customer/ReadModel/Customers_GWT.ast +0 -0
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res +14 -6
- package/lib/bs/tests/Customer/ReadModel/Customers_GWT.res.mjs +40 -10
- 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_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_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 -6
- package/lib/ocaml/Customer_Decision-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customer_Decision-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customer_Decision.ast +0 -0
- package/lib/ocaml/Customer_Decision.res +11 -7
- 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 +12 -12
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers_GWT.ast +0 -0
- package/lib/ocaml/Customers_GWT.res +14 -6
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_Projections-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers_Projections.ast +0 -0
- package/lib/ocaml/Customers_Projections.res +15 -3
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/EmailService_Mock-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/LifecycleModel-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/LifecycleModel-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_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/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 -6
- package/src/Customer/Aggregate/Customer.res.mjs +9 -8
- package/src/Customer/Aggregate/Customer_Decision.res +11 -7
- package/src/Customer/Aggregate/Customer_Decision.res.mjs +46 -33
- package/src/Customer/ReadModel/Customers_Projections.res +15 -3
- package/src/Customer/ReadModel/Customers_Projections.res.mjs +5 -4
- package/tests/Customer/Aggregate/Customer_GWT.res +12 -12
- package/tests/Customer/Aggregate/Customer_GWT.res.mjs +88 -22
- package/tests/Customer/ReadModel/Customers_GWT.res +14 -6
- package/tests/Customer/ReadModel/Customers_GWT.res.mjs +40 -10
|
@@ -4,27 +4,35 @@ describe("Customers ReadModel ← Customer", () => {
|
|
|
4
4
|
// scenario-id: d64df451-1238-400b-b146-4bd84dfb232b
|
|
5
5
|
test("Registered sets initial read model state", () =>
|
|
6
6
|
givenEvents([])
|
|
7
|
-
->whenEvent(
|
|
7
|
+
->whenEvent(
|
|
8
|
+
Customer.Registered({email: Value("alice@example.com"), address: Value("123 Main St")}),
|
|
9
|
+
)
|
|
8
10
|
->thenState({Customers.email: "alice@example.com", address: "123 Main St", deactivated: false})
|
|
9
11
|
)
|
|
10
12
|
|
|
11
13
|
// scenario-id: 80d62196-a14f-4da6-9993-384996b0be93
|
|
12
14
|
test("EmailUpdated updates the email", () =>
|
|
13
|
-
givenEvents([
|
|
14
|
-
|
|
15
|
+
givenEvents([
|
|
16
|
+
Customer.Registered({email: Value("alice@example.com"), address: Value("123 Main St")}),
|
|
17
|
+
])
|
|
18
|
+
->whenEvent(Customer.EmailUpdated({email: Value("alice2@example.com")}))
|
|
15
19
|
->thenState({Customers.email: "alice2@example.com", address: "123 Main St", deactivated: false})
|
|
16
20
|
)
|
|
17
21
|
|
|
18
22
|
// scenario-id: 55ce1763-d498-440d-8c19-2dc8adfa69e2
|
|
19
23
|
test("AddressUpdated updates the address", () =>
|
|
20
|
-
givenEvents([
|
|
21
|
-
|
|
24
|
+
givenEvents([
|
|
25
|
+
Customer.Registered({email: Value("alice@example.com"), address: Value("123 Main St")}),
|
|
26
|
+
])
|
|
27
|
+
->whenEvent(Customer.AddressUpdated({address: Value("789 Pine Rd")}))
|
|
22
28
|
->thenState({Customers.email: "alice@example.com", address: "789 Pine Rd", deactivated: false})
|
|
23
29
|
)
|
|
24
30
|
|
|
25
31
|
// scenario-id: 9885a011-7448-431f-ae96-629aae5f9823
|
|
26
32
|
test("Deactivated sets deactivated flag", () =>
|
|
27
|
-
givenEvents([
|
|
33
|
+
givenEvents([
|
|
34
|
+
Customer.Registered({email: Value("alice@example.com"), address: Value("123 Main St")}),
|
|
35
|
+
])
|
|
28
36
|
->whenEvent(Customer.Deactivated)
|
|
29
37
|
->thenState({Customers.email: "alice@example.com", address: "123 Main St", deactivated: true})
|
|
30
38
|
)
|
|
@@ -18,8 +18,14 @@ let thenState = include.thenState;
|
|
|
18
18
|
describe("Customers ReadModel ← Customer", () => {
|
|
19
19
|
test("Registered sets initial read model state", undefined, () => thenState(whenEvent(givenEvents([]), {
|
|
20
20
|
TAG: "Registered",
|
|
21
|
-
email:
|
|
22
|
-
|
|
21
|
+
email: {
|
|
22
|
+
TAG: "Value",
|
|
23
|
+
_0: "alice@example.com"
|
|
24
|
+
},
|
|
25
|
+
address: {
|
|
26
|
+
TAG: "Value",
|
|
27
|
+
_0: "123 Main St"
|
|
28
|
+
}
|
|
23
29
|
}), {
|
|
24
30
|
email: "alice@example.com",
|
|
25
31
|
address: "123 Main St",
|
|
@@ -27,11 +33,20 @@ describe("Customers ReadModel ← Customer", () => {
|
|
|
27
33
|
}));
|
|
28
34
|
test("EmailUpdated updates the email", undefined, () => thenState(whenEvent(givenEvents([{
|
|
29
35
|
TAG: "Registered",
|
|
30
|
-
email:
|
|
31
|
-
|
|
36
|
+
email: {
|
|
37
|
+
TAG: "Value",
|
|
38
|
+
_0: "alice@example.com"
|
|
39
|
+
},
|
|
40
|
+
address: {
|
|
41
|
+
TAG: "Value",
|
|
42
|
+
_0: "123 Main St"
|
|
43
|
+
}
|
|
32
44
|
}]), {
|
|
33
45
|
TAG: "EmailUpdated",
|
|
34
|
-
email:
|
|
46
|
+
email: {
|
|
47
|
+
TAG: "Value",
|
|
48
|
+
_0: "alice2@example.com"
|
|
49
|
+
}
|
|
35
50
|
}), {
|
|
36
51
|
email: "alice2@example.com",
|
|
37
52
|
address: "123 Main St",
|
|
@@ -39,11 +54,20 @@ describe("Customers ReadModel ← Customer", () => {
|
|
|
39
54
|
}));
|
|
40
55
|
test("AddressUpdated updates the address", undefined, () => thenState(whenEvent(givenEvents([{
|
|
41
56
|
TAG: "Registered",
|
|
42
|
-
email:
|
|
43
|
-
|
|
57
|
+
email: {
|
|
58
|
+
TAG: "Value",
|
|
59
|
+
_0: "alice@example.com"
|
|
60
|
+
},
|
|
61
|
+
address: {
|
|
62
|
+
TAG: "Value",
|
|
63
|
+
_0: "123 Main St"
|
|
64
|
+
}
|
|
44
65
|
}]), {
|
|
45
66
|
TAG: "AddressUpdated",
|
|
46
|
-
address:
|
|
67
|
+
address: {
|
|
68
|
+
TAG: "Value",
|
|
69
|
+
_0: "789 Pine Rd"
|
|
70
|
+
}
|
|
47
71
|
}), {
|
|
48
72
|
email: "alice@example.com",
|
|
49
73
|
address: "789 Pine Rd",
|
|
@@ -51,8 +75,14 @@ describe("Customers ReadModel ← Customer", () => {
|
|
|
51
75
|
}));
|
|
52
76
|
test("Deactivated sets deactivated flag", undefined, () => thenState(whenEvent(givenEvents([{
|
|
53
77
|
TAG: "Registered",
|
|
54
|
-
email:
|
|
55
|
-
|
|
78
|
+
email: {
|
|
79
|
+
TAG: "Value",
|
|
80
|
+
_0: "alice@example.com"
|
|
81
|
+
},
|
|
82
|
+
address: {
|
|
83
|
+
TAG: "Value",
|
|
84
|
+
_0: "123 Main St"
|
|
85
|
+
}
|
|
56
86
|
}]), "Deactivated"), {
|
|
57
87
|
email: "alice@example.com",
|
|
58
88
|
address: "123 Main St",
|