Update core/data_models.py
Browse files- core/data_models.py +79 -0
core/data_models.py
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Pythonic data models for ARF Demo
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass, asdict
|
| 6 |
+
from enum import Enum
|
| 7 |
+
from typing import Dict, List, Optional, Any
|
| 8 |
+
import datetime
|
| 9 |
+
|
| 10 |
+
class IncidentSeverity(Enum):
|
| 11 |
+
"""Enum for incident severity levels"""
|
| 12 |
+
LOW = "LOW"
|
| 13 |
+
MEDIUM = "MEDIUM"
|
| 14 |
+
HIGH = "HIGH"
|
| 15 |
+
CRITICAL = "CRITICAL"
|
| 16 |
+
|
| 17 |
+
class DemoMode(Enum):
|
| 18 |
+
"""Enum for demo modes"""
|
| 19 |
+
QUICK = "quick"
|
| 20 |
+
COMPREHENSIVE = "comprehensive"
|
| 21 |
+
INVESTOR = "investor"
|
| 22 |
+
|
| 23 |
+
@dataclass
|
| 24 |
+
class OSSAnalysis:
|
| 25 |
+
"""Structured OSS analysis results"""
|
| 26 |
+
status: str
|
| 27 |
+
recommendations: List[str]
|
| 28 |
+
estimated_time: str
|
| 29 |
+
engineers_needed: str
|
| 30 |
+
manual_effort: str
|
| 31 |
+
confidence_score: float = 0.95
|
| 32 |
+
|
| 33 |
+
def to_dict(self) -> Dict:
|
| 34 |
+
return asdict(self)
|
| 35 |
+
|
| 36 |
+
@dataclass
|
| 37 |
+
class EnterpriseResults:
|
| 38 |
+
"""Structured enterprise execution results"""
|
| 39 |
+
actions_completed: List[str]
|
| 40 |
+
metrics_improvement: Dict[str, str]
|
| 41 |
+
business_impact: Dict[str, Any]
|
| 42 |
+
approval_required: bool = True
|
| 43 |
+
execution_time: str = ""
|
| 44 |
+
|
| 45 |
+
def to_dict(self) -> Dict:
|
| 46 |
+
return asdict(self)
|
| 47 |
+
|
| 48 |
+
@dataclass
|
| 49 |
+
class IncidentScenario:
|
| 50 |
+
"""Pythonic incident scenario model"""
|
| 51 |
+
name: str
|
| 52 |
+
severity: IncidentSeverity
|
| 53 |
+
metrics: Dict[str, str]
|
| 54 |
+
impact: Dict[str, str]
|
| 55 |
+
oss_analysis: Optional[OSSAnalysis] = None
|
| 56 |
+
enterprise_results: Optional[EnterpriseResults] = None
|
| 57 |
+
|
| 58 |
+
def to_dict(self) -> Dict:
|
| 59 |
+
"""Convert to dictionary for JSON serialization"""
|
| 60 |
+
data = {
|
| 61 |
+
"name": self.name,
|
| 62 |
+
"severity": self.severity.value,
|
| 63 |
+
"metrics": self.metrics,
|
| 64 |
+
"impact": self.impact
|
| 65 |
+
}
|
| 66 |
+
if self.oss_analysis:
|
| 67 |
+
data["oss_analysis"] = self.oss_analysis.to_dict()
|
| 68 |
+
if self.enterprise_results:
|
| 69 |
+
data["enterprise_results"] = self.enterprise_results.to_dict()
|
| 70 |
+
return data
|
| 71 |
+
|
| 72 |
+
@dataclass
|
| 73 |
+
class DemoStep:
|
| 74 |
+
"""Demo step for presenter guidance"""
|
| 75 |
+
title: str
|
| 76 |
+
scenario: Optional[str]
|
| 77 |
+
action: str
|
| 78 |
+
message: str
|
| 79 |
+
icon: str = "🎯"
|