Delete legacy alerts
This commit is contained in:
@@ -31,12 +31,6 @@ class ProductionPriorityEnum(str, Enum):
|
||||
URGENT = "urgent"
|
||||
|
||||
|
||||
class AlertSeverityEnum(str, Enum):
|
||||
"""Alert severity levels for API"""
|
||||
LOW = "low"
|
||||
MEDIUM = "medium"
|
||||
HIGH = "high"
|
||||
CRITICAL = "critical"
|
||||
|
||||
|
||||
# ================================================================
|
||||
@@ -280,61 +274,6 @@ class QualityCheckResponse(BaseModel):
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# ================================================================
|
||||
# PRODUCTION ALERT SCHEMAS
|
||||
# ================================================================
|
||||
|
||||
class ProductionAlertBase(BaseModel):
|
||||
"""Base schema for production alert"""
|
||||
alert_type: str = Field(..., min_length=1, max_length=50)
|
||||
severity: AlertSeverityEnum = AlertSeverityEnum.MEDIUM
|
||||
title: str = Field(..., min_length=1, max_length=255)
|
||||
message: str = Field(..., min_length=1)
|
||||
batch_id: Optional[UUID] = None
|
||||
schedule_id: Optional[UUID] = None
|
||||
|
||||
|
||||
class ProductionAlertCreate(ProductionAlertBase):
|
||||
"""Schema for creating a production alert"""
|
||||
recommended_actions: Optional[List[str]] = None
|
||||
impact_level: Optional[str] = Field(None, pattern="^(low|medium|high|critical)$")
|
||||
estimated_cost_impact: Optional[float] = Field(None, ge=0)
|
||||
estimated_time_impact_minutes: Optional[int] = Field(None, ge=0)
|
||||
alert_data: Optional[Dict[str, Any]] = None
|
||||
alert_metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
class ProductionAlertResponse(BaseModel):
|
||||
"""Schema for production alert response"""
|
||||
id: UUID
|
||||
tenant_id: UUID
|
||||
alert_type: str
|
||||
severity: AlertSeverityEnum
|
||||
title: str
|
||||
message: str
|
||||
batch_id: Optional[UUID]
|
||||
schedule_id: Optional[UUID]
|
||||
source_system: str
|
||||
is_active: bool
|
||||
is_acknowledged: bool
|
||||
is_resolved: bool
|
||||
recommended_actions: Optional[List[str]]
|
||||
actions_taken: Optional[List[Dict[str, Any]]]
|
||||
impact_level: Optional[str]
|
||||
estimated_cost_impact: Optional[float]
|
||||
estimated_time_impact_minutes: Optional[int]
|
||||
acknowledged_by: Optional[str]
|
||||
acknowledged_at: Optional[datetime]
|
||||
resolved_by: Optional[str]
|
||||
resolved_at: Optional[datetime]
|
||||
resolution_notes: Optional[str]
|
||||
alert_data: Optional[Dict[str, Any]]
|
||||
alert_metadata: Optional[Dict[str, Any]]
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# ================================================================
|
||||
@@ -346,7 +285,6 @@ class ProductionDashboardSummary(BaseModel):
|
||||
active_batches: int
|
||||
todays_production_plan: List[Dict[str, Any]]
|
||||
capacity_utilization: float
|
||||
current_alerts: int
|
||||
on_time_completion_rate: float
|
||||
average_quality_score: float
|
||||
total_output_today: float
|
||||
@@ -406,9 +344,3 @@ class QualityCheckListResponse(BaseModel):
|
||||
page_size: int
|
||||
|
||||
|
||||
class ProductionAlertListResponse(BaseModel):
|
||||
"""Schema for production alert list response"""
|
||||
alerts: List[ProductionAlertResponse]
|
||||
total_count: int
|
||||
page: int
|
||||
page_size: int
|
||||
Reference in New Issue
Block a user