use steel::*;

#[derive(Debug, Error, Clone, Copy, PartialEq, Eq, IntoPrimitive)]
#[repr(u32)]
pub enum GovernanceError {
    #[error("Proposal not found")]
    ProposalNotFound = 0,

    #[error("Proposal already executed")]
    ProposalAlreadyExecuted = 1,

    #[error("Proposal not active")]
    ProposalNotActive = 2,

    #[error("Voting period ended")]
    VotingPeriodEnded = 3,

    #[error("Voting period not ended")]
    VotingPeriodNotEnded = 4,

    #[error("Timelock not expired")]
    TimelockNotExpired = 5,

    #[error("Insufficient voting power")]
    InsufficientVotingPower = 6,

    #[error("Already voted")]
    AlreadyVoted = 7,

    #[error("Quorum not met")]
    QuorumNotMet = 8,

    #[error("Threshold not met")]
    ThresholdNotMet = 9,

    #[error("Invalid proposal action")]
    InvalidProposalAction = 10,

    #[error("Invalid proposal status")]
    InvalidProposalStatus = 11,

    #[error("Not authorized")]
    NotAuthorized = 12,

    #[error("Proposal cancelled")]
    ProposalCancelled = 14,

    #[error("Invalid proposal tier")]
    InvalidProposalTier = 15,
}

error!(GovernanceError);
