//! Module: nns::proposals::report::labels
//!
//! Responsibility: map NNS governance numeric codes to stable report labels.
//! Does not own: live transport, report assembly, or text rendering.
//! Boundary: keeps wire-code label conversion separate from source fetching.

use super::model::{
    NNS_PROPOSAL_REWARD_STATUS_ACCEPT_VOTES_CODE, NNS_PROPOSAL_REWARD_STATUS_ACCEPT_VOTES_LABEL,
    NNS_PROPOSAL_REWARD_STATUS_INELIGIBLE_CODE, NNS_PROPOSAL_REWARD_STATUS_INELIGIBLE_LABEL,
    NNS_PROPOSAL_REWARD_STATUS_READY_TO_SETTLE_CODE,
    NNS_PROPOSAL_REWARD_STATUS_READY_TO_SETTLE_LABEL, NNS_PROPOSAL_REWARD_STATUS_SETTLED_CODE,
    NNS_PROPOSAL_REWARD_STATUS_SETTLED_LABEL, NNS_PROPOSAL_REWARD_STATUS_UNSPECIFIED_LABEL,
    NNS_PROPOSAL_STATUS_ADOPTED_CODE, NNS_PROPOSAL_STATUS_ADOPTED_LABEL,
    NNS_PROPOSAL_STATUS_EXECUTED_CODE, NNS_PROPOSAL_STATUS_EXECUTED_LABEL,
    NNS_PROPOSAL_STATUS_FAILED_CODE, NNS_PROPOSAL_STATUS_FAILED_LABEL,
    NNS_PROPOSAL_STATUS_OPEN_CODE, NNS_PROPOSAL_STATUS_OPEN_LABEL,
    NNS_PROPOSAL_STATUS_REJECTED_CODE, NNS_PROPOSAL_STATUS_REJECTED_LABEL,
    NNS_PROPOSAL_STATUS_UNSPECIFIED_LABEL, NNS_PROPOSAL_TOPIC_API_BOUNDARY_NODE_MANAGEMENT_CODE,
    NNS_PROPOSAL_TOPIC_API_BOUNDARY_NODE_MANAGEMENT_LABEL,
    NNS_PROPOSAL_TOPIC_APPLICATION_CANISTER_MANAGEMENT_CODE,
    NNS_PROPOSAL_TOPIC_APPLICATION_CANISTER_MANAGEMENT_LABEL,
    NNS_PROPOSAL_TOPIC_EXCHANGE_RATE_CODE, NNS_PROPOSAL_TOPIC_EXCHANGE_RATE_LABEL,
    NNS_PROPOSAL_TOPIC_GOVERNANCE_CODE, NNS_PROPOSAL_TOPIC_GOVERNANCE_LABEL,
    NNS_PROPOSAL_TOPIC_IC_OS_VERSION_DEPLOYMENT_CODE,
    NNS_PROPOSAL_TOPIC_IC_OS_VERSION_DEPLOYMENT_LABEL,
    NNS_PROPOSAL_TOPIC_IC_OS_VERSION_ELECTION_CODE,
    NNS_PROPOSAL_TOPIC_IC_OS_VERSION_ELECTION_LABEL, NNS_PROPOSAL_TOPIC_KYC_CODE,
    NNS_PROPOSAL_TOPIC_KYC_LABEL, NNS_PROPOSAL_TOPIC_NETWORK_CANISTER_MANAGEMENT_CODE,
    NNS_PROPOSAL_TOPIC_NETWORK_CANISTER_MANAGEMENT_LABEL,
    NNS_PROPOSAL_TOPIC_NETWORK_ECONOMICS_CODE, NNS_PROPOSAL_TOPIC_NETWORK_ECONOMICS_LABEL,
    NNS_PROPOSAL_TOPIC_NEURON_MANAGEMENT_CODE, NNS_PROPOSAL_TOPIC_NEURON_MANAGEMENT_LABEL,
    NNS_PROPOSAL_TOPIC_NODE_ADMIN_CODE, NNS_PROPOSAL_TOPIC_NODE_ADMIN_LABEL,
    NNS_PROPOSAL_TOPIC_NODE_PROVIDER_REWARDS_CODE, NNS_PROPOSAL_TOPIC_NODE_PROVIDER_REWARDS_LABEL,
    NNS_PROPOSAL_TOPIC_PARTICIPANT_MANAGEMENT_CODE,
    NNS_PROPOSAL_TOPIC_PARTICIPANT_MANAGEMENT_LABEL,
    NNS_PROPOSAL_TOPIC_PROTOCOL_CANISTER_MANAGEMENT_CODE,
    NNS_PROPOSAL_TOPIC_PROTOCOL_CANISTER_MANAGEMENT_LABEL,
    NNS_PROPOSAL_TOPIC_SNS_AND_COMMUNITY_FUND_CODE,
    NNS_PROPOSAL_TOPIC_SNS_AND_COMMUNITY_FUND_LABEL, NNS_PROPOSAL_TOPIC_SUBNET_MANAGEMENT_CODE,
    NNS_PROPOSAL_TOPIC_SUBNET_MANAGEMENT_LABEL, NNS_PROPOSAL_TOPIC_SUBNET_RENTAL_CODE,
    NNS_PROPOSAL_TOPIC_SUBNET_RENTAL_LABEL, NNS_PROPOSAL_TOPIC_UNSPECIFIED_LABEL,
    NNS_PROPOSAL_VOTE_NO_CODE, NNS_PROPOSAL_VOTE_NO_LABEL, NNS_PROPOSAL_VOTE_UNSPECIFIED_LABEL,
    NNS_PROPOSAL_VOTE_YES_CODE, NNS_PROPOSAL_VOTE_YES_LABEL,
};

pub(super) const fn nns_proposal_status_text(status: i32) -> &'static str {
    match status {
        NNS_PROPOSAL_STATUS_OPEN_CODE => NNS_PROPOSAL_STATUS_OPEN_LABEL,
        NNS_PROPOSAL_STATUS_REJECTED_CODE => NNS_PROPOSAL_STATUS_REJECTED_LABEL,
        NNS_PROPOSAL_STATUS_ADOPTED_CODE => NNS_PROPOSAL_STATUS_ADOPTED_LABEL,
        NNS_PROPOSAL_STATUS_EXECUTED_CODE => NNS_PROPOSAL_STATUS_EXECUTED_LABEL,
        NNS_PROPOSAL_STATUS_FAILED_CODE => NNS_PROPOSAL_STATUS_FAILED_LABEL,
        _ => NNS_PROPOSAL_STATUS_UNSPECIFIED_LABEL,
    }
}

pub(super) const fn nns_reward_status_text(status: i32) -> &'static str {
    match status {
        NNS_PROPOSAL_REWARD_STATUS_ACCEPT_VOTES_CODE => {
            NNS_PROPOSAL_REWARD_STATUS_ACCEPT_VOTES_LABEL
        }
        NNS_PROPOSAL_REWARD_STATUS_READY_TO_SETTLE_CODE => {
            NNS_PROPOSAL_REWARD_STATUS_READY_TO_SETTLE_LABEL
        }
        NNS_PROPOSAL_REWARD_STATUS_SETTLED_CODE => NNS_PROPOSAL_REWARD_STATUS_SETTLED_LABEL,
        NNS_PROPOSAL_REWARD_STATUS_INELIGIBLE_CODE => NNS_PROPOSAL_REWARD_STATUS_INELIGIBLE_LABEL,
        _ => NNS_PROPOSAL_REWARD_STATUS_UNSPECIFIED_LABEL,
    }
}

pub(super) const fn nns_vote_text(vote: i32) -> &'static str {
    match vote {
        NNS_PROPOSAL_VOTE_YES_CODE => NNS_PROPOSAL_VOTE_YES_LABEL,
        NNS_PROPOSAL_VOTE_NO_CODE => NNS_PROPOSAL_VOTE_NO_LABEL,
        _ => NNS_PROPOSAL_VOTE_UNSPECIFIED_LABEL,
    }
}

pub(super) const fn nns_topic_text(topic: i32) -> &'static str {
    match topic {
        NNS_PROPOSAL_TOPIC_NEURON_MANAGEMENT_CODE => NNS_PROPOSAL_TOPIC_NEURON_MANAGEMENT_LABEL,
        NNS_PROPOSAL_TOPIC_EXCHANGE_RATE_CODE => NNS_PROPOSAL_TOPIC_EXCHANGE_RATE_LABEL,
        NNS_PROPOSAL_TOPIC_NETWORK_ECONOMICS_CODE => NNS_PROPOSAL_TOPIC_NETWORK_ECONOMICS_LABEL,
        NNS_PROPOSAL_TOPIC_GOVERNANCE_CODE => NNS_PROPOSAL_TOPIC_GOVERNANCE_LABEL,
        NNS_PROPOSAL_TOPIC_NODE_ADMIN_CODE => NNS_PROPOSAL_TOPIC_NODE_ADMIN_LABEL,
        NNS_PROPOSAL_TOPIC_PARTICIPANT_MANAGEMENT_CODE => {
            NNS_PROPOSAL_TOPIC_PARTICIPANT_MANAGEMENT_LABEL
        }
        NNS_PROPOSAL_TOPIC_SUBNET_MANAGEMENT_CODE => NNS_PROPOSAL_TOPIC_SUBNET_MANAGEMENT_LABEL,
        NNS_PROPOSAL_TOPIC_NETWORK_CANISTER_MANAGEMENT_CODE => {
            NNS_PROPOSAL_TOPIC_NETWORK_CANISTER_MANAGEMENT_LABEL
        }
        NNS_PROPOSAL_TOPIC_KYC_CODE => NNS_PROPOSAL_TOPIC_KYC_LABEL,
        NNS_PROPOSAL_TOPIC_NODE_PROVIDER_REWARDS_CODE => {
            NNS_PROPOSAL_TOPIC_NODE_PROVIDER_REWARDS_LABEL
        }
        NNS_PROPOSAL_TOPIC_IC_OS_VERSION_DEPLOYMENT_CODE => {
            NNS_PROPOSAL_TOPIC_IC_OS_VERSION_DEPLOYMENT_LABEL
        }
        NNS_PROPOSAL_TOPIC_IC_OS_VERSION_ELECTION_CODE => {
            NNS_PROPOSAL_TOPIC_IC_OS_VERSION_ELECTION_LABEL
        }
        NNS_PROPOSAL_TOPIC_SNS_AND_COMMUNITY_FUND_CODE => {
            NNS_PROPOSAL_TOPIC_SNS_AND_COMMUNITY_FUND_LABEL
        }
        NNS_PROPOSAL_TOPIC_API_BOUNDARY_NODE_MANAGEMENT_CODE => {
            NNS_PROPOSAL_TOPIC_API_BOUNDARY_NODE_MANAGEMENT_LABEL
        }
        NNS_PROPOSAL_TOPIC_SUBNET_RENTAL_CODE => NNS_PROPOSAL_TOPIC_SUBNET_RENTAL_LABEL,
        NNS_PROPOSAL_TOPIC_APPLICATION_CANISTER_MANAGEMENT_CODE => {
            NNS_PROPOSAL_TOPIC_APPLICATION_CANISTER_MANAGEMENT_LABEL
        }
        NNS_PROPOSAL_TOPIC_PROTOCOL_CANISTER_MANAGEMENT_CODE => {
            NNS_PROPOSAL_TOPIC_PROTOCOL_CANISTER_MANAGEMENT_LABEL
        }
        _ => NNS_PROPOSAL_TOPIC_UNSPECIFIED_LABEL,
    }
}
