package com.correx.core.transitions.graph

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

internal fun WorkflowGraph.sortedStages(): List<StageId> =
    stages.keys.sortedBy { it.value }

internal fun WorkflowGraph.sortedTransitions(): List<TransitionEdge> =
    transitions.sortedWith(
        compareBy(
            { it.from.value },
            { it.id.value },
            { it.to.value }
        )
    )
