Oss

Loop definitions

Edit this page

Loop definitions

@betterdata/loop-definitions is the canonical source for Commerce Chain loop IDs, event names, and the LoopParticipantManifest shape domain modules implement.

LoopIds

1import { LoopIds } from "@betterdata/loop-definitions";
2 
3LoopIds.SCM_PROCUREMENT; "cmt">// "scm.procurement"
4LoopIds.SCM_FULFILLMENT; "cmt">// "scm.fulfillment"
5LoopIds.SCM_QUALITY; "cmt">// "scm.quality"
6LoopIds.SCM_REPLENISHMENT; "cmt">// "scm.replenishment"
7LoopIds.SCM_INVENTORY; "cmt">// "scm.inventory"
8LoopIds.SCM_EXECUTION; "cmt">// "scm.execution"
9 
10LoopIds.DCM_DEMAND_SIGNAL; "cmt">// "dcm.demand-signal"
11LoopIds.DCM_DEMAND; "cmt">// "dcm.demand"
12LoopIds.DCM_ORDER; "cmt">// "dcm.order"
13LoopIds.DCM_RETURNS; "cmt">// "dcm.returns"
14LoopIds.DCM_CHANNELS; "cmt">// "dcm.channels"

EventNames

Convention: {family}.{module}.{snake_case_past_tense}.v{N}

1import { EventNames } from "@betterdata/loop-definitions";
2 
3EventNames.INVENTORY_STOCK_RESERVED; "cmt">// "scm.inventory.stock_reserved.v1"
4EventNames.INVENTORY_STOCK_RESERVATION_FAILED;
5EventNames.INVENTORY_STOCK_RETURNED;
6 
7EventNames.PROCUREMENT_PO_CONFIRMED; "cmt">// "scm.procurement.po_confirmed.v1"
8EventNames.EXECUTION_GOODS_RECEIVED; "cmt">// "scm.execution.goods_received.v1"
9 
10EventNames.DEMAND_REPLENISHMENT_TRIGGERED;
11EventNames.DEMAND_THRESHOLD_BREACH_DETECTED;
12 
13EventNames.ORDERS_ORDER_CONFIRMED;
14EventNames.ORDERS_ORDER_LINE_SHIPPED;
15 
16EventNames.RETURNS_RMA_APPROVED;
17EventNames.RETURNS_RETURN_RECEIVED;
18EventNames.RETURNS_RETURN_CREDITED;

LoopParticipantManifest

1import type { LoopParticipantManifest } from "@betterdata/loop-definitions";
2 
3"cmt">// Every module exports a manifest:
4"cmt">// { moduleId, description?, handles: [{ event, loops, description? }] }

Participant validation

@betterdata/loop-actors ships tests that fail CI when a participant references an unknown loop or event constant — keeping the graph consistent as you add modules.

Serializable definitions

The package also publishes data-first loop definitions (states, transitions) for dashboards, compliance maps, and tooling. Browse:

Install

1npm install @betterdata/loop-definitions

Loops
SCM packages · DCM packages