workyard_application/contracts/condition.rs
1use serde::Serialize;
2
3/// User-facing assessment of current task health.
4#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)]
5#[serde(rename_all = "snake_case")]
6pub enum Condition {
7 /// Available observations indicate a healthy task.
8 Healthy,
9 /// Observations identify an issue requiring attention.
10 NeedsAttention,
11 /// Available evidence is insufficient to determine health.
12 Unknown,
13}
14
15impl Condition {
16 /// Return the human-readable status label.
17 pub fn label(self) -> &'static str {
18 match self {
19 Self::Healthy => "healthy",
20 Self::NeedsAttention => "needs attention",
21 Self::Unknown => "unknown",
22 }
23 }
24}