use crate::data::keyed::Keyed;

#[derive(Debug)]
#[cfg_attr(test, derive(PartialEq))]
#[allow(dead_code)]
pub(crate) struct ForcedVariation {
    pub(crate) feature_key: String,
    pub(crate) rule_id: u32,
    pub(crate) experiment_id: u32,
    pub(crate) variation_id: u32,
    pub(crate) force_targeting: bool,
}

impl ForcedVariation {
    pub fn new(
        feature_key: String,
        rule_id: u32,
        experiment_id: u32,
        variation_id: u32,
        force_targeting: bool,
    ) -> Self {
        Self {
            feature_key,
            rule_id,
            experiment_id,
            variation_id,
            force_targeting,
        }
    }
}

impl Keyed<u32> for ForcedVariation {
    fn key(&self) -> &u32 {
        &self.experiment_id
    }
}
