"""Shared config constants and error types."""

CONFIG_VERSION = 2


class ConfigError(Exception):
    """Raised when configuration is invalid."""


TICKET_FLOW_APPROVAL_MODE_YOLO = "yolo"
TICKET_FLOW_APPROVAL_MODE_REVIEW = "review"
TICKET_FLOW_APPROVAL_MODE_SAFE = "safe"  # backwards-compatible alias
_TICKET_FLOW_APPROVAL_MODE_ALIASES = {
    TICKET_FLOW_APPROVAL_MODE_YOLO: TICKET_FLOW_APPROVAL_MODE_YOLO,
    TICKET_FLOW_APPROVAL_MODE_REVIEW: TICKET_FLOW_APPROVAL_MODE_REVIEW,
    TICKET_FLOW_APPROVAL_MODE_SAFE: TICKET_FLOW_APPROVAL_MODE_REVIEW,
}
_TICKET_FLOW_APPROVAL_MODE_ALLOWED = ", ".join(
    [
        TICKET_FLOW_APPROVAL_MODE_YOLO,
        TICKET_FLOW_APPROVAL_MODE_REVIEW,
        TICKET_FLOW_APPROVAL_MODE_SAFE,
    ]
)
