@reventlessdev/online-shop-hybrid-ordering 1.0.0-alpha.280 → 1.0.0-alpha.281

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 (42) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +9 -9
  3. package/src/CatalogProduct/StateChange/{SyncCatalogProduct_Behavior.res → SyncCatalogProduct_Decision.res} +4 -4
  4. package/src/CatalogProduct/StateChange/{SyncCatalogProduct_Behavior.res.mjs → SyncCatalogProduct_Decision.res.mjs} +1 -1
  5. package/src/Customer/Aggregate/{Customer_Behavior.res → Customer_Decision.res} +2 -2
  6. package/src/Customer/Aggregate/{Customer_Behavior.res.mjs → Customer_Decision.res.mjs} +1 -1
  7. package/src/Customer/StateChange/{EmailVerificationChallenges_Behavior.res → EmailVerificationChallenges_Decision.res} +1 -1
  8. package/src/Customer/StateChange/{EmailVerificationChallenges_Behavior.res.mjs → EmailVerificationChallenges_Decision.res.mjs} +1 -1
  9. package/src/Notification/Automation/NotificationIntake_Automation.res +1 -1
  10. package/src/Notification/Automation/NotificationIntake_Automation.res.mjs +2 -2
  11. package/src/Notification/StateChange/{NotificationPreferences_Behavior.res → NotificationPreferences_Decision.res} +1 -1
  12. package/src/Notification/StateChange/{NotificationPreferences_Behavior.res.mjs → NotificationPreferences_Decision.res.mjs} +1 -1
  13. package/src/Notification/StateChange/{NotificationSourceClaims_Behavior.res → NotificationSourceClaims_Decision.res} +1 -1
  14. package/src/Notification/StateChange/{NotificationSourceClaims_Behavior.res.mjs → NotificationSourceClaims_Decision.res.mjs} +1 -1
  15. package/src/Notification/StateViewStream/NotificationSubscriptions_Projection.res +1 -1
  16. package/src/Notification/StateViewStream/NotificationSubscriptions_Projection.res.mjs +3 -3
  17. package/src/Order/StateChange/{CancelOrder_Behavior.res → CancelOrder_Decision.res} +2 -2
  18. package/src/Order/StateChange/{CancelOrder_Behavior.res.mjs → CancelOrder_Decision.res.mjs} +1 -1
  19. package/src/Order/StateChange/PlaceOrder.res +1 -1
  20. package/src/Order/StateChange/{PlaceOrder_Behavior.res → PlaceOrder_Decision.res} +2 -2
  21. package/src/Order/StateChange/{PlaceOrder_Behavior.res.mjs → PlaceOrder_Decision.res.mjs} +1 -1
  22. package/src/Order/StateChange/{ShipOrder_Behavior.res → ShipOrder_Decision.res} +1 -1
  23. package/src/Order/StateChange/{ShipOrder_Behavior.res.mjs → ShipOrder_Decision.res.mjs} +1 -1
  24. package/src/Plugin.res +8 -8
  25. package/src/Plugin.res.mjs +40 -40
  26. package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +8 -8
  27. package/tests/Customer/AddressGeocodingConformance_GWT.res +1 -1
  28. package/tests/Customer/AddressGeocodingConformance_GWT.res.mjs +7 -7
  29. package/tests/Customer/Aggregate/Customer_GWT.res +1 -1
  30. package/tests/Customer/Aggregate/Customer_GWT.res.mjs +10 -10
  31. package/tests/Customer/StateChange/EmailVerificationChallenges_GWT.res.mjs +8 -8
  32. package/tests/Flow/OrderingFlow_GWT.res +4 -4
  33. package/tests/Flow/OrderingFlow_GWT.res.mjs +12 -12
  34. package/tests/Notification/NotificationConformance_GWT.res +9 -9
  35. package/tests/Notification/NotificationConformance_GWT.res.mjs +14 -14
  36. package/tests/Notification/StateChange/NotificationPreferences_GWT.res.mjs +8 -8
  37. package/tests/Notification/StateChange/NotificationSourceClaims_GWT.res.mjs +8 -8
  38. package/tests/Order/StateChange/CancelOrder_GWT.res +2 -2
  39. package/tests/Order/StateChange/CancelOrder_GWT.res.mjs +10 -10
  40. package/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +8 -8
  41. package/tests/Order/StateChange/ShipOrder_GWT.res +2 -2
  42. package/tests/Order/StateChange/ShipOrder_GWT.res.mjs +10 -10
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
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.281 (2026-10-21)
7
+
8
+ * 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))
9
+
10
+ ### BREAKING CHANGES
11
+
12
+ * <Spec>_Behavior.res, @@reventless.behavior,
13
+ Reventless.Behavior.T, StateChangeSlice.Behavior, Behavior_GWT and
14
+ thenRefused no longer exist. Run `npx reventless-rename-to-decision` at an
15
+ app's root, then rebuild; comments are not rewritten. The PPX must be the
16
+ matching release.
17
+
18
+
19
+
6
20
  # 1.0.0-alpha.280 (2026-10-19)
7
21
 
8
22
  **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.280",
3
+ "version": "1.0.0-alpha.281",
4
4
  "description": "Online Shop Hybrid example — Ordering plugin (Customer aggregate + Order/CatalogProduct DCB)",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -21,15 +21,15 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "sury": "11.0.0",
24
- "@reventlessdev/online-shop-hybrid-catalog-spec": "1.0.0-alpha.166",
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",
28
24
  "@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
29
- "@reventlessdev/trait-notification": "1.0.0-alpha.50",
30
- "@reventlessdev/trait-address-geocoding": "1.0.0-alpha.50",
31
- "@reventlessdev/reventless-spec": "3.0.0-alpha.169",
32
- "@reventlessdev/reventless-local": "3.0.0-alpha.291"
25
+ "@reventlessdev/reventless-gwt": "1.0.0-alpha.249",
26
+ "@reventlessdev/online-shop-hybrid-catalog-spec": "1.0.0-alpha.167",
27
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.198",
28
+ "@reventlessdev/online-shop-hybrid-ordering-spec": "1.0.0-alpha.166",
29
+ "@reventlessdev/reventless-local": "3.0.0-alpha.292",
30
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.170",
31
+ "@reventlessdev/trait-address-geocoding": "1.0.0-alpha.51",
32
+ "@reventlessdev/trait-notification": "1.0.0-alpha.51"
33
33
  },
34
34
  "devDependencies": {
35
35
  "rescript": "12.3.1",
@@ -1,6 +1,6 @@
1
- @@reventless.behavior
1
+ @@reventless.decision
2
2
 
3
- // No price until one has been synced — see ChangeProductPrice_Behavior for why
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 recognised and dropped.
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 recognised as a change and
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/SyncCatalogProduct_Behavior.res.mjs";
156
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateChange/SyncCatalogProduct_Decision.res.mjs";
157
157
 
158
158
  export {
159
159
  Spec,
@@ -1,7 +1,7 @@
1
- // Customer aggregate behavior.
1
+ // Customer aggregate decision.
2
2
  // Implements the state machine for registering and managing customers.
3
3
 
4
- @@reventless.behavior
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/Customer_Behavior.res.mjs";
337
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/Aggregate/Customer_Decision.res.mjs";
338
338
 
339
339
  let snapshot;
340
340
 
@@ -1,4 +1,4 @@
1
- @@reventless.behavior
1
+ @@reventless.decision
2
2
 
3
3
  // Issue, expire, count and settle. The rules are the graft's; this slice holds
4
4
  // the state they read and names the facts they allow.
@@ -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/EmailVerificationChallenges_Behavior.res.mjs";
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: NotificationPreferences_Behavior.categoryOf(rule.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 NotificationPreferences_Behavior$OrderingPlugin from "../StateChange/NotificationPreferences_Behavior.res.mjs";
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: NotificationPreferences_Behavior$OrderingPlugin.categoryOf(rule.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),
@@ -1,4 +1,4 @@
1
- @@reventless.behavior
1
+ @@reventless.decision
2
2
 
3
3
  // The directory, the matrix and the dispatch decision are the trait's; this file
4
4
  // is the mapping onto them plus the two things the trait has no opinion about —
@@ -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/NotificationPreferences_Behavior.res.mjs";
326
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationPreferences_Decision.res.mjs";
327
327
 
328
328
  export {
329
329
  Spec,
@@ -1,4 +1,4 @@
1
- @@reventless.behavior
1
+ @@reventless.decision
2
2
 
3
3
  // The claim set is the trait's, folded through the same value the preferences
4
4
  // slice folds. Only the claim half of it is ever populated here — a claim says
@@ -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/NotificationSourceClaims_Behavior.res.mjs";
79
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationSourceClaims_Decision.res.mjs";
80
80
 
81
81
  export {
82
82
  Spec,
@@ -1,7 +1,7 @@
1
1
  @@reventless.projection
2
2
 
3
3
  module Rules = TraitNotification.Notification_Rules
4
- module Host = NotificationPreferences_Behavior
4
+ module Host = NotificationPreferences_Decision
5
5
 
6
6
  let categories: array<NotificationPreferences.category> = [
7
7
  OrderConfirmation,
@@ -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 NotificationPreferences_Behavior$OrderingPlugin from "../StateChange/NotificationPreferences_Behavior.res.mjs";
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: NotificationPreferences_Behavior$OrderingPlugin.channelOf(channel),
22
- enabled: NotificationPreferences_Behavior$OrderingPlugin.posture(NotificationPreferences_Behavior$OrderingPlugin.categoryKey(category), channel),
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.behavior
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
- // honoured while the order stayed shipped.
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/CancelOrder_Behavior.res.mjs";
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 behaviour.
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.behavior
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 behaviour — and refuses a product past the
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/PlaceOrder_Behavior.res.mjs";
305
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/PlaceOrder_Decision.res.mjs";
306
306
 
307
307
  export {
308
308
  Spec,
@@ -1,4 +1,4 @@
1
- @@reventless.behavior
1
+ @@reventless.decision
2
2
 
3
3
  // One state at a time, rather than three booleans. The flag triple this
4
4
  // replaced could represent `shipped && cancelled` — a shape the domain does not
@@ -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/ShipOrder_Behavior.res.mjs";
70
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/ShipOrder_Decision.res.mjs";
71
71
 
72
72
  export {
73
73
  Spec,
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, CancelOrder_Behavior)
59
+ module CancelOrderSlice = Platform.StateChangeSlice.Make(CancelOrder, CancelOrder_Decision)
60
60
  module EmailVerificationChallengesSlice = Platform.StateChangeSlice.Make(
61
61
  EmailVerificationChallenges,
62
- EmailVerificationChallenges_Behavior,
62
+ EmailVerificationChallenges_Decision,
63
63
  )
64
64
  module NotificationPreferencesSlice = Platform.StateChangeSlice.Make(
65
65
  NotificationPreferences,
66
- NotificationPreferences_Behavior,
66
+ NotificationPreferences_Decision,
67
67
  )
68
68
  module NotificationSourceClaimsSlice = Platform.StateChangeSlice.Make(
69
69
  NotificationSourceClaims,
70
- NotificationSourceClaims_Behavior,
70
+ NotificationSourceClaims_Decision,
71
71
  )
72
- module PlaceOrderSlice = Platform.StateChangeSlice.Make(PlaceOrder, PlaceOrder_Behavior)
73
- module ShipOrderSlice = Platform.StateChangeSlice.Make(ShipOrder, ShipOrder_Behavior)
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
- SyncCatalogProduct_Behavior,
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
- Customer_Behavior,
130
+ Customer_Decision,
131
131
  ReventlessInfra.NoEventMappings.Make(Customer),
132
132
  )
133
133
 
@@ -17,16 +17,16 @@ import * as MarketingDigest$OrderingPlugin from "./Notification/Automation/Marke
17
17
  import * as NoEventMappings$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/NoEventMappings.res.mjs";
18
18
  import * as SendNotification$OrderingPlugin from "./Notification/OutboundTranslation/SendNotification.res.mjs";
19
19
  import * as AvailableProducts$OrderingPlugin from "./CatalogProduct/StateViewStream/AvailableProducts.res.mjs";
20
- import * as Customer_Behavior$OrderingPlugin from "./Customer/Aggregate/Customer_Behavior.res.mjs";
20
+ import * as Customer_Decision$OrderingPlugin from "./Customer/Aggregate/Customer_Decision.res.mjs";
21
21
  import * as Orders_Projection$OrderingPlugin from "./Order/StateViewStream/Orders_Projection.res.mjs";
22
22
  import * as NotificationIntake$OrderingPlugin from "./Notification/Automation/NotificationIntake.res.mjs";
23
23
  import * as Products_Extension$OrderingPlugin from "./Extension/Products_Extension.res.mjs";
24
- import * as ShipOrder_Behavior$OrderingPlugin from "./Order/StateChange/ShipOrder_Behavior.res.mjs";
24
+ import * as ShipOrder_Decision$OrderingPlugin from "./Order/StateChange/ShipOrder_Decision.res.mjs";
25
25
  import * as SyncCatalogProduct$OrderingPlugin from "./CatalogProduct/StateChange/SyncCatalogProduct.res.mjs";
26
26
  import * as Orders_ExtensionPoint$OrderingSpec from "@reventlessdev/online-shop-hybrid-ordering-spec/src/Orders_ExtensionPoint.res.mjs";
27
- import * as PlaceOrder_Behavior$OrderingPlugin from "./Order/StateChange/PlaceOrder_Behavior.res.mjs";
27
+ import * as PlaceOrder_Decision$OrderingPlugin from "./Order/StateChange/PlaceOrder_Decision.res.mjs";
28
28
  import * as VerifyCustomerEmail$OrderingPlugin from "./Customer/OutboundTranslation/VerifyCustomerEmail.res.mjs";
29
- import * as CancelOrder_Behavior$OrderingPlugin from "./Order/StateChange/CancelOrder_Behavior.res.mjs";
29
+ import * as CancelOrder_Decision$OrderingPlugin from "./Order/StateChange/CancelOrder_Decision.res.mjs";
30
30
  import * as CancelUnshippedOrder$OrderingPlugin from "./Order/Automation/CancelUnshippedOrder.res.mjs";
31
31
  import * as Products_ExtensionPoint$CatalogSpec from "@reventlessdev/online-shop-hybrid-catalog-spec/src/Products_ExtensionPoint.res.mjs";
32
32
  import * as Customers_Projections$OrderingPlugin from "./Customer/ReadModelStream/Customers_Projections.res.mjs";
@@ -39,19 +39,19 @@ import * as NotificationSourceClaims$OrderingPlugin from "./Notification/StateCh
39
39
  import * as NotificationSubscriptions$OrderingPlugin from "./Notification/StateViewStream/NotificationSubscriptions.res.mjs";
40
40
  import * as MarketingDigest_Automation$OrderingPlugin from "./Notification/Automation/MarketingDigest_Automation.res.mjs";
41
41
  import * as EmailVerificationChallenges$OrderingPlugin from "./Customer/StateChange/EmailVerificationChallenges.res.mjs";
42
- import * as SyncCatalogProduct_Behavior$OrderingPlugin from "./CatalogProduct/StateChange/SyncCatalogProduct_Behavior.res.mjs";
42
+ import * as SyncCatalogProduct_Decision$OrderingPlugin from "./CatalogProduct/StateChange/SyncCatalogProduct_Decision.res.mjs";
43
43
  import * as AvailableProducts_Projection$OrderingPlugin from "./CatalogProduct/StateViewStream/AvailableProducts_Projection.res.mjs";
44
44
  import * as Orders_ExtensionPointMapping$OrderingPlugin from "./ExtensionPoint/Orders_ExtensionPointMapping.res.mjs";
45
45
  import * as SendNotification_Translation$OrderingPlugin from "./Notification/OutboundTranslation/SendNotification_Translation.res.mjs";
46
46
  import * as NotificationIntake_Automation$OrderingPlugin from "./Notification/Automation/NotificationIntake_Automation.res.mjs";
47
47
  import * as CancelUnshippedOrder_Automation$OrderingPlugin from "./Order/Automation/CancelUnshippedOrder_Automation.res.mjs";
48
48
  import * as VerifyCustomerEmail_Translation$OrderingPlugin from "./Customer/OutboundTranslation/VerifyCustomerEmail_Translation.res.mjs";
49
- import * as NotificationPreferences_Behavior$OrderingPlugin from "./Notification/StateChange/NotificationPreferences_Behavior.res.mjs";
49
+ import * as NotificationPreferences_Decision$OrderingPlugin from "./Notification/StateChange/NotificationPreferences_Decision.res.mjs";
50
50
  import * as NotificationDeliveries_Projection$OrderingPlugin from "./Notification/StateViewStream/NotificationDeliveries_Projection.res.mjs";
51
- import * as NotificationSourceClaims_Behavior$OrderingPlugin from "./Notification/StateChange/NotificationSourceClaims_Behavior.res.mjs";
51
+ import * as NotificationSourceClaims_Decision$OrderingPlugin from "./Notification/StateChange/NotificationSourceClaims_Decision.res.mjs";
52
52
  import * as GeocodeCustomerAddress_Translation$OrderingPlugin from "./Customer/OutboundTranslation/GeocodeCustomerAddress_Translation.res.mjs";
53
53
  import * as AnnounceRecipientContact_Translation$OrderingPlugin from "./Notification/OutboundTranslation/AnnounceRecipientContact_Translation.res.mjs";
54
- import * as EmailVerificationChallenges_Behavior$OrderingPlugin from "./Customer/StateChange/EmailVerificationChallenges_Behavior.res.mjs";
54
+ import * as EmailVerificationChallenges_Decision$OrderingPlugin from "./Customer/StateChange/EmailVerificationChallenges_Decision.res.mjs";
55
55
  import * as NotificationSubscriptions_Projection$OrderingPlugin from "./Notification/StateViewStream/NotificationSubscriptions_Projection.res.mjs";
56
56
 
57
57
  let dcbSliceSchemas = [
@@ -119,10 +119,10 @@ function Make(Platform) {
119
119
  traits: CancelOrder$OrderingPlugin.traits,
120
120
  readConsistency: CancelOrder$OrderingPlugin.readConsistency
121
121
  })({
122
- initialState: CancelOrder_Behavior$OrderingPlugin.initialState,
123
- evolve: CancelOrder_Behavior$OrderingPlugin.evolve,
124
- decide: CancelOrder_Behavior$OrderingPlugin.decide,
125
- moduleUrl: CancelOrder_Behavior$OrderingPlugin.moduleUrl
122
+ initialState: CancelOrder_Decision$OrderingPlugin.initialState,
123
+ evolve: CancelOrder_Decision$OrderingPlugin.evolve,
124
+ decide: CancelOrder_Decision$OrderingPlugin.decide,
125
+ moduleUrl: CancelOrder_Decision$OrderingPlugin.moduleUrl
126
126
  });
127
127
  let EmailVerificationChallengesSlice = Platform.StateChangeSlice.Make({
128
128
  name: EmailVerificationChallenges$OrderingPlugin.name,
@@ -136,10 +136,10 @@ function Make(Platform) {
136
136
  traits: EmailVerificationChallenges$OrderingPlugin.traits,
137
137
  readConsistency: EmailVerificationChallenges$OrderingPlugin.readConsistency
138
138
  })({
139
- initialState: EmailVerificationChallenges_Behavior$OrderingPlugin.initialState,
140
- evolve: EmailVerificationChallenges_Behavior$OrderingPlugin.evolve,
141
- decide: EmailVerificationChallenges_Behavior$OrderingPlugin.decide,
142
- moduleUrl: EmailVerificationChallenges_Behavior$OrderingPlugin.moduleUrl
139
+ initialState: EmailVerificationChallenges_Decision$OrderingPlugin.initialState,
140
+ evolve: EmailVerificationChallenges_Decision$OrderingPlugin.evolve,
141
+ decide: EmailVerificationChallenges_Decision$OrderingPlugin.decide,
142
+ moduleUrl: EmailVerificationChallenges_Decision$OrderingPlugin.moduleUrl
143
143
  });
144
144
  let NotificationPreferencesSlice = Platform.StateChangeSlice.Make({
145
145
  name: NotificationPreferences$OrderingPlugin.name,
@@ -153,10 +153,10 @@ function Make(Platform) {
153
153
  traits: NotificationPreferences$OrderingPlugin.traits,
154
154
  readConsistency: NotificationPreferences$OrderingPlugin.readConsistency
155
155
  })({
156
- initialState: NotificationPreferences_Behavior$OrderingPlugin.initialState,
157
- evolve: NotificationPreferences_Behavior$OrderingPlugin.evolve,
158
- decide: NotificationPreferences_Behavior$OrderingPlugin.decide,
159
- moduleUrl: NotificationPreferences_Behavior$OrderingPlugin.moduleUrl
156
+ initialState: NotificationPreferences_Decision$OrderingPlugin.initialState,
157
+ evolve: NotificationPreferences_Decision$OrderingPlugin.evolve,
158
+ decide: NotificationPreferences_Decision$OrderingPlugin.decide,
159
+ moduleUrl: NotificationPreferences_Decision$OrderingPlugin.moduleUrl
160
160
  });
161
161
  let NotificationSourceClaimsSlice = Platform.StateChangeSlice.Make({
162
162
  name: NotificationSourceClaims$OrderingPlugin.name,
@@ -170,10 +170,10 @@ function Make(Platform) {
170
170
  traits: NotificationSourceClaims$OrderingPlugin.traits,
171
171
  readConsistency: NotificationSourceClaims$OrderingPlugin.readConsistency
172
172
  })({
173
- initialState: NotificationSourceClaims_Behavior$OrderingPlugin.initialState,
174
- evolve: NotificationSourceClaims_Behavior$OrderingPlugin.evolve,
175
- decide: NotificationSourceClaims_Behavior$OrderingPlugin.decide,
176
- moduleUrl: NotificationSourceClaims_Behavior$OrderingPlugin.moduleUrl
173
+ initialState: NotificationSourceClaims_Decision$OrderingPlugin.initialState,
174
+ evolve: NotificationSourceClaims_Decision$OrderingPlugin.evolve,
175
+ decide: NotificationSourceClaims_Decision$OrderingPlugin.decide,
176
+ moduleUrl: NotificationSourceClaims_Decision$OrderingPlugin.moduleUrl
177
177
  });
178
178
  let PlaceOrderSlice = Platform.StateChangeSlice.Make({
179
179
  name: PlaceOrder$OrderingPlugin.name,
@@ -187,10 +187,10 @@ function Make(Platform) {
187
187
  traits: PlaceOrder$OrderingPlugin.traits,
188
188
  readConsistency: PlaceOrder$OrderingPlugin.readConsistency
189
189
  })({
190
- initialState: PlaceOrder_Behavior$OrderingPlugin.initialState,
191
- evolve: PlaceOrder_Behavior$OrderingPlugin.evolve,
192
- decide: PlaceOrder_Behavior$OrderingPlugin.decide,
193
- moduleUrl: PlaceOrder_Behavior$OrderingPlugin.moduleUrl
190
+ initialState: PlaceOrder_Decision$OrderingPlugin.initialState,
191
+ evolve: PlaceOrder_Decision$OrderingPlugin.evolve,
192
+ decide: PlaceOrder_Decision$OrderingPlugin.decide,
193
+ moduleUrl: PlaceOrder_Decision$OrderingPlugin.moduleUrl
194
194
  });
195
195
  let ShipOrderSlice = Platform.StateChangeSlice.Make({
196
196
  name: ShipOrder$OrderingPlugin.name,
@@ -204,10 +204,10 @@ function Make(Platform) {
204
204
  traits: ShipOrder$OrderingPlugin.traits,
205
205
  readConsistency: ShipOrder$OrderingPlugin.readConsistency
206
206
  })({
207
- initialState: ShipOrder_Behavior$OrderingPlugin.initialState,
208
- evolve: ShipOrder_Behavior$OrderingPlugin.evolve,
209
- decide: ShipOrder_Behavior$OrderingPlugin.decide,
210
- moduleUrl: ShipOrder_Behavior$OrderingPlugin.moduleUrl
207
+ initialState: ShipOrder_Decision$OrderingPlugin.initialState,
208
+ evolve: ShipOrder_Decision$OrderingPlugin.evolve,
209
+ decide: ShipOrder_Decision$OrderingPlugin.decide,
210
+ moduleUrl: ShipOrder_Decision$OrderingPlugin.moduleUrl
211
211
  });
212
212
  let SyncCatalogProductSlice = Platform.StateChangeSlice.Make({
213
213
  name: SyncCatalogProduct$OrderingPlugin.name,
@@ -221,10 +221,10 @@ function Make(Platform) {
221
221
  traits: SyncCatalogProduct$OrderingPlugin.traits,
222
222
  readConsistency: SyncCatalogProduct$OrderingPlugin.readConsistency
223
223
  })({
224
- initialState: SyncCatalogProduct_Behavior$OrderingPlugin.initialState,
225
- evolve: SyncCatalogProduct_Behavior$OrderingPlugin.evolve,
226
- decide: SyncCatalogProduct_Behavior$OrderingPlugin.decide,
227
- moduleUrl: SyncCatalogProduct_Behavior$OrderingPlugin.moduleUrl
224
+ initialState: SyncCatalogProduct_Decision$OrderingPlugin.initialState,
225
+ evolve: SyncCatalogProduct_Decision$OrderingPlugin.evolve,
226
+ decide: SyncCatalogProduct_Decision$OrderingPlugin.decide,
227
+ moduleUrl: SyncCatalogProduct_Decision$OrderingPlugin.moduleUrl
228
228
  });
229
229
  let AvailableProductsStreamSlice = Platform.StateViewSliceStream.Make({
230
230
  name: AvailableProducts$OrderingPlugin.name,
@@ -433,11 +433,11 @@ function Make(Platform) {
433
433
  commandTransition: Customer$OrderingPlugin.commandTransition,
434
434
  traits: Customer$OrderingPlugin.traits
435
435
  })({
436
- initialState: Customer_Behavior$OrderingPlugin.initialState,
437
- evolve: Customer_Behavior$OrderingPlugin.evolve,
438
- decide: Customer_Behavior$OrderingPlugin.decide,
436
+ initialState: Customer_Decision$OrderingPlugin.initialState,
437
+ evolve: Customer_Decision$OrderingPlugin.evolve,
438
+ decide: Customer_Decision$OrderingPlugin.decide,
439
439
  snapshot: undefined,
440
- moduleUrl: Customer_Behavior$OrderingPlugin.moduleUrl
440
+ moduleUrl: Customer_Decision$OrderingPlugin.moduleUrl
441
441
  })(NoEventMappings$ReventlessInfra.Make({
442
442
  name: Customer$OrderingPlugin.name,
443
443
  Id: CustomerId$OrderingPlugin,
@@ -1,11 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
3
+ import * as Decision_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Decision_GWT.res.mjs";
4
4
  import * as Ordering_Examples$OrderingPlugin from "../../Ordering_Examples.res.mjs";
5
5
  import * as SyncCatalogProduct$OrderingPlugin from "../../../src/CatalogProduct/StateChange/SyncCatalogProduct.res.mjs";
6
- import * as SyncCatalogProduct_Behavior$OrderingPlugin from "../../../src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior.res.mjs";
6
+ import * as SyncCatalogProduct_Decision$OrderingPlugin from "../../../src/CatalogProduct/StateChange/SyncCatalogProduct_Decision.res.mjs";
7
7
 
8
- let include = Behavior_GWT$ReventlessGwt.Make({
8
+ let include = Decision_GWT$ReventlessGwt.Make({
9
9
  name: SyncCatalogProduct$OrderingPlugin.name,
10
10
  consumedEventSchema: SyncCatalogProduct$OrderingPlugin.consumedEventSchema,
11
11
  commandSchema: SyncCatalogProduct$OrderingPlugin.commandSchema,
@@ -13,9 +13,9 @@ let include = Behavior_GWT$ReventlessGwt.Make({
13
13
  eventSchema: SyncCatalogProduct$OrderingPlugin.eventSchema,
14
14
  authorizationOf: SyncCatalogProduct$OrderingPlugin.authorizationOf
15
15
  })({
16
- initialState: SyncCatalogProduct_Behavior$OrderingPlugin.initialState,
17
- evolve: SyncCatalogProduct_Behavior$OrderingPlugin.evolve,
18
- decide: SyncCatalogProduct_Behavior$OrderingPlugin.decide
16
+ initialState: SyncCatalogProduct_Decision$OrderingPlugin.initialState,
17
+ evolve: SyncCatalogProduct_Decision$OrderingPlugin.evolve,
18
+ decide: SyncCatalogProduct_Decision$OrderingPlugin.decide
19
19
  });
20
20
 
21
21
  let describe = include.describe;
@@ -162,7 +162,7 @@ let thenEventsWithError = include.thenEventsWithError;
162
162
 
163
163
  let thenError = include.thenError;
164
164
 
165
- let thenRefused = include.thenRefused;
165
+ let thenForbidden = include.thenForbidden;
166
166
 
167
167
  let thenAppendsConditionedOn = include.thenAppendsConditionedOn;
168
168
 
@@ -183,7 +183,7 @@ export {
183
183
  thenEventWithError,
184
184
  thenEventsWithError,
185
185
  thenError,
186
- thenRefused,
186
+ thenForbidden,
187
187
  thenAppendsConditionedOn,
188
188
  thenAppendsConditionedOnExactly,
189
189
  }
@@ -10,7 +10,7 @@ module Binding = {
10
10
  let posture = TraitAddressGeocoding.AddressGeocoding.WritesBack
11
11
 
12
12
  module Spec = Customer
13
- module Behavior = Customer_Behavior
13
+ module Decision = Customer_Decision
14
14
 
15
15
  let created = address => [Customer.Registered({email: "alice@x.y", address})]
16
16
  let subjectChanged = address => Customer.AddressUpdated({address: address})
@@ -1,7 +1,7 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Customer$OrderingPlugin from "../../src/Customer/Aggregate/Customer.res.mjs";
4
- import * as Customer_Behavior$OrderingPlugin from "../../src/Customer/Aggregate/Customer_Behavior.res.mjs";
4
+ import * as Customer_Decision$OrderingPlugin from "../../src/Customer/Aggregate/Customer_Decision.res.mjs";
5
5
  import * as GeocodeCustomerAddress$OrderingPlugin from "../../src/Customer/OutboundTranslation/GeocodeCustomerAddress.res.mjs";
6
6
  import * as GeocodeCustomerAddress_Translation$OrderingPlugin from "../../src/Customer/OutboundTranslation/GeocodeCustomerAddress_Translation.res.mjs";
7
7
  import * as AddressGeocoding_Conformance$TraitAddressGeocoding from "@reventlessdev/trait-address-geocoding/src/AddressGeocoding_Conformance.res.mjs";
@@ -121,7 +121,7 @@ let Binding = {
121
121
  subjectB: subjectB,
122
122
  posture: "WritesBack",
123
123
  Spec: undefined,
124
- Behavior: undefined,
124
+ Decision: undefined,
125
125
  created: created,
126
126
  subjectChanged: subjectChanged,
127
127
  located: located,
@@ -149,7 +149,7 @@ let Conformance = AddressGeocoding_Conformance$TraitAddressGeocoding.Make({
149
149
  errorSchema: Customer$OrderingPlugin.errorSchema,
150
150
  authorizationOf: Customer$OrderingPlugin.authorizationOf
151
151
  },
152
- Behavior: {
152
+ Decision: {
153
153
  Spec: {
154
154
  name: Customer$OrderingPlugin.name,
155
155
  commandSchema: Customer$OrderingPlugin.commandSchema,
@@ -157,11 +157,11 @@ let Conformance = AddressGeocoding_Conformance$TraitAddressGeocoding.Make({
157
157
  errorSchema: Customer$OrderingPlugin.errorSchema,
158
158
  authorizationOf: Customer$OrderingPlugin.authorizationOf
159
159
  },
160
- initialState: Customer_Behavior$OrderingPlugin.initialState,
161
- evolve: Customer_Behavior$OrderingPlugin.evolve,
162
- decide: Customer_Behavior$OrderingPlugin.decide,
160
+ initialState: Customer_Decision$OrderingPlugin.initialState,
161
+ evolve: Customer_Decision$OrderingPlugin.evolve,
162
+ decide: Customer_Decision$OrderingPlugin.decide,
163
163
  snapshot: undefined,
164
- moduleUrl: Customer_Behavior$OrderingPlugin.moduleUrl
164
+ moduleUrl: Customer_Decision$OrderingPlugin.moduleUrl
165
165
  },
166
166
  created: created,
167
167
  subjectChanged: subjectChanged,
@@ -2,7 +2,7 @@
2
2
 
3
3
  open Ordering_Examples
4
4
 
5
- describe("Customer Behavior", () => {
5
+ describe("Customer Decision", () => {
6
6
  // scenario-id: 190d3516-9b61-4ed3-bc89-beea8997f380
7
7
  test("Register on new aggregate produces Registered", () =>
8
8
  givenEvents([])