package com.correx.core.approvals

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
enum class Tier {
    @SerialName("T0") T0,
    @SerialName("T1") T1,
    @SerialName("T2") T2,
    @SerialName("T3") T3,
    @SerialName("T4") T4;

    /** Escalation level, ordered T0 < T1 < … < T4. Derived from declaration order — no magic numbers. */
    val level: Int get() = ordinal
}

fun Tier.isAtLeast(other: Tier): Boolean = this.level >= other.level
fun Tier.isAtMost(other: Tier): Boolean = this.level <= other.level
