Add interval and window fields to NotificationRule

This commit is contained in:
2023-01-14 14:36:46 +00:00
parent 158fffed99
commit fbe5607899
3 changed files with 45 additions and 3 deletions

View File

@@ -23,6 +23,18 @@ PRIORITY_CHOICES = (
(5, "max"),
)
INTERVAL_CHOICES = (
("ondemand", "On demand"),
("minute", "Every minute"),
("15m", "Every 15 minutes"),
("30m", "Every 30 minutes"),
("hour", "Every hour"),
("4h", "Every 4 hours"),
("day", "Every day"),
("week", "Every week"),
("month", "Every month"),
)
class Plan(models.Model):
name = models.CharField(max_length=255, unique=True)
@@ -147,6 +159,10 @@ class NotificationRule(models.Model):
name = models.CharField(max_length=255)
priority = models.IntegerField(choices=PRIORITY_CHOICES, default=1)
topic = models.CharField(max_length=255, null=True, blank=True)
interval = models.CharField(
choices=INTERVAL_CHOICES, max_length=255, default="ondemand"
)
window = models.CharField(max_length=255, null=True, blank=True)
enabled = models.BooleanField(default=True)
data = models.TextField()