createMachine(
{
id: "lot-distribution-complaint",
strict: true,
initial: "idle",
tsTypes: {} as import("./complaint-state-machine.typegen").Typegen0,
schema: {
context: {} as LDCContext,
events: {} as LDCEvent,
},
context: {
aggregate: agg,
},
states: {
idle: {
on: {
LDC_CREATED_BY_BO: { target: "open", actions: ["ldc.created"] },
LDC_CREATED_BY_DW: { target: "open", actions: ["ldc.created"] },
},
},
open: {
on: {
LDC_RESOLVED_BY_BO: { target: "resolved", actions: ["ldc.resolved"] },
LDC_COMMENTED_BY_BO: { target: "open", actions: ["ldc.commented"] },
LDC_DELETED_BY_DW: { target: "deleted", actions: ["ldc.deleted"] },
LDC_REPLACED_BY_DW: { target: "replaced", actions: ["ldc.replaced"] },
},
},
deleted: {
type: "final",
},
resolved: {
on: {
LDC_REOPENED_BY_BO: { target: "open", actions: ["ldc.reopened"] },
},
},
replaced: {
type: "final",
},
},
},
)