Skip to main content

DCM packages

Demand Chain Management (DCM) modules model demand signals, orders, returns, and channels, using the same runtime and loop participation patterns as SCM.

Module interface

Runtime configuration

import { configureDcmOrdersRuntime } from "@betterdata/dcm-orders";
import type { ChannelReader, OutboxWriter } from "@betterdata/dcm-contracts";

configureDcmOrdersRuntime({
  outbox,
  readChannelMessages,
});
import { configureDcmReturnsRuntime } from "@betterdata/dcm-returns";

configureDcmReturnsRuntime({ outbox, readChannelMessages });
@betterdata/dcm-demand focuses on forecast, velocity, threshold, and replenishment services plus loop-participation — wire adapters from your bootstrap (see package README); there is no configureDcmDemandRuntime export today.

Services

Import the concrete service factories and state-machine helpers named in each package’s src/index.ts and README (names vary by module).

Loop participation

import { orderLoopParticipant } from "@betterdata/dcm-orders";
import { EventNames, LoopIds } from "@betterdata/loop-definitions";
// orderLoopParticipant.moduleId === "dcm.orders"
// Handlers reference EventNames.* and LoopIds.* — see `loop-manifest.ts`

Package list

PackageWhat it does
@betterdata/dcm-contractsShared DCM types and event envelopes
@betterdata/dcm-demandDemand signals, thresholds, replenishment triggers
@betterdata/dcm-ordersOrder lifecycle, allocation, fulfillment routing seams
@betterdata/dcm-returnsRMA, receipt, restock, credit
@betterdata/dcm-channelsChannel configuration (v0.1 stub — check README before adopting)
Pair DCM packages with @betterdata/dcm-contracts for typed events end-to-end.