use serde::Serialize;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub(crate) enum SessionBoundaryAction {
    Continue,
    Refresh,
    WrapUp,
    Stop,
}

impl SessionBoundaryAction {
    pub(crate) fn as_str(self) -> &'static str {
        match self {
            Self::Continue => "continue",
            Self::Refresh => "refresh",
            Self::WrapUp => "wrap_up",
            Self::Stop => "stop",
        }
    }
}

#[derive(Clone, Debug, Serialize)]
pub(crate) struct SessionBoundaryRecommendation {
    pub(crate) action: SessionBoundaryAction,
    pub(crate) summary: String,
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub(crate) evidence: Vec<String>,
}

impl SessionBoundaryRecommendation {
    pub(crate) fn new(
        action: SessionBoundaryAction,
        summary: impl Into<String>,
        evidence: Vec<String>,
    ) -> Self {
        Self {
            action,
            summary: summary.into(),
            evidence,
        }
    }
}
