Delete legacy alerts
This commit is contained in:
@@ -86,29 +86,4 @@ class PredictionBatch(Base):
|
||||
def __repr__(self):
|
||||
return f"<PredictionBatch(id={self.id}, status={self.status})>"
|
||||
|
||||
class ForecastAlert(Base):
|
||||
"""Alerts based on forecast results"""
|
||||
__tablename__ = "forecast_alerts"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
tenant_id = Column(UUID(as_uuid=True), nullable=False, index=True)
|
||||
forecast_id = Column(UUID(as_uuid=True), nullable=False)
|
||||
|
||||
# Alert information
|
||||
alert_type = Column(String(50), nullable=False) # high_demand, low_demand, stockout_risk
|
||||
severity = Column(String(20), default="medium") # low, medium, high, critical
|
||||
message = Column(Text, nullable=False)
|
||||
|
||||
# Status
|
||||
created_at = Column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
|
||||
acknowledged_at = Column(DateTime(timezone=True))
|
||||
resolved_at = Column(DateTime(timezone=True))
|
||||
is_active = Column(Boolean, default=True)
|
||||
|
||||
# Notification
|
||||
notification_sent = Column(Boolean, default=False)
|
||||
notification_method = Column(String(50)) # email, whatsapp, sms
|
||||
|
||||
def __repr__(self):
|
||||
return f"<ForecastAlert(id={self.id}, type={self.alert_type})>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user