package com.correx.core.transitions.graph

import com.correx.core.events.types.StageId

data class WorkflowGraph(
    val id: String = "",
    val stages: Map<StageId, StageConfig>,
    val transitions: Set<TransitionEdge>,
    val start: StageId,
) {
    val stageIds: Set<StageId> get() = stages.keys
    init {
        require(id.isNotBlank()) { "workflow id must not be blank" }
        require(start in stages) { "start stage must exist in stages" }
    }
}
