Перейти к основному содержимому

blockMachine

@mineflow/api-schemas


@mineflow/api-schemas / blockMachine

Variable: blockMachine

const blockMachine: StateMachine<BlockContext,
| {
actor: string;
type: "START";
}
| {
actor: string;
auto: boolean;
type: "SUBMIT";
}
| {
surveyor: string;
type: "ACCEPT";
}
| {
holesToRework: number;
surveyor: string;
type: "SEND_TO_REWORK";
}, {
}, never, never, never, never, "pending" | "in_progress" | "under_acceptance" | "accepted", string, NonReducibleUnknown, NonReducibleUnknown, EventObject, MetaObject, ToStateSchema<{
context: {
blockId: "";
};
id: "block";
initial: "pending";
states: {
accepted: {
type: "final";
};
in_progress: {
on: {
SUBMIT: "under_acceptance";
};
};
pending: {
on: {
START: "in_progress";
};
};
under_acceptance: {
on: {
ACCEPT: "accepted";
SEND_TO_REWORK: "in_progress";
};
};
};
}>>;

Defined in: libs/prd/src/blocks/state-machine/block.machine.ts:27

Browser/RN-safe entrypoint PRD (ADR-0042). ТОЛЬКО pure FSM-машины + status- энумы — без NestJS/Prisma. Потребляется фронтом как @mineflow/prd/client. (shift-reports — entity-driven FSM без xstate-машины, см. ADR-0022.)