@reventlessdev/online-shop-dcb-ordering 1.0.0-alpha.103 → 1.0.0-alpha.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/AutomationSlice/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/AutomationSlice/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/AutomationSlice/AutoShipOrder_Automation.ast +0 -0
- package/lib/bs/src/Order/AutomationSlice/AutoShipOrder_Automation.res +0 -2
- package/lib/bs/src/Order/OutboundTranslationSlice/SendOrderConfirmation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/OutboundTranslationSlice/SendOrderConfirmation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/OutboundTranslationSlice/SendOrderConfirmation.ast +0 -0
- package/lib/bs/src/Order/OutboundTranslationSlice/SendOrderConfirmation.res +3 -0
- package/lib/bs/src/Order/OutboundTranslationSlice/SendOrderConfirmation.res.mjs +3 -0
- package/lib/bs/src/Order/OutboundTranslationSlice/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/OutboundTranslationSlice/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChangeSlice/CancelOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChangeSlice/CancelOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChangeSlice/CancelOrder.ast +0 -0
- package/lib/bs/src/Order/StateChangeSlice/CancelOrder.res +1 -0
- package/lib/bs/src/Order/StateChangeSlice/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChangeSlice/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder.ast +0 -0
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder.res +1 -10
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder.res.mjs +1 -1
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder_Behavior.ast +0 -0
- package/lib/bs/src/Order/StateChangeSlice/PlaceOrder_Behavior.res +3 -8
- package/lib/bs/src/Order/StateChangeSlice/ShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChangeSlice/ShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChangeSlice/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChangeSlice/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin.res.mjs +2 -1
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/AutomationSlice/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/AutomationSlice/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmj +0 -0
- package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT.res.mjs +1 -0
- package/lib/bs/tests/Order/StateChangeSlice/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChangeSlice/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChangeSlice/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChangeSlice/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChangeSlice/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChangeSlice/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AutoShipOrder_Automation.ast +0 -0
- package/lib/ocaml/AutoShipOrder_Automation.res +0 -2
- package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder.ast +0 -0
- package/lib/ocaml/CancelOrder.res +1 -0
- package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder.ast +0 -0
- package/lib/ocaml/PlaceOrder.res +1 -10
- package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder_Behavior.ast +0 -0
- package/lib/ocaml/PlaceOrder_Behavior.res +3 -8
- package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SendOrderConfirmation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SendOrderConfirmation.ast +0 -0
- package/lib/ocaml/SendOrderConfirmation.res +3 -0
- package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/package.json +8 -8
- package/src/Order/AutomationSlice/AutoShipOrder_Automation.res +0 -2
- package/src/Order/OutboundTranslationSlice/SendOrderConfirmation.res +3 -0
- package/src/Order/StateChangeSlice/CancelOrder.res +1 -0
- package/src/Order/StateChangeSlice/PlaceOrder.res +1 -10
- package/src/Order/StateChangeSlice/PlaceOrder_Behavior.res +3 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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.104 (2026-06-29)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* external-system boxes for translation slices (Event Graph data) ([3f8ad39](https://github.com/ReventlessDev/reventless-core/commit/3f8ad39b78a3cb1182d59a0e1fb203b7dcb7379b))
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# 1.0.0-alpha.103 (2026-06-27)
|
|
7
14
|
|
|
8
15
|
**Note:** Version bump only for package @reventlessdev/online-shop-dcb-ordering
|
package/lib/bs/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1782764560099)
|
|
2
|
+
#Done(1782764562048)
|
|
@@ -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": "
|
|
7
|
+
"generated_at": "1782764562064"
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
@@reventless.automation
|
|
2
2
|
|
|
3
3
|
// Single DCB source — events from the ordering plugin's own event log.
|
|
4
|
-
// `module Id = Reventless.Id.String` and dcbTags on `*Id` fields are
|
|
5
|
-
// auto-injected by `@@reventless.automation` (Source-module scan).
|
|
6
4
|
module OrderingDcbSource = {
|
|
7
5
|
let name = "OrderingDcbEventLog"
|
|
8
6
|
@schema
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -17,3 +17,6 @@ type inboundCommand = unit
|
|
|
17
17
|
let maxRetries = 3
|
|
18
18
|
let heartbeatInterval = 60
|
|
19
19
|
let targetName = None
|
|
20
|
+
// Foreign system this anti-corruption slice publishes confirmations to — drawn as an
|
|
21
|
+
// external box outside the Ordering plugin in the Event Graph.
|
|
22
|
+
let externalSystem = Some("EmailService")
|
|
@@ -26,6 +26,8 @@ let heartbeatInterval = 60;
|
|
|
26
26
|
|
|
27
27
|
let targetName;
|
|
28
28
|
|
|
29
|
+
let externalSystem = "EmailService";
|
|
30
|
+
|
|
29
31
|
let moduleUrl = "@reventlessdev/online-shop-dcb-ordering/src/Order/OutboundTranslationSlice/SendOrderConfirmation.res.mjs";
|
|
30
32
|
|
|
31
33
|
export {
|
|
@@ -37,6 +39,7 @@ export {
|
|
|
37
39
|
maxRetries,
|
|
38
40
|
heartbeatInterval,
|
|
39
41
|
targetName,
|
|
42
|
+
externalSystem,
|
|
40
43
|
moduleUrl,
|
|
41
44
|
}
|
|
42
45
|
/* consumedEventSchema Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
// PlaceOrder StateChangeSlice.
|
|
2
2
|
// Handles the PlaceOrder command; rejects duplicate placement and validates
|
|
3
3
|
// that all referenced products have been synced to the ordering event log.
|
|
4
|
-
//
|
|
5
|
-
// The tagged array `productIds: array<string>` triggers automatic multi-clause
|
|
6
|
-
// query construction: one OR clause per orderId and per productId element —
|
|
7
|
-
// fetching both Order and CatalogProduct events. The plural field name is
|
|
8
|
-
// auto-singularised by the PPX so each element is stored under tag key
|
|
9
|
-
// `productId`, sharing the key with single-value `productId: string` producers.
|
|
10
4
|
|
|
11
5
|
@@reventless.spec
|
|
12
6
|
|
|
13
|
-
// `OrderPlaced` carries `orderId` (not partial) so the decision model can
|
|
14
|
-
// discriminate placements across the multi-clause query. Without it,
|
|
15
|
-
// OrderPlaced events from sibling orders that share a `productId` tag would
|
|
16
|
-
// leak in and falsely set "this order exists".
|
|
17
7
|
@schema
|
|
18
8
|
type consumedEvent =
|
|
19
9
|
| OrderPlaced({orderId: string})
|
|
@@ -21,6 +11,7 @@ type consumedEvent =
|
|
|
21
11
|
|
|
22
12
|
@schema
|
|
23
13
|
type command =
|
|
14
|
+
// Multiple tagged fields — @partitionTag picks orderId as the storage partition.
|
|
24
15
|
PlaceOrder({@partitionTag orderId: string, customerId: string, @ref("AvailableProducts") productIds: array<string>})
|
|
25
16
|
|
|
26
17
|
@schema
|
|
@@ -19,7 +19,7 @@ let commandSchema = S.schema(s => ({
|
|
|
19
19
|
TAG: "PlaceOrder",
|
|
20
20
|
orderId: s.m(DcbTag$Reventless.partition),
|
|
21
21
|
customerId: s.m(DcbTag$Reventless.string),
|
|
22
|
-
productIds: s.m(S.array(Reference$Reventless.to_(undefined,
|
|
22
|
+
productIds: s.m(S.array(Reference$Reventless.to_(undefined, undefined, "AvailableProducts")))
|
|
23
23
|
}));
|
|
24
24
|
|
|
25
25
|
let errorSchema = S.union([
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
@@reventless.behavior
|
|
2
2
|
|
|
3
|
-
// `
|
|
4
|
-
//
|
|
5
|
-
// `decide`
|
|
6
|
-
// being confused by OrderPlaced events from sibling orders sharing a product.
|
|
7
|
-
//
|
|
8
|
-
// Stored as immutable arrays (rather than `Set.t`) so each fold yields a
|
|
9
|
-
// fresh state — `evolve` returns a new record instead of mutating a shared
|
|
10
|
-
// one. This keeps successive `decide` calls (and unit tests) hermetic.
|
|
3
|
+
// Stored as immutable arrays (rather than `Set.t`) so each fold yields a fresh
|
|
4
|
+
// state — `evolve` returns a new record instead of mutating a shared one. This
|
|
5
|
+
// keeps successive `decide` calls (and unit tests) hermetic.
|
|
11
6
|
type state = {placedOrderIds: array<string>, availableProductIds: array<string>}
|
|
12
7
|
|
|
13
8
|
let initialState = {placedOrderIds: [], availableProductIds: []}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -222,7 +222,8 @@ function Make(Platform) {
|
|
|
222
222
|
inboundCommandSchema: SendOrderConfirmation$OrderingPlugin.inboundCommandSchema,
|
|
223
223
|
maxRetries: SendOrderConfirmation$OrderingPlugin.maxRetries,
|
|
224
224
|
heartbeatInterval: SendOrderConfirmation$OrderingPlugin.heartbeatInterval,
|
|
225
|
-
targetName: undefined
|
|
225
|
+
targetName: undefined,
|
|
226
|
+
externalSystem: SendOrderConfirmation$OrderingPlugin.externalSystem
|
|
226
227
|
})({
|
|
227
228
|
collect: SendOrderConfirmation_Translation$OrderingPlugin.collect,
|
|
228
229
|
translate: SendOrderConfirmation_Translation$OrderingPlugin.translate,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmi
CHANGED
|
Binary file
|
package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmj
CHANGED
|
Binary file
|
package/lib/bs/tests/Order/OutboundTranslationSlice/SendOrderConfirmation_GWT-OrderingPlugin.cmt
CHANGED
|
Binary file
|
|
@@ -13,6 +13,7 @@ let SendOrderConfirmationSlice = {
|
|
|
13
13
|
maxRetries: SendOrderConfirmation$OrderingPlugin.maxRetries,
|
|
14
14
|
heartbeatInterval: SendOrderConfirmation$OrderingPlugin.heartbeatInterval,
|
|
15
15
|
targetName: undefined,
|
|
16
|
+
externalSystem: SendOrderConfirmation$OrderingPlugin.externalSystem,
|
|
16
17
|
moduleUrl: SendOrderConfirmation$OrderingPlugin.moduleUrl,
|
|
17
18
|
collect: SendOrderConfirmation_Translation$OrderingPlugin.collect
|
|
18
19
|
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1782764560099)
|
|
2
|
+
#Done(1782764562048)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
@@reventless.automation
|
|
2
2
|
|
|
3
3
|
// Single DCB source — events from the ordering plugin's own event log.
|
|
4
|
-
// `module Id = Reventless.Id.String` and dcbTags on `*Id` fields are
|
|
5
|
-
// auto-injected by `@@reventless.automation` (Source-module scan).
|
|
6
4
|
module OrderingDcbSource = {
|
|
7
5
|
let name = "OrderingDcbEventLog"
|
|
8
6
|
@schema
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/PlaceOrder.ast
CHANGED
|
Binary file
|
package/lib/ocaml/PlaceOrder.res
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
// PlaceOrder StateChangeSlice.
|
|
2
2
|
// Handles the PlaceOrder command; rejects duplicate placement and validates
|
|
3
3
|
// that all referenced products have been synced to the ordering event log.
|
|
4
|
-
//
|
|
5
|
-
// The tagged array `productIds: array<string>` triggers automatic multi-clause
|
|
6
|
-
// query construction: one OR clause per orderId and per productId element —
|
|
7
|
-
// fetching both Order and CatalogProduct events. The plural field name is
|
|
8
|
-
// auto-singularised by the PPX so each element is stored under tag key
|
|
9
|
-
// `productId`, sharing the key with single-value `productId: string` producers.
|
|
10
4
|
|
|
11
5
|
@@reventless.spec
|
|
12
6
|
|
|
13
|
-
// `OrderPlaced` carries `orderId` (not partial) so the decision model can
|
|
14
|
-
// discriminate placements across the multi-clause query. Without it,
|
|
15
|
-
// OrderPlaced events from sibling orders that share a `productId` tag would
|
|
16
|
-
// leak in and falsely set "this order exists".
|
|
17
7
|
@schema
|
|
18
8
|
type consumedEvent =
|
|
19
9
|
| OrderPlaced({orderId: string})
|
|
@@ -21,6 +11,7 @@ type consumedEvent =
|
|
|
21
11
|
|
|
22
12
|
@schema
|
|
23
13
|
type command =
|
|
14
|
+
// Multiple tagged fields — @partitionTag picks orderId as the storage partition.
|
|
24
15
|
PlaceOrder({@partitionTag orderId: string, customerId: string, @ref("AvailableProducts") productIds: array<string>})
|
|
25
16
|
|
|
26
17
|
@schema
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
@@reventless.behavior
|
|
2
2
|
|
|
3
|
-
// `
|
|
4
|
-
//
|
|
5
|
-
// `decide`
|
|
6
|
-
// being confused by OrderPlaced events from sibling orders sharing a product.
|
|
7
|
-
//
|
|
8
|
-
// Stored as immutable arrays (rather than `Set.t`) so each fold yields a
|
|
9
|
-
// fresh state — `evolve` returns a new record instead of mutating a shared
|
|
10
|
-
// one. This keeps successive `decide` calls (and unit tests) hermetic.
|
|
3
|
+
// Stored as immutable arrays (rather than `Set.t`) so each fold yields a fresh
|
|
4
|
+
// state — `evolve` returns a new record instead of mutating a shared one. This
|
|
5
|
+
// keeps successive `decide` calls (and unit tests) hermetic.
|
|
11
6
|
type state = {placedOrderIds: array<string>, availableProductIds: array<string>}
|
|
12
7
|
|
|
13
8
|
let initialState = {placedOrderIds: [], availableProductIds: []}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -17,3 +17,6 @@ type inboundCommand = unit
|
|
|
17
17
|
let maxRetries = 3
|
|
18
18
|
let heartbeatInterval = 60
|
|
19
19
|
let targetName = None
|
|
20
|
+
// Foreign system this anti-corruption slice publishes confirmations to — drawn as an
|
|
21
|
+
// external box outside the Ordering plugin in the Event Graph.
|
|
22
|
+
let externalSystem = Some("EmailService")
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/online-shop-dcb-ordering",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.104",
|
|
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-alpha.4",
|
|
24
|
-
"@reventlessdev/online-shop-dcb-
|
|
25
|
-
"@reventlessdev/online-shop-dcb-
|
|
24
|
+
"@reventlessdev/online-shop-dcb-catalog-spec": "1.0.0-alpha.59",
|
|
25
|
+
"@reventlessdev/online-shop-dcb-ordering-spec": "1.0.0-alpha.59",
|
|
26
26
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.14",
|
|
27
|
-
"@reventlessdev/reventless-
|
|
28
|
-
"@reventlessdev/reventless-
|
|
29
|
-
"@reventlessdev/reventless-local": "3.0.0-alpha.
|
|
30
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.
|
|
27
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.82",
|
|
28
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.75",
|
|
29
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.114",
|
|
30
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.62"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"rescript": "^12.3.0",
|
|
34
34
|
"sury-ppx": "11.0.0-alpha.2",
|
|
35
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
35
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.48"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"rescript": "^12.3.0"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
@@reventless.automation
|
|
2
2
|
|
|
3
3
|
// Single DCB source — events from the ordering plugin's own event log.
|
|
4
|
-
// `module Id = Reventless.Id.String` and dcbTags on `*Id` fields are
|
|
5
|
-
// auto-injected by `@@reventless.automation` (Source-module scan).
|
|
6
4
|
module OrderingDcbSource = {
|
|
7
5
|
let name = "OrderingDcbEventLog"
|
|
8
6
|
@schema
|
|
@@ -17,3 +17,6 @@ type inboundCommand = unit
|
|
|
17
17
|
let maxRetries = 3
|
|
18
18
|
let heartbeatInterval = 60
|
|
19
19
|
let targetName = None
|
|
20
|
+
// Foreign system this anti-corruption slice publishes confirmations to — drawn as an
|
|
21
|
+
// external box outside the Ordering plugin in the Event Graph.
|
|
22
|
+
let externalSystem = Some("EmailService")
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
// PlaceOrder StateChangeSlice.
|
|
2
2
|
// Handles the PlaceOrder command; rejects duplicate placement and validates
|
|
3
3
|
// that all referenced products have been synced to the ordering event log.
|
|
4
|
-
//
|
|
5
|
-
// The tagged array `productIds: array<string>` triggers automatic multi-clause
|
|
6
|
-
// query construction: one OR clause per orderId and per productId element —
|
|
7
|
-
// fetching both Order and CatalogProduct events. The plural field name is
|
|
8
|
-
// auto-singularised by the PPX so each element is stored under tag key
|
|
9
|
-
// `productId`, sharing the key with single-value `productId: string` producers.
|
|
10
4
|
|
|
11
5
|
@@reventless.spec
|
|
12
6
|
|
|
13
|
-
// `OrderPlaced` carries `orderId` (not partial) so the decision model can
|
|
14
|
-
// discriminate placements across the multi-clause query. Without it,
|
|
15
|
-
// OrderPlaced events from sibling orders that share a `productId` tag would
|
|
16
|
-
// leak in and falsely set "this order exists".
|
|
17
7
|
@schema
|
|
18
8
|
type consumedEvent =
|
|
19
9
|
| OrderPlaced({orderId: string})
|
|
@@ -21,6 +11,7 @@ type consumedEvent =
|
|
|
21
11
|
|
|
22
12
|
@schema
|
|
23
13
|
type command =
|
|
14
|
+
// Multiple tagged fields — @partitionTag picks orderId as the storage partition.
|
|
24
15
|
PlaceOrder({@partitionTag orderId: string, customerId: string, @ref("AvailableProducts") productIds: array<string>})
|
|
25
16
|
|
|
26
17
|
@schema
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
@@reventless.behavior
|
|
2
2
|
|
|
3
|
-
// `
|
|
4
|
-
//
|
|
5
|
-
// `decide`
|
|
6
|
-
// being confused by OrderPlaced events from sibling orders sharing a product.
|
|
7
|
-
//
|
|
8
|
-
// Stored as immutable arrays (rather than `Set.t`) so each fold yields a
|
|
9
|
-
// fresh state — `evolve` returns a new record instead of mutating a shared
|
|
10
|
-
// one. This keeps successive `decide` calls (and unit tests) hermetic.
|
|
3
|
+
// Stored as immutable arrays (rather than `Set.t`) so each fold yields a fresh
|
|
4
|
+
// state — `evolve` returns a new record instead of mutating a shared one. This
|
|
5
|
+
// keeps successive `decide` calls (and unit tests) hermetic.
|
|
11
6
|
type state = {placedOrderIds: array<string>, availableProductIds: array<string>}
|
|
12
7
|
|
|
13
8
|
let initialState = {placedOrderIds: [], availableProductIds: []}
|