> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Dcm packages

# 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

```typescript theme={null}
import { configureDcmOrdersRuntime } from "@betterdata/dcm-orders";
import type { ChannelReader, OutboxWriter } from "@betterdata/dcm-contracts";

configureDcmOrdersRuntime({
  outbox,
  readChannelMessages,
});
```

```typescript theme={null}
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

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

## Package list

| Package                     | What it does                                                         |
| --------------------------- | -------------------------------------------------------------------- |
| `@betterdata/dcm-contracts` | Shared DCM types and event envelopes                                 |
| `@betterdata/dcm-demand`    | Demand signals, thresholds, replenishment triggers                   |
| `@betterdata/dcm-orders`    | Order lifecycle, allocation, fulfillment routing seams               |
| `@betterdata/dcm-returns`   | RMA, receipt, restock, credit                                        |
| `@betterdata/dcm-channels`  | Channel configuration (**v0.1** stub — check README before adopting) |

<Tip>
  Pair DCM packages with <a href="/oss/contracts">`@betterdata/dcm-contracts`</a> for typed events end-to-end.
</Tip>
