@reventlessdev/online-shop-hybrid-ordering 1.0.0-alpha.233 → 1.0.0-alpha.235

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 (96) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +9 -9
  3. package/src/CatalogProduct/{StateChangeSlice → StateChange}/SyncCatalogProduct.res.mjs +1 -1
  4. package/src/CatalogProduct/{StateChangeSlice → StateChange}/SyncCatalogProduct_Behavior.res.mjs +1 -1
  5. package/src/CatalogProduct/{StateViewSliceStream → StateViewStream}/AvailableProducts.res.mjs +1 -1
  6. package/src/CatalogProduct/{StateViewSliceStream → StateViewStream}/AvailableProducts_Projection.res.mjs +1 -1
  7. package/src/Customer/{OutboundTranslationSlice → OutboundTranslation}/GeocodeCustomerAddress.res.mjs +1 -1
  8. package/src/Customer/{OutboundTranslationSlice → OutboundTranslation}/GeocodeCustomerAddress_Translation.res.mjs +1 -1
  9. package/src/Extension/Products_Extension.res.mjs +1 -1
  10. package/src/Notification/{AutomationSlice → Automation}/NotificationIntake.res.mjs +2 -2
  11. package/src/Notification/{AutomationSlice → Automation}/NotificationIntake_Automation.res.mjs +2 -2
  12. package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/AnnounceRecipientContact.res.mjs +1 -1
  13. package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/AnnounceRecipientContact_Translation.res.mjs +1 -1
  14. package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/SendNotification.res.mjs +2 -2
  15. package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/SendNotification_Translation.res.mjs +1 -1
  16. package/src/Notification/{StateChangeSlice → StateChange}/NotificationPreferences.res.mjs +1 -1
  17. package/src/Notification/{StateChangeSlice → StateChange}/NotificationPreferences_Behavior.res.mjs +1 -1
  18. package/src/Notification/{StateChangeSlice → StateChange}/NotificationSourceClaims.res.mjs +1 -1
  19. package/src/Notification/{StateChangeSlice → StateChange}/NotificationSourceClaims_Behavior.res.mjs +1 -1
  20. package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationDeliveries.res +4 -2
  21. package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationDeliveries.res.mjs +5 -5
  22. package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationDeliveries_Projection.res +10 -5
  23. package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationDeliveries_Projection.res.mjs +2 -2
  24. package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationSubscriptions.res.mjs +2 -2
  25. package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationSubscriptions_Projection.res.mjs +2 -2
  26. package/src/Order/{AutomationSlice → Automation}/AutoShipOrder.res.mjs +1 -1
  27. package/src/Order/{AutomationSlice → Automation}/AutoShipOrder_Automation.res.mjs +1 -1
  28. package/src/Order/{StateChangeSlice → StateChange}/CancelOrder.res.mjs +1 -1
  29. package/src/Order/{StateChangeSlice → StateChange}/CancelOrder_Behavior.res.mjs +1 -1
  30. package/src/Order/{StateChangeSlice → StateChange}/PlaceOrder.res.mjs +1 -1
  31. package/src/Order/{StateChangeSlice → StateChange}/PlaceOrder_Behavior.res.mjs +1 -1
  32. package/src/Order/{StateChangeSlice → StateChange}/ShipOrder.res.mjs +1 -1
  33. package/src/Order/{StateChangeSlice → StateChange}/ShipOrder_Behavior.res.mjs +1 -1
  34. package/src/Order/StateViewStream/Orders.res +96 -0
  35. package/src/Order/{StateViewSliceStream → StateViewStream}/Orders.res.mjs +8 -5
  36. package/src/Order/{StateViewSliceStream → StateViewStream}/Orders_Projection.res +5 -5
  37. package/src/Order/{StateViewSliceStream → StateViewStream}/Orders_Projection.res.mjs +3 -5
  38. package/src/Plugin.res.mjs +30 -30
  39. package/tests/CatalogProduct/{StateChangeSlice → StateChange}/SyncCatalogProduct_GWT.res.mjs +2 -2
  40. package/tests/CatalogProduct/{StateViewSliceStream → StateViewStream}/AvailableProducts_GWT.res.mjs +2 -2
  41. package/tests/Customer/AddressGeocodingConformance_GWT.res.mjs +2 -2
  42. package/tests/Customer/{OutboundTranslationSlice → OutboundTranslation}/GeocodeCustomerAddress_GWT.res.mjs +2 -2
  43. package/tests/Extension/Products_Extension_GWT.res.mjs +1 -1
  44. package/tests/Flow/OrderingFlow_GWT.res +8 -2
  45. package/tests/Flow/OrderingFlow_GWT.res.mjs +23 -14
  46. package/tests/Notification/{AutomationSlice → Automation}/NotificationIntake_GWT.res.mjs +2 -2
  47. package/tests/Notification/NotificationConformance_GWT.res.mjs +2 -2
  48. package/tests/Notification/{OutboundTranslationSlice → OutboundTranslation}/SendNotification_GWT.res.mjs +2 -2
  49. package/tests/Notification/{StateChangeSlice → StateChange}/NotificationPreferences_GWT.res.mjs +2 -2
  50. package/tests/Notification/{StateChangeSlice → StateChange}/NotificationSourceClaims_GWT.res.mjs +2 -2
  51. package/tests/Notification/{StateViewSliceStream → StateViewStream}/NotificationDeliveries_GWT.res +8 -5
  52. package/tests/Notification/{StateViewSliceStream → StateViewStream}/NotificationDeliveries_GWT.res.mjs +8 -8
  53. package/tests/Order/{AutomationSlice → Automation}/AutoShipOrder_GWT.res.mjs +2 -2
  54. package/tests/Order/{StateChangeSlice → StateChange}/CancelOrder_GWT.res.mjs +2 -2
  55. package/tests/Order/{StateChangeSlice → StateChange}/PlaceOrder_GWT.res.mjs +2 -2
  56. package/tests/Order/{StateChangeSlice → StateChange}/ShipOrder_GWT.res.mjs +2 -2
  57. package/tests/Order/{StateViewSliceStream → StateViewStream}/Orders_GWT.res +20 -12
  58. package/tests/Order/{StateViewSliceStream → StateViewStream}/Orders_GWT.res.mjs +32 -14
  59. package/src/Order/StateViewSliceStream/Orders.res +0 -114
  60. /package/src/CatalogProduct/{StateChangeSlice → StateChange}/SyncCatalogProduct.res +0 -0
  61. /package/src/CatalogProduct/{StateChangeSlice → StateChange}/SyncCatalogProduct_Behavior.res +0 -0
  62. /package/src/CatalogProduct/{StateViewSliceStream → StateViewStream}/AvailableProducts.res +0 -0
  63. /package/src/CatalogProduct/{StateViewSliceStream → StateViewStream}/AvailableProducts_Projection.res +0 -0
  64. /package/src/Customer/{OutboundTranslationSlice → OutboundTranslation}/GeocodeCustomerAddress.res +0 -0
  65. /package/src/Customer/{OutboundTranslationSlice → OutboundTranslation}/GeocodeCustomerAddress_Translation.res +0 -0
  66. /package/src/Notification/{AutomationSlice → Automation}/NotificationIntake.res +0 -0
  67. /package/src/Notification/{AutomationSlice → Automation}/NotificationIntake_Automation.res +0 -0
  68. /package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/AnnounceRecipientContact.res +0 -0
  69. /package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/AnnounceRecipientContact_Translation.res +0 -0
  70. /package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/SendNotification.res +0 -0
  71. /package/src/Notification/{OutboundTranslationSlice → OutboundTranslation}/SendNotification_Translation.res +0 -0
  72. /package/src/Notification/{StateChangeSlice → StateChange}/NotificationPreferences.res +0 -0
  73. /package/src/Notification/{StateChangeSlice → StateChange}/NotificationPreferences_Behavior.res +0 -0
  74. /package/src/Notification/{StateChangeSlice → StateChange}/NotificationSourceClaims.res +0 -0
  75. /package/src/Notification/{StateChangeSlice → StateChange}/NotificationSourceClaims_Behavior.res +0 -0
  76. /package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationSubscriptions.res +0 -0
  77. /package/src/Notification/{StateViewSliceStream → StateViewStream}/NotificationSubscriptions_Projection.res +0 -0
  78. /package/src/Order/{AutomationSlice → Automation}/AutoShipOrder.res +0 -0
  79. /package/src/Order/{AutomationSlice → Automation}/AutoShipOrder_Automation.res +0 -0
  80. /package/src/Order/{StateChangeSlice → StateChange}/CancelOrder.res +0 -0
  81. /package/src/Order/{StateChangeSlice → StateChange}/CancelOrder_Behavior.res +0 -0
  82. /package/src/Order/{StateChangeSlice → StateChange}/PlaceOrder.res +0 -0
  83. /package/src/Order/{StateChangeSlice → StateChange}/PlaceOrder_Behavior.res +0 -0
  84. /package/src/Order/{StateChangeSlice → StateChange}/ShipOrder.res +0 -0
  85. /package/src/Order/{StateChangeSlice → StateChange}/ShipOrder_Behavior.res +0 -0
  86. /package/tests/CatalogProduct/{StateChangeSlice → StateChange}/SyncCatalogProduct_GWT.res +0 -0
  87. /package/tests/CatalogProduct/{StateViewSliceStream → StateViewStream}/AvailableProducts_GWT.res +0 -0
  88. /package/tests/Customer/{OutboundTranslationSlice → OutboundTranslation}/GeocodeCustomerAddress_GWT.res +0 -0
  89. /package/tests/Notification/{AutomationSlice → Automation}/NotificationIntake_GWT.res +0 -0
  90. /package/tests/Notification/{OutboundTranslationSlice → OutboundTranslation}/SendNotification_GWT.res +0 -0
  91. /package/tests/Notification/{StateChangeSlice → StateChange}/NotificationPreferences_GWT.res +0 -0
  92. /package/tests/Notification/{StateChangeSlice → StateChange}/NotificationSourceClaims_GWT.res +0 -0
  93. /package/tests/Order/{AutomationSlice → Automation}/AutoShipOrder_GWT.res +0 -0
  94. /package/tests/Order/{StateChangeSlice → StateChange}/CancelOrder_GWT.res +0 -0
  95. /package/tests/Order/{StateChangeSlice → StateChange}/PlaceOrder_GWT.res +0 -0
  96. /package/tests/Order/{StateChangeSlice → StateChange}/ShipOrder_GWT.res +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
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.235 (2026-09-08)
7
+
8
+ ### Features
9
+
10
+ * a slice folder is named for its kind, without the Slice ([a400555](https://github.com/ReventlessDev/reventless-core/commit/a400555121b023823983ebe846e99cda27063c1f))
11
+ * **core:** a state view records when it reached each state ([5216f71](https://github.com/ReventlessDev/reventless-core/commit/5216f71b8dcafcb2f0c991923ebcf2438b27e347))
12
+ * **example:** an order's list says where the order has got to ([a1b3a81](https://github.com/ReventlessDev/reventless-core/commit/a1b3a81befb64af25371d189c22fde07c72b7b3d))
13
+ * **spec:** an instant is a type, and a calendar day is a different one ([a60bebc](https://github.com/ReventlessDev/reventless-core/commit/a60bebc20fe5f3413f9252be36f94ba2a9fb620d))
14
+
15
+
16
+ # 1.0.0-alpha.234 (2026-09-07)
17
+
18
+ ### Bug Fixes
19
+
20
+ * **core:** a state view slice composes its [@display](https://github.com/display)Name like a read model ([851aa1d](https://github.com/ReventlessDev/reventless-core/commit/851aa1d12ddae9dd39f91084f5719cd98fe1cbd4))
21
+
22
+
6
23
  # 1.0.0-alpha.233 (2026-09-07)
7
24
 
8
25
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/online-shop-hybrid-ordering",
3
- "version": "1.0.0-alpha.233",
3
+ "version": "1.0.0-alpha.235",
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-rc.2",
24
- "@reventlessdev/online-shop-hybrid-catalog-spec": "1.0.0-alpha.126",
24
+ "@reventlessdev/online-shop-hybrid-catalog-spec": "1.0.0-alpha.128",
25
+ "@reventlessdev/online-shop-hybrid-ordering-spec": "1.0.0-alpha.128",
26
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.160",
25
27
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
26
- "@reventlessdev/reventless-infra": "3.0.0-alpha.158",
27
- "@reventlessdev/reventless-gwt": "1.0.0-alpha.204",
28
- "@reventlessdev/online-shop-hybrid-ordering-spec": "1.0.0-alpha.126",
29
- "@reventlessdev/reventless-local": "3.0.0-alpha.246",
30
- "@reventlessdev/reventless-spec": "3.0.0-alpha.130",
31
- "@reventlessdev/trait-address-geocoding": "1.0.0-alpha.6",
32
- "@reventlessdev/trait-notification": "1.0.0-alpha.6"
28
+ "@reventlessdev/reventless-gwt": "1.0.0-alpha.206",
29
+ "@reventlessdev/reventless-local": "3.0.0-alpha.248",
30
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.132",
31
+ "@reventlessdev/trait-address-geocoding": "1.0.0-alpha.8",
32
+ "@reventlessdev/trait-notification": "1.0.0-alpha.8"
33
33
  },
34
34
  "devDependencies": {
35
35
  "rescript": "12.3.0",
@@ -95,7 +95,7 @@ let name = "SyncCatalogProduct";
95
95
 
96
96
  let Id;
97
97
 
98
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateChangeSlice/SyncCatalogProduct.res.mjs";
98
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateChange/SyncCatalogProduct.res.mjs";
99
99
 
100
100
  let readConsistency = "EscalateOnRetry";
101
101
 
@@ -153,7 +153,7 @@ let initialState = {
153
153
  productImage: undefined
154
154
  };
155
155
 
156
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateChangeSlice/SyncCatalogProduct_Behavior.res.mjs";
156
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior.res.mjs";
157
157
 
158
158
  export {
159
159
  Spec,
@@ -66,7 +66,7 @@ let Id;
66
66
 
67
67
  let subIdConfig;
68
68
 
69
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateViewSliceStream/AvailableProducts.res.mjs";
69
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateViewStream/AvailableProducts.res.mjs";
70
70
 
71
71
  let authorization = "AllowAuthenticated";
72
72
 
@@ -38,7 +38,7 @@ function project(param) {
38
38
 
39
39
  let Spec;
40
40
 
41
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateViewSliceStream/AvailableProducts_Projection.res.mjs";
41
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/CatalogProduct/StateViewStream/AvailableProducts_Projection.res.mjs";
42
42
 
43
43
  export {
44
44
  Spec,
@@ -52,7 +52,7 @@ let externalSystem = "AwsLocation";
52
52
 
53
53
  let capabilityNeeds = AddressGeocoding$TraitAddressGeocoding.capabilityNeeds;
54
54
 
55
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/OutboundTranslationSlice/GeocodeCustomerAddress.res.mjs";
55
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/OutboundTranslation/GeocodeCustomerAddress.res.mjs";
56
56
 
57
57
  export {
58
58
  name,
@@ -54,7 +54,7 @@ let Spec;
54
54
 
55
55
  let Geocode;
56
56
 
57
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/OutboundTranslationSlice/GeocodeCustomerAddress_Translation.res.mjs";
57
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Customer/OutboundTranslation/GeocodeCustomerAddress_Translation.res.mjs";
58
58
 
59
59
  export {
60
60
  Spec,
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as SyncCatalogProduct$OrderingPlugin from "../CatalogProduct/StateChangeSlice/SyncCatalogProduct.res.mjs";
3
+ import * as SyncCatalogProduct$OrderingPlugin from "../CatalogProduct/StateChange/SyncCatalogProduct.res.mjs";
4
4
 
5
5
  function mapIncomingEvent(_id, event, _meta, _pluginDef, _queryEngine) {
6
6
  switch (event.TAG) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as Sury from "sury";
4
4
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
5
- import * as NotificationPreferences$OrderingPlugin from "../StateChangeSlice/NotificationPreferences.res.mjs";
5
+ import * as NotificationPreferences$OrderingPlugin from "../StateChange/NotificationPreferences.res.mjs";
6
6
 
7
7
  let todoItemSchema = Sury.$schema(s => ({
8
8
  ruleId: s.m(Sury.string),
@@ -43,7 +43,7 @@ let heartbeatInterval = 60;
43
43
 
44
44
  let targetName = "NotificationPreferences";
45
45
 
46
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/AutomationSlice/NotificationIntake.res.mjs";
46
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/Automation/NotificationIntake.res.mjs";
47
47
 
48
48
  export {
49
49
  name,
@@ -8,7 +8,7 @@ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/U
8
8
  import * as AutomationSlice$Reventless from "@reventlessdev/reventless-spec/src/components/AutomationSlice.res.mjs";
9
9
  import * as NotificationIntake$OrderingPlugin from "./NotificationIntake.res.mjs";
10
10
  import * as Notification_Rule$TraitNotification from "@reventlessdev/trait-notification/src/Notification_Rule.res.mjs";
11
- import * as NotificationPreferences_Behavior$OrderingPlugin from "../StateChangeSlice/NotificationPreferences_Behavior.res.mjs";
11
+ import * as NotificationPreferences_Behavior$OrderingPlugin from "../StateChange/NotificationPreferences_Behavior.res.mjs";
12
12
 
13
13
  let M = AutomationSlice$Reventless.Mappings.Make({
14
14
  name: NotificationIntake$OrderingPlugin.name,
@@ -189,7 +189,7 @@ let Spec;
189
189
 
190
190
  let Rule;
191
191
 
192
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/AutomationSlice/NotificationIntake_Automation.res.mjs";
192
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/Automation/NotificationIntake_Automation.res.mjs";
193
193
 
194
194
  export {
195
195
  Spec,
@@ -44,7 +44,7 @@ let targetName = "NotificationPreferences";
44
44
 
45
45
  let externalSystem;
46
46
 
47
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslationSlice/AnnounceRecipientContact.res.mjs";
47
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslation/AnnounceRecipientContact.res.mjs";
48
48
 
49
49
  export {
50
50
  name,
@@ -42,7 +42,7 @@ function onExhausted(_id, _item, param) {
42
42
 
43
43
  let Spec;
44
44
 
45
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslationSlice/AnnounceRecipientContact_Translation.res.mjs";
45
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslation/AnnounceRecipientContact_Translation.res.mjs";
46
46
 
47
47
  export {
48
48
  Spec,
@@ -3,7 +3,7 @@
3
3
  import * as Sury from "sury";
4
4
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
5
5
  import * as Notification$TraitNotification from "@reventlessdev/trait-notification/src/Notification.res.mjs";
6
- import * as NotificationPreferences$OrderingPlugin from "../StateChangeSlice/NotificationPreferences.res.mjs";
6
+ import * as NotificationPreferences$OrderingPlugin from "../StateChange/NotificationPreferences.res.mjs";
7
7
 
8
8
  let consumedEventSchema = Sury.$schema(s => ({
9
9
  TAG: "NotificationRequested",
@@ -57,7 +57,7 @@ let targetName = "NotificationPreferences";
57
57
 
58
58
  let externalSystem = "Messaging";
59
59
 
60
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslationSlice/SendNotification.res.mjs";
60
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslation/SendNotification.res.mjs";
61
61
 
62
62
  export {
63
63
  name,
@@ -115,7 +115,7 @@ function onExhausted(_id, item, lastError) {
115
115
 
116
116
  let Spec;
117
117
 
118
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslationSlice/SendNotification_Translation.res.mjs";
118
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/OutboundTranslation/SendNotification_Translation.res.mjs";
119
119
 
120
120
  export {
121
121
  Spec,
@@ -192,7 +192,7 @@ let name = "NotificationPreferences";
192
192
 
193
193
  let Id;
194
194
 
195
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChangeSlice/NotificationPreferences.res.mjs";
195
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationPreferences.res.mjs";
196
196
 
197
197
  let readConsistency = "EscalateOnRetry";
198
198
 
@@ -292,7 +292,7 @@ let Rules;
292
292
 
293
293
  let initialState = Notification_Rules$TraitNotification.empty;
294
294
 
295
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChangeSlice/NotificationPreferences_Behavior.res.mjs";
295
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationPreferences_Behavior.res.mjs";
296
296
 
297
297
  export {
298
298
  Spec,
@@ -62,7 +62,7 @@ let name = "NotificationSourceClaims";
62
62
 
63
63
  let Id;
64
64
 
65
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChangeSlice/NotificationSourceClaims.res.mjs";
65
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationSourceClaims.res.mjs";
66
66
 
67
67
  let readConsistency = "EscalateOnRetry";
68
68
 
@@ -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/StateChangeSlice/NotificationSourceClaims_Behavior.res.mjs";
79
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateChange/NotificationSourceClaims_Behavior.res.mjs";
80
80
 
81
81
  export {
82
82
  Spec,
@@ -65,8 +65,10 @@ type state = {
65
65
  // The provider's own id once it accepted, or the reason it did not. One field
66
66
  // because exactly one of them is ever true, and the outcome says which.
67
67
  detail: string,
68
- decidedAt: @s.matches(Reventless.DateTime.string) string,
69
- settledAt: @s.matches(Reventless.DateTime.string) string,
68
+ decidedAt: Reventless.DateTime.t,
69
+ // Absent while the row is still open. A decision that has not settled has no
70
+ // settlement time, and `""` said that with a value the instant grammar rejects.
71
+ settledAt: option<Reventless.DateTime.t>,
70
72
  }
71
73
 
72
74
  // `address` is on the published event and is not read here — a consumed variant
@@ -2,10 +2,10 @@
2
2
 
3
3
  import * as Sury from "sury";
4
4
  import * as Owner$Reventless from "@reventlessdev/reventless-spec/src/components/Owner.res.mjs";
5
- import * as DateTime$Reventless from "@reventlessdev/reventless-spec/src/types/DateTime.res.mjs";
5
+ import * as DateTime$Reventless from "@reventlessdev/reventless-spec/src/semantic/DateTime.res.mjs";
6
6
  import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
7
7
  import * as StateAnnotations$Reventless from "@reventlessdev/reventless-spec/src/components/StateAnnotations.res.mjs";
8
- import * as NotificationPreferences$OrderingPlugin from "../StateChangeSlice/NotificationPreferences.res.mjs";
8
+ import * as NotificationPreferences$OrderingPlugin from "../StateChange/NotificationPreferences.res.mjs";
9
9
 
10
10
  let outcomeSchema = Sury.union([
11
11
  Sury.literal("Requested"),
@@ -25,8 +25,8 @@ let stateSchema = Sury.$schema(s => ({
25
25
  subjectRef: s.m(Sury.string),
26
26
  origin: s.m(Sury.string),
27
27
  detail: s.m(Sury.string),
28
- decidedAt: s.m(DateTime$Reventless.string),
29
- settledAt: s.m(DateTime$Reventless.string)
28
+ decidedAt: s.m(DateTime$Reventless.schema),
29
+ settledAt: s.m(Sury.$option(DateTime$Reventless.schema))
30
30
  }));
31
31
 
32
32
  let consumedEventSchema = Sury.union([
@@ -116,7 +116,7 @@ let Id;
116
116
 
117
117
  let subIdConfig;
118
118
 
119
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewSliceStream/NotificationDeliveries.res.mjs";
119
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewStream/NotificationDeliveries.res.mjs";
120
120
 
121
121
  let authorization = "AllowAuthenticated";
122
122
 
@@ -35,7 +35,7 @@ let project = ({event, meta}) =>
35
35
  origin: originName(origin),
36
36
  detail: "",
37
37
  decidedAt: meta.time,
38
- settledAt: "",
38
+ settledAt: None,
39
39
  },
40
40
  ),
41
41
  ]
@@ -56,7 +56,7 @@ let project = ({event, meta}) =>
56
56
  origin: originName(origin),
57
57
  detail: "the recipient is not subscribed to this notification",
58
58
  decidedAt: meta.time,
59
- settledAt: meta.time,
59
+ settledAt: Some(meta.time),
60
60
  },
61
61
  ),
62
62
  ]
@@ -74,7 +74,7 @@ let project = ({event, meta}) =>
74
74
  origin: originName(origin),
75
75
  detail: "no address on file for a channel the recipient wants",
76
76
  decidedAt: meta.time,
77
- settledAt: meta.time,
77
+ settledAt: Some(meta.time),
78
78
  },
79
79
  ),
80
80
  ]
@@ -83,10 +83,15 @@ let project = ({event, meta}) =>
83
83
  ...state,
84
84
  outcome: Delivered,
85
85
  detail: providerRef,
86
- settledAt: meta.time,
86
+ settledAt: Some(meta.time),
87
87
  }),
88
88
  ]
89
89
  | NotificationFailed({reference, reason}) => [
90
- Update(reference, state => {...state, outcome: Failed, detail: reason, settledAt: meta.time}),
90
+ Update(reference, state => {
91
+ ...state,
92
+ outcome: Failed,
93
+ detail: reason,
94
+ settledAt: Some(meta.time),
95
+ }),
91
96
  ]
92
97
  }
@@ -40,7 +40,7 @@ function project(param) {
40
40
  origin: originName(event.origin),
41
41
  detail: "",
42
42
  decidedAt: meta.time,
43
- settledAt: ""
43
+ settledAt: undefined
44
44
  }
45
45
  }];
46
46
  case "NotificationSuppressed" :
@@ -124,7 +124,7 @@ function project(param) {
124
124
 
125
125
  let Spec;
126
126
 
127
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewSliceStream/NotificationDeliveries_Projection.res.mjs";
127
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewStream/NotificationDeliveries_Projection.res.mjs";
128
128
 
129
129
  export {
130
130
  Spec,
@@ -4,7 +4,7 @@ import * as Sury from "sury";
4
4
  import * as Owner$Reventless from "@reventlessdev/reventless-spec/src/components/Owner.res.mjs";
5
5
  import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
6
6
  import * as DisplayName$Reventless from "@reventlessdev/reventless-spec/src/components/DisplayName.res.mjs";
7
- import * as NotificationPreferences$OrderingPlugin from "../StateChangeSlice/NotificationPreferences.res.mjs";
7
+ import * as NotificationPreferences$OrderingPlugin from "../StateChange/NotificationPreferences.res.mjs";
8
8
 
9
9
  let subscriptionSchema = Sury.$schema(s => ({
10
10
  category: s.m(NotificationPreferences$OrderingPlugin.categorySchema),
@@ -60,7 +60,7 @@ let Id;
60
60
 
61
61
  let subIdConfig;
62
62
 
63
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewSliceStream/NotificationSubscriptions.res.mjs";
63
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewStream/NotificationSubscriptions.res.mjs";
64
64
 
65
65
  let authorization = "AllowAuthenticated";
66
66
 
@@ -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 "../StateChangeSlice/NotificationPreferences_Behavior.res.mjs";
5
+ import * as NotificationPreferences_Behavior$OrderingPlugin from "../StateChange/NotificationPreferences_Behavior.res.mjs";
6
6
 
7
7
  let categories = [
8
8
  "OrderConfirmation",
@@ -86,7 +86,7 @@ let Rules;
86
86
 
87
87
  let Host;
88
88
 
89
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewSliceStream/NotificationSubscriptions_Projection.res.mjs";
89
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Notification/StateViewStream/NotificationSubscriptions_Projection.res.mjs";
90
90
 
91
91
  export {
92
92
  Spec,
@@ -32,7 +32,7 @@ let heartbeatInterval = 60;
32
32
 
33
33
  let targetName = "ShipOrder";
34
34
 
35
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/AutomationSlice/AutoShipOrder.res.mjs";
35
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/Automation/AutoShipOrder.res.mjs";
36
36
 
37
37
  export {
38
38
  name,
@@ -105,7 +105,7 @@ function onExhausted(_id, _item) {
105
105
 
106
106
  let Spec;
107
107
 
108
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/AutomationSlice/AutoShipOrder_Automation.res.mjs";
108
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/Automation/AutoShipOrder_Automation.res.mjs";
109
109
 
110
110
  export {
111
111
  Spec,
@@ -70,7 +70,7 @@ let name = "CancelOrder";
70
70
 
71
71
  let Id;
72
72
 
73
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChangeSlice/CancelOrder.res.mjs";
73
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/CancelOrder.res.mjs";
74
74
 
75
75
  let readConsistency = "EscalateOnRetry";
76
76
 
@@ -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/StateChangeSlice/CancelOrder_Behavior.res.mjs";
86
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/CancelOrder_Behavior.res.mjs";
87
87
 
88
88
  export {
89
89
  Spec,
@@ -114,7 +114,7 @@ let name = "PlaceOrder";
114
114
 
115
115
  let Id;
116
116
 
117
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChangeSlice/PlaceOrder.res.mjs";
117
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/PlaceOrder.res.mjs";
118
118
 
119
119
  let readConsistency = "EscalateOnRetry";
120
120
 
@@ -269,7 +269,7 @@ function decide(state, command) {
269
269
 
270
270
  let Spec;
271
271
 
272
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChangeSlice/PlaceOrder_Behavior.res.mjs";
272
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/PlaceOrder_Behavior.res.mjs";
273
273
 
274
274
  export {
275
275
  Spec,
@@ -54,7 +54,7 @@ let name = "ShipOrder";
54
54
 
55
55
  let Id;
56
56
 
57
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChangeSlice/ShipOrder.res.mjs";
57
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/ShipOrder.res.mjs";
58
58
 
59
59
  let readConsistency = "EscalateOnRetry";
60
60
 
@@ -64,7 +64,7 @@ let initialState = {
64
64
  customerId: ""
65
65
  };
66
66
 
67
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChangeSlice/ShipOrder_Behavior.res.mjs";
67
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateChange/ShipOrder_Behavior.res.mjs";
68
68
 
69
69
  export {
70
70
  Spec,
@@ -0,0 +1,96 @@
1
+ // Orders StateViewSliceStream.
2
+ // Projects order events from the shared ordering event log into an Orders read model.
3
+
4
+ @@reventless.spec
5
+
6
+ // Catalog's store, named explicitly: the ppx would otherwise derive an
7
+ // *Ordering* store from the field name, and nothing writes to that one.
8
+ let catalogProductImage = Reventless.UploadableImage.forField(
9
+ ~plugin="Catalog",
10
+ ~store="productImages",
11
+ )
12
+
13
+ @schema
14
+ type shippingMethod =
15
+ | Standard
16
+ | Express
17
+ | Pickup
18
+
19
+ // One priced line, carried straight from `OrderPlaced` — the name and prices the
20
+ // write side froze at placement, not the catalog's current ones.
21
+ @schema
22
+ type orderLine = {
23
+ productId: string,
24
+ name: string,
25
+ quantity: int,
26
+ unitPrice: Reventless.Money.t,
27
+ lineTotal: Reventless.Money.t,
28
+ }
29
+
30
+ @schema
31
+ type consumedEvent =
32
+ | OrderPlaced({
33
+ orderId: string,
34
+ customerId: string,
35
+ productIds: array<string>,
36
+ lines: array<orderLine>,
37
+ total: Reventless.Money.t,
38
+ shippingMethod: shippingMethod,
39
+ deliveryWindow: option<Reventless.DateRange.t>,
40
+ firstProductName: option<string>,
41
+ firstProductImage: @s.matches(S.option(catalogProductImage))
42
+ option<Reventless.UploadableImage.t>,
43
+ })
44
+ | OrderShipped({orderId: string})
45
+ | OrderCancelled({orderId: string})
46
+ // Folding the cancellation without the reopen would render the row `Cancelled`
47
+ // for the rest of its life. `ReopenOrder` being internal-only does not make
48
+ // the edge less real.
49
+ | OrderReopened({orderId: string})
50
+
51
+ @schema
52
+ type lifecycle =
53
+ | Placed
54
+ | Shipped
55
+ | Cancelled
56
+
57
+ // An order list is operational — an `AutoShipOrder` flips a row while the
58
+ // shopper is looking at it — so the Live control is offered.
59
+ @live(true) @schema
60
+ type state = {
61
+ orderId: string,
62
+ // Reads are narrowed to the caller's own rows in the resolver; an elevated
63
+ // caller sees every row.
64
+ @owner customerId: string,
65
+ // Correct on the event, noise in a grid — `lines` says the same with names.
66
+ @hidden productIds: array<string>,
67
+ // From the envelope's `meta.time`. `@displayName` because an order placed
68
+ // through the UI has a uuid for an id and no name of its own; `@summary` puts
69
+ // the field a row is named by in the set a list column may show.
70
+ @displayName @summary placedAt: Reventless.DateTime.t,
71
+ // Every state this order reached and when, appended by the projection
72
+ // machinery. Retires the per-state timestamp fields: a cancellation and a
73
+ // reopen are dated without a projection edge for each, and a state added later
74
+ // needs no new field.
75
+ trail: Reventless.Lifecycle.Trail.t<lifecycle>,
76
+ lines: array<orderLine>,
77
+ // What the order cost, as the write side computed it at placement.
78
+ @summary total: Reventless.Money.t,
79
+ // How many things this is, summed across the lines — which the number of lines
80
+ // does not give.
81
+ @summary itemCount: int,
82
+ // No annotation: the field name is the declaration. `@summary` because a view
83
+ // declaring any summary field shows only those, and where an order has got to
84
+ // is what a shopper scanning the list is looking for.
85
+ @summary lifecycle: lifecycle,
86
+ shippingMethod: shippingMethod,
87
+ // The requested slot as one declared span, so a scheduler lays a bar out from
88
+ // it directly instead of guessing the pair from field names.
89
+ deliveryWindow: option<Reventless.DateRange.t>,
90
+ // Carried on the event rather than read from the catalog — see `PlaceOrder`.
91
+ // Absent on orders placed before it was recorded.
92
+ firstProductName: option<string>,
93
+ // The picture the order recorded, resolved as this row's own. Schema written
94
+ // out because the store is Catalog's — see `catalogProductImage` above.
95
+ firstProductImage: @s.matches(S.option(catalogProductImage)) option<Reventless.UploadableImage.t>,
96
+ }
@@ -3,8 +3,9 @@
3
3
  import * as Sury from "sury";
4
4
  import * as Money$Reventless from "@reventlessdev/reventless-spec/src/semantic/Money.res.mjs";
5
5
  import * as Owner$Reventless from "@reventlessdev/reventless-spec/src/components/Owner.res.mjs";
6
- import * as DateTime$Reventless from "@reventlessdev/reventless-spec/src/types/DateTime.res.mjs";
6
+ import * as DateTime$Reventless from "@reventlessdev/reventless-spec/src/semantic/DateTime.res.mjs";
7
7
  import * as DateRange$Reventless from "@reventlessdev/reventless-spec/src/semantic/DateRange.res.mjs";
8
+ import * as Lifecycle$Reventless from "@reventlessdev/reventless-spec/src/types/Lifecycle.res.mjs";
8
9
  import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
9
10
  import * as DisplayName$Reventless from "@reventlessdev/reventless-spec/src/components/DisplayName.res.mjs";
10
11
  import * as UploadableImage$Reventless from "@reventlessdev/reventless-spec/src/semantic/UploadableImage.res.mjs";
@@ -63,13 +64,13 @@ let stateSchema = Sury.$schema(s => ({
63
64
  orderId: s.m(Sury.string),
64
65
  customerId: s.m(Owner$Reventless.string),
65
66
  productIds: s.m(Sury.array(Sury.string)),
67
+ placedAt: s.m(DateTime$Reventless.schema),
68
+ trail: s.m(Lifecycle$Reventless.Trail.schema(lifecycleSchema)),
66
69
  lines: s.m(Sury.array(orderLineSchema)),
67
70
  total: s.m(Money$Reventless.schema),
68
71
  itemCount: s.m(Sury.int),
69
72
  lifecycle: s.m(lifecycleSchema),
70
73
  shippingMethod: s.m(shippingMethodSchema),
71
- placedAt: s.m(DateTime$Reventless.string),
72
- shippedAt: s.m(DateTime$Reventless.string),
73
74
  deliveryWindow: s.m(Sury.$option(DateRange$Reventless.schema)),
74
75
  firstProductName: s.m(Sury.$option(Sury.string)),
75
76
  firstProductImage: s.m(Sury.$option(catalogProductImage)),
@@ -98,8 +99,10 @@ let stateSchema$2 = Sury.$Metadata_set(stateSchema$1, StateAnnotations$Reventles
98
99
  indexes: [],
99
100
  hidden: ["productIds"],
100
101
  summary: [
102
+ "placedAt",
101
103
  "total",
102
- "itemCount"
104
+ "itemCount",
105
+ "lifecycle"
103
106
  ],
104
107
  internal: [],
105
108
  drillTargets: [],
@@ -122,7 +125,7 @@ let Id;
122
125
 
123
126
  let subIdConfig;
124
127
 
125
- let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateViewSliceStream/Orders.res.mjs";
128
+ let moduleUrl = "@reventlessdev/online-shop-hybrid-ordering/src/Order/StateViewStream/Orders.res.mjs";
126
129
 
127
130
  let authorization = "AllowAuthenticated";
128
131