Skip to content

Domain.Rejection reference

Source: packages/domain/src/Rejection.ts

A typed reason a command or read was refused. Nothing is recorded when a command is rejected, and the caller receives the rejection exactly as declared, through an Api too.

import * as Domain from "@alchemy.run/domain";
import * as Schema from "effect/Schema";
export class NotOpen extends Domain.Rejection("NotOpen") {}
export class InsufficientFunds extends Domain.Rejection("InsufficientFunds", {
balance: Schema.Int,
requested: Schema.Int,
}) {}