rusty_schema_diff/
report.rs1use serde::{Serialize, Deserialize};
2use std::collections::HashMap;
3use crate::analyzer::SchemaChange;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct CompatibilityReport {
8 pub changes: Vec<SchemaChange>,
10 pub compatibility_score: u8,
12 pub is_compatible: bool,
14 pub issues: Vec<CompatibilityIssue>,
16 pub metadata: HashMap<String, String>,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize)]
22pub struct CompatibilityIssue {
23 pub severity: IssueSeverity,
25 pub description: String,
27 pub location: String,
29}
30
31#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
33pub enum IssueSeverity {
34 Error,
36 Warning,
38 Info,
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
44pub struct ValidationResult {
45 pub is_valid: bool,
47 pub errors: Vec<ValidationError>,
49 pub context: HashMap<String, String>,
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55pub struct ValidationError {
56 pub message: String,
58 pub path: String,
60 pub code: String,
62}
63
64#[derive(Debug, Clone, Serialize, Deserialize)]
66pub struct MigrationPlan {
67 pub steps: Vec<String>,
69 pub metadata: HashMap<String, String>,
71}