Skip to content

CommandContract

Defined in: packages/hoppity/src/contracts/types.ts:53

A contract describing a domain command — an instruction to do something.

Shape is identical to EventContract but semantically distinct: commands are imperatives directed at a service, events are facts broadcast to the world.

TDomain extends string = string

TName extends string = string

TSchema extends ZodTypeAny = ZodTypeAny

_domain: TDomain

Defined in: packages/hoppity/src/contracts/types.ts:59


_name: TName

Defined in: packages/hoppity/src/contracts/types.ts:60


_type: "command"

Defined in: packages/hoppity/src/contracts/types.ts:58


optional delay: DelayConfig

Defined in: packages/hoppity/src/contracts/types.ts:74

Delayed delivery configuration. Present only when the contract was declared with delay: true or delay: { default: N } in defineDomain.


exchange: string

Defined in: packages/hoppity/src/contracts/types.ts:63

The RabbitMQ exchange name for this domain’s events and commands


publicationName: string

Defined in: packages/hoppity/src/contracts/types.ts:67

The rascal publication name: {domain}command{snake_name}


routingKey: string

Defined in: packages/hoppity/src/contracts/types.ts:65

The topic routing key: {domain}.command.{snake_name}


schema: TSchema

Defined in: packages/hoppity/src/contracts/types.ts:61


subscriptionName: string

Defined in: packages/hoppity/src/contracts/types.ts:69

The rascal subscription name: {domain}command{snake_name}