package com.correx.core.approvals

import com.correx.core.events.types.ProjectId
import com.correx.core.events.types.StageId
import kotlinx.serialization.Serializable

@Serializable
sealed interface GrantScope {
    // toolName binds this grant to a specific operation kind (e.g. "shell", "write_file").
    // A null toolName is rejected at grant-creation time; it is kept nullable here only
    // for backward-compatible deserialization of legacy events.
    @Serializable data class SESSION(val toolName: String? = null) : GrantScope
    @Serializable data class STAGE(val stageId: StageId) : GrantScope
    @Serializable data class PROJECT(val projectId: ProjectId) : GrantScope
}
