switchyard/types/
report.rs

1use super::plan::Action;
2use uuid::Uuid;
3
4// Typed representation of a preflight report.
5/// Centralized under `crate::types` for cross-layer reuse.
6#[must_use]
7#[derive(Clone, Debug, Default)]
8pub struct PreflightReport {
9    /// Overall status of the preflight check
10    pub ok: bool,
11    /// List of warnings encountered during preflight
12    pub warnings: Vec<String>,
13    /// List of reasons why the operation should stop
14    pub stops: Vec<String>,
15    /// List of detailed diff rows for the preflight report
16    pub rows: Vec<serde_json::Value>,
17}
18
19// Typed representation of an apply report.
20/// Centralized under `crate::types` for cross-layer reuse.
21#[must_use]
22#[derive(Clone, Debug, Default)]
23pub struct ApplyReport {
24    /// List of actions that were executed
25    pub executed: Vec<Action>,
26    /// Duration of the apply operation in milliseconds
27    pub duration_ms: u64,
28    /// List of errors encountered during apply
29    pub errors: Vec<String>,
30    /// UUID of the plan that was applied
31    pub plan_uuid: Option<Uuid>,
32    /// Whether the operation was rolled back
33    pub rolled_back: bool,
34    /// List of errors encountered during rollback
35    pub rollback_errors: Vec<String>,
36}
37
38/// Typed representation of a prune result.
39/// Centralized under `crate::types` for cross-layer reuse.
40#[must_use]
41#[derive(Clone, Copy, Debug, Default)]
42pub struct PruneResult {
43    /// Number of items that were pruned
44    pub pruned_count: usize,
45    /// Number of items that were retained
46    pub retained_count: usize,
47}