Skip to main content

domain/
incident.rs

1//! Incident categories and review states for pet-safety workflows.
2//!
3//! Incident facts are source-derived evidence that must stay review-gated: they can create
4//! staff follow-up, manager escalation, reputation response, and daily-brief risk entries,
5//! but they should not trigger unapproved customer, legal, or medical commitments.
6
7use nutype::nutype;
8#[allow(unused_imports)]
9use serde::{Deserialize, Serialize};
10
11#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
12/// Domain vocabulary for category decisions in incident workflows.
13pub enum Category {
14    /// Injury incident category for safety and customer follow-up.
15    Injury,
16    /// Altercation incident category for safety and customer follow-up.
17    Altercation,
18    /// Behavior incident category for safety and customer follow-up.
19    Behavior,
20    /// Medication incident category for safety and customer follow-up.
21    Medication,
22    /// Escape incident category for safety and customer follow-up.
23    Escape,
24    /// Property incident category for safety and customer follow-up.
25    Property,
26    /// Customer service incident category for safety and customer follow-up.
27    CustomerService,
28    /// Non-dog, non-cat pet handled by exception policy.
29    Other,
30}
31
32#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
33/// Domain vocabulary for severity decisions in incident workflows.
34pub enum Severity {
35    /// Low-severity incident that still remains visible for trend and labor follow-up.
36    Low,
37    /// Medium-severity incident requiring normal manager awareness and documentation.
38    Medium,
39    /// High-severity incident that should drive manager review and follow-up labor.
40    High,
41    /// Critical incident category for safety and customer follow-up.
42    Critical,
43}
44
45#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
46/// Review lifecycle for incidents as they move from source report to resolution.
47pub enum Status {
48    /// Reported incident category for safety and customer follow-up.
49    Reported,
50    /// Needs manager review incident category for safety and customer follow-up.
51    NeedsManagerReview,
52    /// Investigation open incident category for safety and customer follow-up.
53    InvestigationOpen,
54    /// Customer message review incident category for safety and customer follow-up.
55    CustomerMessageReview,
56    /// Owner-pet relationship was matched to a single confident record.
57    Resolved,
58    /// Closed incident category for safety and customer follow-up.
59    Closed,
60    /// Reopened incident category for safety and customer follow-up.
61    Reopened,
62    /// Legal hold incident category for safety and customer follow-up.
63    LegalHold,
64}
65
66#[nutype(
67    sanitize(trim),
68    validate(not_empty, len_char_max = 1000),
69    derive(
70        Debug,
71        Clone,
72        PartialEq,
73        Eq,
74        PartialOrd,
75        Ord,
76        Hash,
77        Serialize,
78        Deserialize
79    )
80)]
81/// Redacted incident summary used as evidence for review, not autonomous advice.
82pub struct Summary(String);