@reventlessdev/online-shop-dcb-ordering 1.0.0-alpha.227 → 1.0.0-alpha.229

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 (115) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/lib/bs/.compiler.log +2 -2
  3. package/lib/bs/compiler-info.json +1 -1
  4. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
  5. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmj +0 -0
  6. package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
  7. package/lib/bs/src/Extension/Products_Extension.ast +0 -0
  8. package/lib/bs/src/Extension/Products_Extension.res +1 -0
  9. package/lib/bs/src/Extension/Products_Extension.res.mjs +15 -0
  10. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  11. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  12. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.ast +0 -0
  13. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res +3 -4
  14. package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +15 -0
  15. package/lib/bs/src/Order/StateChangeSlice/CancelOrder-OrderingPlugin.cmi +0 -0
  16. package/lib/bs/src/Order/StateChangeSlice/CancelOrder-OrderingPlugin.cmt +0 -0
  17. package/lib/bs/src/Order/StateChangeSlice/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
  18. package/lib/bs/src/Order/StateChangeSlice/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
  19. package/lib/bs/src/Order/StateChangeSlice/ShipOrder-OrderingPlugin.cmi +0 -0
  20. package/lib/bs/src/Order/StateChangeSlice/ShipOrder-OrderingPlugin.cmt +0 -0
  21. package/lib/bs/src/Order/StateChangeSlice/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
  22. package/lib/bs/src/Order/StateChangeSlice/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
  23. package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
  24. package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
  25. package/lib/bs/src/Plugin.res.mjs +9 -3
  26. package/lib/bs/tests/CatalogProduct/StateChangeSlice/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  27. package/lib/bs/tests/CatalogProduct/StateChangeSlice/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  28. package/lib/bs/tests/CatalogProduct/StateViewSlice/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  29. package/lib/bs/tests/CatalogProduct/StateViewSlice/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  30. package/lib/bs/tests/Customer/StateChangeSlice/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
  31. package/lib/bs/tests/Customer/StateChangeSlice/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
  32. package/lib/bs/tests/Customer/StateChangeSlice/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
  33. package/lib/bs/tests/Customer/StateChangeSlice/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
  34. package/lib/bs/tests/Customer/StateChangeSlice/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
  35. package/lib/bs/tests/Customer/StateChangeSlice/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
  36. package/lib/bs/tests/Customer/StateChangeSlice/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
  37. package/lib/bs/tests/Customer/StateChangeSlice/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
  38. package/lib/bs/tests/Customer/StateViewSlice/Customers_GWT-OrderingPlugin.cmi +0 -0
  39. package/lib/bs/tests/Customer/StateViewSlice/Customers_GWT-OrderingPlugin.cmt +0 -0
  40. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  41. package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  42. package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +3 -1
  43. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  44. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  45. package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +3 -1
  46. package/lib/bs/tests/Order/AutomationSlice/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
  47. package/lib/bs/tests/Order/AutomationSlice/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
  48. package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
  49. package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
  50. package/lib/bs/tests/Order/StateChangeSlice/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
  51. package/lib/bs/tests/Order/StateChangeSlice/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
  52. package/lib/bs/tests/Order/StateChangeSlice/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
  53. package/lib/bs/tests/Order/StateChangeSlice/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
  54. package/lib/bs/tests/Order/StateChangeSlice/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
  55. package/lib/bs/tests/Order/StateChangeSlice/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
  56. package/lib/bs/tests/Order/StateViewSlice/Orders_GWT-OrderingPlugin.cmi +0 -0
  57. package/lib/bs/tests/Order/StateViewSlice/Orders_GWT-OrderingPlugin.cmt +0 -0
  58. package/lib/ocaml/.compiler.log +2 -2
  59. package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
  60. package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
  61. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
  62. package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
  63. package/lib/ocaml/CancelOrder-OrderingPlugin.cmi +0 -0
  64. package/lib/ocaml/CancelOrder-OrderingPlugin.cmt +0 -0
  65. package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
  66. package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
  67. package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
  68. package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
  69. package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
  70. package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
  71. package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
  72. package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
  73. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
  74. package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
  75. package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
  76. package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
  77. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
  78. package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
  79. package/lib/ocaml/Orders_ExtensionPointMapping.ast +0 -0
  80. package/lib/ocaml/Orders_ExtensionPointMapping.res +3 -4
  81. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
  82. package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
  83. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
  84. package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
  85. package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
  86. package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
  87. package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
  88. package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
  89. package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
  90. package/lib/ocaml/Products_Extension-OrderingPlugin.cmj +0 -0
  91. package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
  92. package/lib/ocaml/Products_Extension.ast +0 -0
  93. package/lib/ocaml/Products_Extension.res +1 -0
  94. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
  95. package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
  96. package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
  97. package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
  98. package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
  99. package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
  100. package/lib/ocaml/ShipOrder-OrderingPlugin.cmi +0 -0
  101. package/lib/ocaml/ShipOrder-OrderingPlugin.cmt +0 -0
  102. package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
  103. package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
  104. package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
  105. package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
  106. package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
  107. package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
  108. package/package.json +8 -8
  109. package/src/Extension/Products_Extension.res +1 -0
  110. package/src/Extension/Products_Extension.res.mjs +15 -0
  111. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +3 -4
  112. package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +15 -0
  113. package/src/Plugin.res.mjs +9 -3
  114. package/tests/Extension/Products_Extension_GWT.res.mjs +3 -1
  115. package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +3 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
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.229 (2026-08-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **ppx:** follow a let-bound action array merged into an arm's result ([230c72e](https://github.com/ReventlessDev/reventless-core/commit/230c72e25856d8ed20d0860e742b133b2c672d4a))
11
+ * feat(spec)!: reflect the command direction across a port, both halves ([f2fe258](https://github.com/ReventlessDev/reventless-core/commit/f2fe258d195b74f4a61488edee305665341020ea))
12
+ * feat(spec)!: read the port's translation table off the mapping's arms ([956348a](https://github.com/ReventlessDev/reventless-core/commit/956348a9fcb256cfff9db51809bdc27d73360e6c))
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * `ExtensionPointMapping.Mapping` gains `acceptedCommands` and
17
+ `ExtensionMapping.Mapping` gains `issuedCommands`; both are derived, so a
18
+ mapping the ppx can read needs no source change, and one it cannot names itself
19
+ at compile time. Definitions persisted before the two new def fields must be
20
+ re-emitted before a consumer can read them as present — and until then they
21
+ decode as None, which means unknown, not "issues nothing".
22
+ * `ExtensionPointMapping.Mapping` requires `publishedEvents` and
23
+ `ExtensionMapping.Mapping` requires `handledEvents`; the ppx injects both for
24
+ mappings it can read, so app code must build against the matching ppx. Plugin
25
+ definitions persisted before the new fields must be re-emitted before a consumer
26
+ reads them as present.
27
+
28
+
29
+
30
+ # 1.0.0-alpha.228 (2026-08-23)
31
+
32
+ **Note:** Version bump only for package @reventlessdev/online-shop-dcb-ordering
33
+
34
+
35
+
36
+
37
+
6
38
  # 1.0.0-alpha.227 (2026-08-23)
7
39
 
8
40
  **Note:** Version bump only for package @reventlessdev/online-shop-dcb-ordering
@@ -1,2 +1,2 @@
1
- #Start(1787494733522)
2
- #Done(1787494736224)
1
+ #Start(1787790330016)
2
+ #Done(1787790332856)
@@ -4,5 +4,5 @@
4
4
  "bsc_hash": "75e3a59c95cc953608fd3dd6ea6ed68141bba4414a20a52f114261b8a48385fa",
5
5
  "rescript_config_hash": "2b45634c4ef9d26c69e2cd8282eb5d077ce9cf087ded0065001d0f0d889e241c",
6
6
  "runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
7
- "generated_at": "1787494736234"
7
+ "generated_at": "1787790332858"
8
8
  }
@@ -9,6 +9,7 @@ module Mapping = {
9
9
 
10
10
  open ExtensionPoint
11
11
  open SyncCatalogProduct
12
+
12
13
  let mapIncomingEvent = (_id, event, _meta, _pluginDef, _queryEngine) =>
13
14
  switch event {
14
15
  | ProductBecameAvailable({productId, name, price}) => [
@@ -25,11 +25,26 @@ function mapIncomingEvent(_id, event, _meta, _pluginDef, _queryEngine) {
25
25
  }
26
26
  }
27
27
 
28
+ let handledEvents = [
29
+ {
30
+ name: "ProductBecameAvailable",
31
+ toCommandTypes: ["SyncNewProduct"]
32
+ },
33
+ {
34
+ name: "ProductPriceChanged",
35
+ toCommandTypes: ["ChangeSyncedPrice"]
36
+ }
37
+ ];
38
+
39
+ let issuedCommands = [];
40
+
28
41
  let Mapping = {
29
42
  ExtensionPoint: undefined,
30
43
  Delegate: undefined,
31
44
  mapIncomingEvent: mapIncomingEvent,
32
45
  mapOutgoingEvent: undefined,
46
+ handledEvents: handledEvents,
47
+ issuedCommands: issuedCommands,
33
48
  delegateModuleUrl: SyncCatalogProduct$OrderingPlugin.moduleUrl,
34
49
  moduleUrl: "@reventlessdev/online-shop-dcb-ordering/src/Extension/Products_Extension.res.mjs"
35
50
  };
@@ -1,11 +1,10 @@
1
- // Maps internal Ordering events to the stable Orders_ExtensionPoint public API.
2
- // Decomposes batch OrderPlaced / OrderCancelled events into per-product EP events.
1
+ // Maps internal Ordering events to the Orders_ExtensionPoint public API, one
2
+ // published event per product in a batch.
3
3
  @@reventless.spec
4
4
 
5
5
  module ExtensionPoint = OrderingSpec.Orders_ExtensionPoint
6
6
 
7
- // DCB adapter: defines the event type used for outgoing event mapping.
8
- // Only the events relevant to the extension point are included.
7
+ // DCB adapter carrying only the events this port maps.
9
8
  module Delegate = {
10
9
  let name = "OrderingDcbEventLog"
11
10
  @schema
@@ -66,6 +66,19 @@ let mapOutgoingEvent = (_id, event, _meta, _queryEngine) => {
66
66
  }));
67
67
  };
68
68
 
69
+ let publishedEvents = [
70
+ {
71
+ name: "ItemOrdered",
72
+ fromEventTypes: ["OrderPlaced"]
73
+ },
74
+ {
75
+ name: "ItemOrderCancelled",
76
+ fromEventTypes: ["OrderCancelled"]
77
+ }
78
+ ];
79
+
80
+ let acceptedCommands = [];
81
+
69
82
  let name = "Orders";
70
83
 
71
84
  let Id;
@@ -82,5 +95,7 @@ export {
82
95
  mapIncomingCommand,
83
96
  mapOutgoingEvent,
84
97
  moduleUrl,
98
+ publishedEvents,
99
+ acceptedCommands,
85
100
  }
86
101
  /* commandSchema Not a pure module */
@@ -251,7 +251,9 @@ function Make(Platform) {
251
251
  },
252
252
  moduleUrl: Orders_ExtensionPointMapping$OrderingPlugin.moduleUrl,
253
253
  mapIncomingCommand: Orders_ExtensionPointMapping$OrderingPlugin.mapIncomingCommand,
254
- mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent
254
+ mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent,
255
+ publishedEvents: Orders_ExtensionPointMapping$OrderingPlugin.publishedEvents,
256
+ acceptedCommands: Orders_ExtensionPointMapping$OrderingPlugin.acceptedCommands
255
257
  });
256
258
  let Products_Extension = Platform.Extension.Make({
257
259
  ExtensionPoint: {
@@ -273,7 +275,9 @@ function Make(Platform) {
273
275
  moduleUrl: Products_Extension$OrderingPlugin.Mapping.moduleUrl,
274
276
  delegateModuleUrl: Products_Extension$OrderingPlugin.Mapping.delegateModuleUrl,
275
277
  mapIncomingEvent: Products_Extension$OrderingPlugin.Mapping.mapIncomingEvent,
276
- mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent
278
+ mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent,
279
+ handledEvents: Products_Extension$OrderingPlugin.Mapping.handledEvents,
280
+ issuedCommands: Products_Extension$OrderingPlugin.Mapping.issuedCommands
277
281
  });
278
282
  let pluginStructure = Platform.Plugin.makePluginDefinition("Ordering", undefined, undefined, [
279
283
  AvailableProductsSlice,
@@ -307,7 +311,9 @@ function Make(Platform) {
307
311
  },
308
312
  moduleUrl: Orders_ExtensionPointMapping$OrderingPlugin.moduleUrl,
309
313
  mapIncomingCommand: Orders_ExtensionPointMapping$OrderingPlugin.mapIncomingCommand,
310
- mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent
314
+ mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent,
315
+ publishedEvents: Orders_ExtensionPointMapping$OrderingPlugin.publishedEvents,
316
+ acceptedCommands: Orders_ExtensionPointMapping$OrderingPlugin.acceptedCommands
311
317
  }], Object.fromEntries([
312
318
  [
313
319
  "AutoShipOrder",
@@ -26,7 +26,9 @@ let include = Delegate_GWT$ReventlessGwt.FromExtension({
26
26
  moduleUrl: Products_Extension$OrderingPlugin.Mapping.moduleUrl,
27
27
  delegateModuleUrl: Products_Extension$OrderingPlugin.Mapping.delegateModuleUrl,
28
28
  mapIncomingEvent: Products_Extension$OrderingPlugin.Mapping.mapIncomingEvent,
29
- mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent
29
+ mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent,
30
+ handledEvents: Products_Extension$OrderingPlugin.Mapping.handledEvents,
31
+ issuedCommands: Products_Extension$OrderingPlugin.Mapping.issuedCommands
30
32
  });
31
33
 
32
34
  let describe = include.describe;
@@ -24,7 +24,9 @@ let include = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
24
24
  },
25
25
  moduleUrl: Orders_ExtensionPointMapping$OrderingPlugin.moduleUrl,
26
26
  mapIncomingCommand: Orders_ExtensionPointMapping$OrderingPlugin.mapIncomingCommand,
27
- mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent
27
+ mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent,
28
+ publishedEvents: Orders_ExtensionPointMapping$OrderingPlugin.publishedEvents,
29
+ acceptedCommands: Orders_ExtensionPointMapping$OrderingPlugin.acceptedCommands
28
30
  });
29
31
 
30
32
  let describe = include.describe;
@@ -1,2 +1,2 @@
1
- #Start(1787494733522)
2
- #Done(1787494736224)
1
+ #Start(1787790330016)
2
+ #Done(1787790332856)
@@ -1,11 +1,10 @@
1
- // Maps internal Ordering events to the stable Orders_ExtensionPoint public API.
2
- // Decomposes batch OrderPlaced / OrderCancelled events into per-product EP events.
1
+ // Maps internal Ordering events to the Orders_ExtensionPoint public API, one
2
+ // published event per product in a batch.
3
3
  @@reventless.spec
4
4
 
5
5
  module ExtensionPoint = OrderingSpec.Orders_ExtensionPoint
6
6
 
7
- // DCB adapter: defines the event type used for outgoing event mapping.
8
- // Only the events relevant to the extension point are included.
7
+ // DCB adapter carrying only the events this port maps.
9
8
  module Delegate = {
10
9
  let name = "OrderingDcbEventLog"
11
10
  @schema
Binary file
Binary file
Binary file
@@ -9,6 +9,7 @@ module Mapping = {
9
9
 
10
10
  open ExtensionPoint
11
11
  open SyncCatalogProduct
12
+
12
13
  let mapIncomingEvent = (_id, event, _meta, _pluginDef, _queryEngine) =>
13
14
  switch event {
14
15
  | ProductBecameAvailable({productId, name, price}) => [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/online-shop-dcb-ordering",
3
- "version": "1.0.0-alpha.227",
3
+ "version": "1.0.0-alpha.229",
4
4
  "description": "Online Shop example — Ordering bounded context (Customer & Order) using the DCB pattern",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -21,18 +21,18 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "sury": "11.0.0-rc.2",
24
- "@reventlessdev/online-shop-dcb-catalog-spec": "1.0.0-alpha.123",
25
- "@reventlessdev/online-shop-dcb-ordering-spec": "1.0.0-alpha.123",
24
+ "@reventlessdev/online-shop-dcb-ordering-spec": "1.0.0-alpha.124",
25
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.152",
26
26
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
27
- "@reventlessdev/reventless-gwt": "1.0.0-alpha.196",
28
- "@reventlessdev/reventless-infra": "3.0.0-alpha.151",
29
- "@reventlessdev/reventless-local": "3.0.0-alpha.237",
30
- "@reventlessdev/reventless-spec": "3.0.0-alpha.123"
27
+ "@reventlessdev/reventless-gwt": "1.0.0-alpha.198",
28
+ "@reventlessdev/online-shop-dcb-catalog-spec": "1.0.0-alpha.124",
29
+ "@reventlessdev/reventless-local": "3.0.0-alpha.239",
30
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.124"
31
31
  },
32
32
  "devDependencies": {
33
33
  "rescript": "12.3.0",
34
34
  "sury-ppx": "11.0.0-rc.2",
35
- "@reventlessdev/reventless-ppx": "1.0.0-alpha.73"
35
+ "@reventlessdev/reventless-ppx": "1.0.0-alpha.74"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "rescript": "12.3.0"
@@ -9,6 +9,7 @@ module Mapping = {
9
9
 
10
10
  open ExtensionPoint
11
11
  open SyncCatalogProduct
12
+
12
13
  let mapIncomingEvent = (_id, event, _meta, _pluginDef, _queryEngine) =>
13
14
  switch event {
14
15
  | ProductBecameAvailable({productId, name, price}) => [
@@ -25,11 +25,26 @@ function mapIncomingEvent(_id, event, _meta, _pluginDef, _queryEngine) {
25
25
  }
26
26
  }
27
27
 
28
+ let handledEvents = [
29
+ {
30
+ name: "ProductBecameAvailable",
31
+ toCommandTypes: ["SyncNewProduct"]
32
+ },
33
+ {
34
+ name: "ProductPriceChanged",
35
+ toCommandTypes: ["ChangeSyncedPrice"]
36
+ }
37
+ ];
38
+
39
+ let issuedCommands = [];
40
+
28
41
  let Mapping = {
29
42
  ExtensionPoint: undefined,
30
43
  Delegate: undefined,
31
44
  mapIncomingEvent: mapIncomingEvent,
32
45
  mapOutgoingEvent: undefined,
46
+ handledEvents: handledEvents,
47
+ issuedCommands: issuedCommands,
33
48
  delegateModuleUrl: SyncCatalogProduct$OrderingPlugin.moduleUrl,
34
49
  moduleUrl: "@reventlessdev/online-shop-dcb-ordering/src/Extension/Products_Extension.res.mjs"
35
50
  };
@@ -1,11 +1,10 @@
1
- // Maps internal Ordering events to the stable Orders_ExtensionPoint public API.
2
- // Decomposes batch OrderPlaced / OrderCancelled events into per-product EP events.
1
+ // Maps internal Ordering events to the Orders_ExtensionPoint public API, one
2
+ // published event per product in a batch.
3
3
  @@reventless.spec
4
4
 
5
5
  module ExtensionPoint = OrderingSpec.Orders_ExtensionPoint
6
6
 
7
- // DCB adapter: defines the event type used for outgoing event mapping.
8
- // Only the events relevant to the extension point are included.
7
+ // DCB adapter carrying only the events this port maps.
9
8
  module Delegate = {
10
9
  let name = "OrderingDcbEventLog"
11
10
  @schema
@@ -66,6 +66,19 @@ let mapOutgoingEvent = (_id, event, _meta, _queryEngine) => {
66
66
  }));
67
67
  };
68
68
 
69
+ let publishedEvents = [
70
+ {
71
+ name: "ItemOrdered",
72
+ fromEventTypes: ["OrderPlaced"]
73
+ },
74
+ {
75
+ name: "ItemOrderCancelled",
76
+ fromEventTypes: ["OrderCancelled"]
77
+ }
78
+ ];
79
+
80
+ let acceptedCommands = [];
81
+
69
82
  let name = "Orders";
70
83
 
71
84
  let Id;
@@ -82,5 +95,7 @@ export {
82
95
  mapIncomingCommand,
83
96
  mapOutgoingEvent,
84
97
  moduleUrl,
98
+ publishedEvents,
99
+ acceptedCommands,
85
100
  }
86
101
  /* commandSchema Not a pure module */
@@ -251,7 +251,9 @@ function Make(Platform) {
251
251
  },
252
252
  moduleUrl: Orders_ExtensionPointMapping$OrderingPlugin.moduleUrl,
253
253
  mapIncomingCommand: Orders_ExtensionPointMapping$OrderingPlugin.mapIncomingCommand,
254
- mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent
254
+ mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent,
255
+ publishedEvents: Orders_ExtensionPointMapping$OrderingPlugin.publishedEvents,
256
+ acceptedCommands: Orders_ExtensionPointMapping$OrderingPlugin.acceptedCommands
255
257
  });
256
258
  let Products_Extension = Platform.Extension.Make({
257
259
  ExtensionPoint: {
@@ -273,7 +275,9 @@ function Make(Platform) {
273
275
  moduleUrl: Products_Extension$OrderingPlugin.Mapping.moduleUrl,
274
276
  delegateModuleUrl: Products_Extension$OrderingPlugin.Mapping.delegateModuleUrl,
275
277
  mapIncomingEvent: Products_Extension$OrderingPlugin.Mapping.mapIncomingEvent,
276
- mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent
278
+ mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent,
279
+ handledEvents: Products_Extension$OrderingPlugin.Mapping.handledEvents,
280
+ issuedCommands: Products_Extension$OrderingPlugin.Mapping.issuedCommands
277
281
  });
278
282
  let pluginStructure = Platform.Plugin.makePluginDefinition("Ordering", undefined, undefined, [
279
283
  AvailableProductsSlice,
@@ -307,7 +311,9 @@ function Make(Platform) {
307
311
  },
308
312
  moduleUrl: Orders_ExtensionPointMapping$OrderingPlugin.moduleUrl,
309
313
  mapIncomingCommand: Orders_ExtensionPointMapping$OrderingPlugin.mapIncomingCommand,
310
- mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent
314
+ mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent,
315
+ publishedEvents: Orders_ExtensionPointMapping$OrderingPlugin.publishedEvents,
316
+ acceptedCommands: Orders_ExtensionPointMapping$OrderingPlugin.acceptedCommands
311
317
  }], Object.fromEntries([
312
318
  [
313
319
  "AutoShipOrder",
@@ -26,7 +26,9 @@ let include = Delegate_GWT$ReventlessGwt.FromExtension({
26
26
  moduleUrl: Products_Extension$OrderingPlugin.Mapping.moduleUrl,
27
27
  delegateModuleUrl: Products_Extension$OrderingPlugin.Mapping.delegateModuleUrl,
28
28
  mapIncomingEvent: Products_Extension$OrderingPlugin.Mapping.mapIncomingEvent,
29
- mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent
29
+ mapOutgoingEvent: Products_Extension$OrderingPlugin.Mapping.mapOutgoingEvent,
30
+ handledEvents: Products_Extension$OrderingPlugin.Mapping.handledEvents,
31
+ issuedCommands: Products_Extension$OrderingPlugin.Mapping.issuedCommands
30
32
  });
31
33
 
32
34
  let describe = include.describe;
@@ -24,7 +24,9 @@ let include = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
24
24
  },
25
25
  moduleUrl: Orders_ExtensionPointMapping$OrderingPlugin.moduleUrl,
26
26
  mapIncomingCommand: Orders_ExtensionPointMapping$OrderingPlugin.mapIncomingCommand,
27
- mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent
27
+ mapOutgoingEvent: Orders_ExtensionPointMapping$OrderingPlugin.mapOutgoingEvent,
28
+ publishedEvents: Orders_ExtensionPointMapping$OrderingPlugin.publishedEvents,
29
+ acceptedCommands: Orders_ExtensionPointMapping$OrderingPlugin.acceptedCommands
28
30
  });
29
31
 
30
32
  let describe = include.describe;