@reventlessdev/online-shop-hybrid-ordering 1.0.0-alpha.280 → 1.0.0-alpha.282
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 +27 -0
- package/package.json +10 -10
- package/src/CatalogProduct/StateChange/{SyncCatalogProduct_Behavior.res → SyncCatalogProduct_Decision.res} +4 -4
- package/src/CatalogProduct/StateChange/{SyncCatalogProduct_Behavior.res.mjs → SyncCatalogProduct_Decision.res.mjs} +1 -1
- package/src/CatalogProduct/StateViewStream/AvailableProducts.res +1 -1
- package/src/CatalogProduct/StateViewStream/AvailableProducts.res.mjs +0 -3
- package/src/Customer/Aggregate/{Customer_Behavior.res → Customer_Decision.res} +2 -2
- package/src/Customer/Aggregate/{Customer_Behavior.res.mjs → Customer_Decision.res.mjs} +1 -1
- package/src/Customer/StateChange/{EmailVerificationChallenges_Behavior.res → EmailVerificationChallenges_Decision.res} +1 -1
- package/src/Customer/StateChange/{EmailVerificationChallenges_Behavior.res.mjs → EmailVerificationChallenges_Decision.res.mjs} +1 -1
- package/src/Notification/Automation/NotificationIntake_Automation.res +1 -1
- package/src/Notification/Automation/NotificationIntake_Automation.res.mjs +2 -2
- package/src/Notification/StateChange/{NotificationPreferences_Behavior.res → NotificationPreferences_Decision.res} +1 -1
- package/src/Notification/StateChange/{NotificationPreferences_Behavior.res.mjs → NotificationPreferences_Decision.res.mjs} +1 -1
- package/src/Notification/StateChange/{NotificationSourceClaims_Behavior.res → NotificationSourceClaims_Decision.res} +1 -1
- package/src/Notification/StateChange/{NotificationSourceClaims_Behavior.res.mjs → NotificationSourceClaims_Decision.res.mjs} +1 -1
- package/src/Notification/StateViewStream/NotificationDeliveries.res.mjs +1 -4
- package/src/Notification/StateViewStream/NotificationSubscriptions.res.mjs +1 -4
- package/src/Notification/StateViewStream/NotificationSubscriptions_Projection.res +1 -1
- package/src/Notification/StateViewStream/NotificationSubscriptions_Projection.res.mjs +3 -3
- package/src/Order/StateChange/{CancelOrder_Behavior.res → CancelOrder_Decision.res} +2 -2
- package/src/Order/StateChange/{CancelOrder_Behavior.res.mjs → CancelOrder_Decision.res.mjs} +1 -1
- package/src/Order/StateChange/PlaceOrder.res +1 -1
- package/src/Order/StateChange/{PlaceOrder_Behavior.res → PlaceOrder_Decision.res} +2 -2
- package/src/Order/StateChange/{PlaceOrder_Behavior.res.mjs → PlaceOrder_Decision.res.mjs} +1 -1
- package/src/Order/StateChange/{ShipOrder_Behavior.res → ShipOrder_Decision.res} +1 -1
- package/src/Order/StateChange/{ShipOrder_Behavior.res.mjs → ShipOrder_Decision.res.mjs} +1 -1
- package/src/Order/StateViewStream/Orders.res +1 -1
- package/src/Order/StateViewStream/Orders.res.mjs +0 -3
- package/src/Plugin.res +8 -8
- package/src/Plugin.res.mjs +44 -44
- package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +8 -8
- package/tests/CatalogProduct/StateViewStream/AvailableProducts_GWT.res.mjs +1 -1
- package/tests/Customer/AddressGeocodingConformance_GWT.res +1 -1
- package/tests/Customer/AddressGeocodingConformance_GWT.res.mjs +7 -7
- package/tests/Customer/Aggregate/Customer_GWT.res +1 -1
- package/tests/Customer/Aggregate/Customer_GWT.res.mjs +10 -10
- package/tests/Customer/StateChange/EmailVerificationChallenges_GWT.res.mjs +8 -8
- package/tests/Flow/OrderingFlow_GWT.res +4 -4
- package/tests/Flow/OrderingFlow_GWT.res.mjs +13 -13
- package/tests/Notification/NotificationConformance_GWT.res +9 -9
- package/tests/Notification/NotificationConformance_GWT.res.mjs +14 -14
- package/tests/Notification/StateChange/NotificationPreferences_GWT.res.mjs +8 -8
- package/tests/Notification/StateChange/NotificationSourceClaims_GWT.res.mjs +8 -8
- package/tests/Notification/StateViewStream/NotificationDeliveries_GWT.res.mjs +1 -1
- package/tests/Order/StateChange/CancelOrder_GWT.res +2 -2
- package/tests/Order/StateChange/CancelOrder_GWT.res.mjs +10 -10
- package/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +8 -8
- package/tests/Order/StateChange/ShipOrder_GWT.res +2 -2
- package/tests/Order/StateChange/ShipOrder_GWT.res.mjs +10 -10
- package/tests/Order/StateViewStream/Orders_GWT.res.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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
|
+
# 1.0.0-alpha.282 (2026-10-21)
|
|
7
|
+
|
|
8
|
+
* feat!: a state view's row key is module Id ([08c9726](https://github.com/ReventlessDev/reventless-core/commit/08c972659a3d689a39fd5e2f2026597155e92210))
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* a state view spec declares its row key as module Id. A
|
|
13
|
+
hand-written module Key in a spec under StateView/ or StateViewStream/
|
|
14
|
+
fails the build with "A state view's row key is `module Id`, not
|
|
15
|
+
`module Key`".
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# 1.0.0-alpha.281 (2026-10-21)
|
|
20
|
+
|
|
21
|
+
* feat!: the write-side logic module is called the decision, and a codemod moves an app over ([cb573ff](https://github.com/ReventlessDev/reventless-core/commit/cb573ff5b928c7d7f3e75988dfaa65066f8c95eb))
|
|
22
|
+
|
|
23
|
+
### BREAKING CHANGES
|
|
24
|
+
|
|
25
|
+
* <Spec>_Behavior.res, @@reventless.behavior,
|
|
26
|
+
Reventless.Behavior.T, StateChangeSlice.Behavior, Behavior_GWT and
|
|
27
|
+
thenRefused no longer exist. Run `npx reventless-rename-to-decision` at an
|
|
28
|
+
app's root, then rebuild; comments are not rewritten. The PPX must be the
|
|
29
|
+
matching release.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# 1.0.0-alpha.280 (2026-10-19)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @reventlessdev/online-shop-hybrid-ordering
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/online-shop-hybrid-ordering",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.282",
|
|
4
4
|
"description": "Online Shop Hybrid example — Ordering plugin (Customer aggregate + Order/CatalogProduct DCB)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -21,20 +21,20 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"sury": "11.0.0",
|
|
24
|
-
"@reventlessdev/online-shop-hybrid-
|
|
25
|
-
"@reventlessdev/online-shop-hybrid-ordering-spec": "1.0.0-alpha.165",
|
|
26
|
-
"@reventlessdev/reventless-infra": "3.0.0-alpha.197",
|
|
27
|
-
"@reventlessdev/reventless-gwt": "1.0.0-alpha.248",
|
|
24
|
+
"@reventlessdev/online-shop-hybrid-ordering-spec": "1.0.0-alpha.167",
|
|
28
25
|
"@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
|
|
29
|
-
"@reventlessdev/
|
|
30
|
-
"@reventlessdev/
|
|
31
|
-
"@reventlessdev/reventless-
|
|
32
|
-
"@reventlessdev/reventless-local": "3.0.0-alpha.
|
|
26
|
+
"@reventlessdev/online-shop-hybrid-catalog-spec": "1.0.0-alpha.168",
|
|
27
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.250",
|
|
28
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.199",
|
|
29
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.293",
|
|
30
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.171",
|
|
31
|
+
"@reventlessdev/trait-address-geocoding": "1.0.0-alpha.52",
|
|
32
|
+
"@reventlessdev/trait-notification": "1.0.0-alpha.52"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"rescript": "12.3.1",
|
|
36
36
|
"sury-ppx": "11.0.0",
|
|
37
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
37
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.104"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"rescript": "^12.3.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@@reventless.
|
|
1
|
+
@@reventless.decision
|
|
2
2
|
|
|
3
|
-
// No price until one has been synced — see
|
|
3
|
+
// No price until one has been synced — see ChangeProductPrice_Decision for why
|
|
4
4
|
// a money field's "empty" is an absence rather than a zero.
|
|
5
5
|
//
|
|
6
6
|
// `withdrawn` sits beside the shadow rather than replacing it: a withdrawn
|
|
@@ -11,7 +11,7 @@ type state = {
|
|
|
11
11
|
price: option<Reventless.Money.t>,
|
|
12
12
|
withdrawn: bool,
|
|
13
13
|
// The picture last announced, kept for the same reason `name` is: so a repeat
|
|
14
|
-
// of the same announcement can be
|
|
14
|
+
// of the same announcement can be recognized and dropped.
|
|
15
15
|
productImage: option<Reventless.UploadableImage.t>,
|
|
16
16
|
}
|
|
17
17
|
let initialState = {name: "", price: None, withdrawn: false, productImage: None}
|
|
@@ -60,7 +60,7 @@ let decide = (state, command) =>
|
|
|
60
60
|
}
|
|
61
61
|
// Idempotent like the rest: Catalog re-announcing the same picture is the
|
|
62
62
|
// ordinary shape of at-least-once delivery, not a change.
|
|
63
|
-
// Compared as options, so "the picture is gone" is
|
|
63
|
+
// Compared as options, so "the picture is gone" is recognized as a change and
|
|
64
64
|
// re-announcing the same absence is not.
|
|
65
65
|
| ChangeSyncedProductImage({productId, ?productImage}) =>
|
|
66
66
|
if state.productImage == productImage {
|
|
@@ -153,7 +153,7 @@ let initialState = {
|
|
|
153
153
|
productImage: undefined
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateChange/
|
|
156
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateChange/SyncCatalogProduct_Decision.res.mjs";
|
|
157
157
|
|
|
158
158
|
export {
|
|
159
159
|
Spec,
|
|
@@ -67,8 +67,6 @@ let name = "AvailableProducts";
|
|
|
67
67
|
|
|
68
68
|
let Id;
|
|
69
69
|
|
|
70
|
-
let Key;
|
|
71
|
-
|
|
72
70
|
let subIdConfig;
|
|
73
71
|
|
|
74
72
|
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateViewStream/AvailableProducts.res.mjs";
|
|
@@ -80,7 +78,6 @@ let visibility = "Internal";
|
|
|
80
78
|
export {
|
|
81
79
|
name,
|
|
82
80
|
Id,
|
|
83
|
-
Key,
|
|
84
81
|
consumedEventSchema,
|
|
85
82
|
config,
|
|
86
83
|
subIdConfig,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Customer aggregate
|
|
1
|
+
// Customer aggregate decision.
|
|
2
2
|
// Implements the state machine for registering and managing customers.
|
|
3
3
|
|
|
4
|
-
@@reventless.
|
|
4
|
+
@@reventless.decision
|
|
5
5
|
|
|
6
6
|
// Staleness, redelivery and the client-supplied pair are the geocoding trait's
|
|
7
7
|
// rules; this aggregate keeps the fields they read and names the facts they allow.
|
|
@@ -334,7 +334,7 @@ let initialState = "NotCreated";
|
|
|
334
334
|
|
|
335
335
|
let Verification;
|
|
336
336
|
|
|
337
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/Aggregate/
|
|
337
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/Aggregate/Customer_Decision.res.mjs";
|
|
338
338
|
|
|
339
339
|
let snapshot;
|
|
340
340
|
|
|
@@ -165,7 +165,7 @@ let initialState = {
|
|
|
165
165
|
|
|
166
166
|
let policy = ContactVerification$OrderingPlugin.emailPolicy;
|
|
167
167
|
|
|
168
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/StateChange/
|
|
168
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/StateChange/EmailVerificationChallenges_Decision.res.mjs";
|
|
169
169
|
|
|
170
170
|
export {
|
|
171
171
|
Spec,
|
|
@@ -147,7 +147,7 @@ let process = (id, item: NotificationIntake.todoItem) =>
|
|
|
147
147
|
recipientId,
|
|
148
148
|
NotificationIntake.RequestNotification({
|
|
149
149
|
recipientId,
|
|
150
|
-
category:
|
|
150
|
+
category: NotificationPreferences_Decision.categoryOf(rule.category),
|
|
151
151
|
reference: id,
|
|
152
152
|
subjectType: rule.subjectType,
|
|
153
153
|
subjectRef: Rule.subjectOf(rule, ~payload),
|
|
@@ -10,7 +10,7 @@ import * as CustomerId$OrderingPlugin from "../../Customer/CustomerId.res.mjs";
|
|
|
10
10
|
import * as AutomationSlice$Reventless from "@reventlessdev/reventless-spec/src/components/AutomationSlice.res.mjs";
|
|
11
11
|
import * as NotificationIntake$OrderingPlugin from "./NotificationIntake.res.mjs";
|
|
12
12
|
import * as Notification_Rule$TraitNotification from "@reventlessdev/trait-notification/src/Notification_Rule.res.mjs";
|
|
13
|
-
import * as
|
|
13
|
+
import * as NotificationPreferences_Decision$OrderingPlugin from "../StateChange/NotificationPreferences_Decision.res.mjs";
|
|
14
14
|
|
|
15
15
|
let M = AutomationSlice$Reventless.Mappings.Make({
|
|
16
16
|
name: NotificationIntake$OrderingPlugin.name,
|
|
@@ -176,7 +176,7 @@ function process(id, item, param) {
|
|
|
176
176
|
{
|
|
177
177
|
TAG: "RequestNotification",
|
|
178
178
|
recipientId: match$1,
|
|
179
|
-
category:
|
|
179
|
+
category: NotificationPreferences_Decision$OrderingPlugin.categoryOf(rule.category),
|
|
180
180
|
reference: id,
|
|
181
181
|
subjectType: rule.subjectType,
|
|
182
182
|
subjectRef: Notification_Rule$TraitNotification.subjectOf(rule, payload),
|
|
@@ -323,7 +323,7 @@ let Rules;
|
|
|
323
323
|
|
|
324
324
|
let initialState = Notification_Rules$TraitNotification.empty;
|
|
325
325
|
|
|
326
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/
|
|
326
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationPreferences_Decision.res.mjs";
|
|
327
327
|
|
|
328
328
|
export {
|
|
329
329
|
Spec,
|
|
@@ -76,7 +76,7 @@ let Rules;
|
|
|
76
76
|
|
|
77
77
|
let initialState = Notification_Rules$TraitNotification.empty;
|
|
78
78
|
|
|
79
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/
|
|
79
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationSourceClaims_Decision.res.mjs";
|
|
80
80
|
|
|
81
81
|
export {
|
|
82
82
|
Spec,
|
|
@@ -114,8 +114,6 @@ let name = "NotificationDeliveries";
|
|
|
114
114
|
|
|
115
115
|
let Id;
|
|
116
116
|
|
|
117
|
-
let Key;
|
|
118
|
-
|
|
119
117
|
let subIdConfig;
|
|
120
118
|
|
|
121
119
|
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewStream/NotificationDeliveries.res.mjs";
|
|
@@ -126,11 +124,10 @@ let visibility = "Public";
|
|
|
126
124
|
|
|
127
125
|
export {
|
|
128
126
|
name,
|
|
129
|
-
Id,
|
|
130
127
|
outcomeSchema,
|
|
131
128
|
consumedEventSchema,
|
|
132
129
|
config,
|
|
133
|
-
|
|
130
|
+
Id,
|
|
134
131
|
subIdConfig,
|
|
135
132
|
stateSchema$1 as stateSchema,
|
|
136
133
|
moduleUrl,
|
|
@@ -58,8 +58,6 @@ let name = "NotificationSubscriptions";
|
|
|
58
58
|
|
|
59
59
|
let Id;
|
|
60
60
|
|
|
61
|
-
let Key;
|
|
62
|
-
|
|
63
61
|
let subIdConfig;
|
|
64
62
|
|
|
65
63
|
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewStream/NotificationSubscriptions.res.mjs";
|
|
@@ -70,12 +68,11 @@ let visibility = "Public";
|
|
|
70
68
|
|
|
71
69
|
export {
|
|
72
70
|
name,
|
|
73
|
-
Id,
|
|
74
71
|
subscriptionSchema,
|
|
75
72
|
stateSchema$1 as stateSchema,
|
|
76
73
|
consumedEventSchema,
|
|
77
74
|
config,
|
|
78
|
-
|
|
75
|
+
Id,
|
|
79
76
|
subIdConfig,
|
|
80
77
|
moduleUrl,
|
|
81
78
|
authorization,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
4
|
import * as Notification_Rules$TraitNotification from "@reventlessdev/trait-notification/src/Notification_Rules.res.mjs";
|
|
5
|
-
import * as
|
|
5
|
+
import * as NotificationPreferences_Decision$OrderingPlugin from "../StateChange/NotificationPreferences_Decision.res.mjs";
|
|
6
6
|
|
|
7
7
|
let categories = [
|
|
8
8
|
"OrderConfirmation",
|
|
@@ -18,8 +18,8 @@ function defaultMatrix(email) {
|
|
|
18
18
|
});
|
|
19
19
|
return categories.flatMap(category => Notification_Rules$TraitNotification.channels.map(channel => ({
|
|
20
20
|
category: category,
|
|
21
|
-
channel:
|
|
22
|
-
enabled:
|
|
21
|
+
channel: NotificationPreferences_Decision$OrderingPlugin.channelOf(channel),
|
|
22
|
+
enabled: NotificationPreferences_Decision$OrderingPlugin.posture(NotificationPreferences_Decision$OrderingPlugin.categoryKey(category), channel),
|
|
23
23
|
deliverable: Stdlib_Option.isSome(Notification_Rules$TraitNotification.addressFor(announced, channel))
|
|
24
24
|
})));
|
|
25
25
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@@reventless.
|
|
1
|
+
@@reventless.decision
|
|
2
2
|
|
|
3
3
|
// Where the order is, as one value rather than a pair of flags that could
|
|
4
4
|
// represent `shipped && cancelled`. `productIds` rides alongside because the
|
|
@@ -33,7 +33,7 @@ let decide = (state, command) =>
|
|
|
33
33
|
| (Placed, ReopenOrder(_)) => Ok([]) // idempotent — already open
|
|
34
34
|
// A shipped order is not a cancelled one, and reopening it is not a repeat of
|
|
35
35
|
// anything: accepting it silently told the caller their request had been
|
|
36
|
-
//
|
|
36
|
+
// honored while the order stayed shipped.
|
|
37
37
|
| (Shipped, ReopenOrder(_)) => Error(OrderAlreadyShipped)
|
|
38
38
|
| (Cancelled, ReopenOrder({orderId: theId})) => Ok([OrderReopened({orderId: theId})])
|
|
39
39
|
}
|
|
@@ -83,7 +83,7 @@ function decide(state, command) {
|
|
|
83
83
|
|
|
84
84
|
let Spec;
|
|
85
85
|
|
|
86
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/
|
|
86
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/CancelOrder_Decision.res.mjs";
|
|
87
87
|
|
|
88
88
|
export {
|
|
89
89
|
Spec,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// The price is read for the same reason the name is, and it is why pricing an
|
|
14
14
|
// order costs nothing here: Ordering already shadows what a placement needs to
|
|
15
15
|
// decide, so the total is computed from this fold rather than from a cross-plugin
|
|
16
|
-
// read or a read-model query issued out of a
|
|
16
|
+
// read or a read-model query issued out of a decision.
|
|
17
17
|
@schema
|
|
18
18
|
type consumedEvent =
|
|
19
19
|
| OrderPlaced({orderId: OrderId.t})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@@reventless.
|
|
1
|
+
@@reventless.decision
|
|
2
2
|
|
|
3
3
|
// Stored as immutable arrays (rather than `Set.t`) so each fold yields a fresh
|
|
4
4
|
// state — `evolve` returns a new record instead of mutating a shared one. This
|
|
@@ -93,7 +93,7 @@ let mergeLines = (lineItems: array<lineItem>): array<lineItem> =>
|
|
|
93
93
|
|
|
94
94
|
// Prices one merged line from the shelf as the fold holds it. `Money.times` owns
|
|
95
95
|
// the multiplication — `amount *. float(quantity)` here is exactly the arithmetic
|
|
96
|
-
// that module exists to keep out of a
|
|
96
|
+
// that module exists to keep out of a decision — and refuses a product past the
|
|
97
97
|
// range where a float is still an exact integer, which is a quantity nobody meant.
|
|
98
98
|
let priceLine = (state, {productId, quantity}: lineItem): result<orderLine, error> =>
|
|
99
99
|
switch state.shelf->lookup(productId) {
|
|
@@ -302,7 +302,7 @@ function decide(state, command) {
|
|
|
302
302
|
|
|
303
303
|
let Spec;
|
|
304
304
|
|
|
305
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/
|
|
305
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/PlaceOrder_Decision.res.mjs";
|
|
306
306
|
|
|
307
307
|
export {
|
|
308
308
|
Spec,
|
|
@@ -67,7 +67,7 @@ function decide(state, command) {
|
|
|
67
67
|
|
|
68
68
|
let Spec;
|
|
69
69
|
|
|
70
|
-
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/
|
|
70
|
+
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/ShipOrder_Decision.res.mjs";
|
|
71
71
|
|
|
72
72
|
export {
|
|
73
73
|
Spec,
|
|
@@ -128,8 +128,6 @@ let name = "Orders";
|
|
|
128
128
|
|
|
129
129
|
let Id;
|
|
130
130
|
|
|
131
|
-
let Key;
|
|
132
|
-
|
|
133
131
|
let subIdConfig;
|
|
134
132
|
|
|
135
133
|
let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateViewStream/Orders.res.mjs";
|
|
@@ -141,7 +139,6 @@ let visibility = "Public";
|
|
|
141
139
|
export {
|
|
142
140
|
name,
|
|
143
141
|
Id,
|
|
144
|
-
Key,
|
|
145
142
|
catalogProductImage,
|
|
146
143
|
shippingMethodSchema,
|
|
147
144
|
orderLineSchema,
|
package/src/Plugin.res
CHANGED
|
@@ -56,24 +56,24 @@ let dcbSliceSchemas: array<Reventless.DcbTag.sliceSchemas> = [
|
|
|
56
56
|
|
|
57
57
|
module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
58
58
|
// StateChangeSlices
|
|
59
|
-
module CancelOrderSlice = Platform.StateChangeSlice.Make(CancelOrder,
|
|
59
|
+
module CancelOrderSlice = Platform.StateChangeSlice.Make(CancelOrder, CancelOrder_Decision)
|
|
60
60
|
module EmailVerificationChallengesSlice = Platform.StateChangeSlice.Make(
|
|
61
61
|
EmailVerificationChallenges,
|
|
62
|
-
|
|
62
|
+
EmailVerificationChallenges_Decision,
|
|
63
63
|
)
|
|
64
64
|
module NotificationPreferencesSlice = Platform.StateChangeSlice.Make(
|
|
65
65
|
NotificationPreferences,
|
|
66
|
-
|
|
66
|
+
NotificationPreferences_Decision,
|
|
67
67
|
)
|
|
68
68
|
module NotificationSourceClaimsSlice = Platform.StateChangeSlice.Make(
|
|
69
69
|
NotificationSourceClaims,
|
|
70
|
-
|
|
70
|
+
NotificationSourceClaims_Decision,
|
|
71
71
|
)
|
|
72
|
-
module PlaceOrderSlice = Platform.StateChangeSlice.Make(PlaceOrder,
|
|
73
|
-
module ShipOrderSlice = Platform.StateChangeSlice.Make(ShipOrder,
|
|
72
|
+
module PlaceOrderSlice = Platform.StateChangeSlice.Make(PlaceOrder, PlaceOrder_Decision)
|
|
73
|
+
module ShipOrderSlice = Platform.StateChangeSlice.Make(ShipOrder, ShipOrder_Decision)
|
|
74
74
|
module SyncCatalogProductSlice = Platform.StateChangeSlice.Make(
|
|
75
75
|
SyncCatalogProduct,
|
|
76
|
-
|
|
76
|
+
SyncCatalogProduct_Decision,
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
// StateViewSliceStreams
|
|
@@ -127,7 +127,7 @@ module Make = (Platform: ReventlessInfra.Platform.T) => {
|
|
|
127
127
|
// Aggregates
|
|
128
128
|
module CustomerAggregate = Platform.Aggregate.Make(
|
|
129
129
|
Customer,
|
|
130
|
-
|
|
130
|
+
Customer_Decision,
|
|
131
131
|
ReventlessInfra.NoEventMappings.Make(Customer),
|
|
132
132
|
)
|
|
133
133
|
|