mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 01:23:11 -04:00
Merge branch 'main' into 2721-create-enums-and-replace-hardcoded-status-strings-with-enums-3
This commit is contained in:
35
app/enums.py
35
app/enums.py
@@ -16,6 +16,41 @@ class NotificationStatus(StrEnum):
|
||||
VALIDATION_FAILED = "validation-failed"
|
||||
CANCELLED = "cancelled"
|
||||
|
||||
@classmethod
|
||||
def sending_statuses(cls):
|
||||
return [cls.CREATED, cls.PENDING, cls.SENDING]
|
||||
|
||||
@classmethod
|
||||
def delivered_statuses(cls):
|
||||
return [cls.DELIVERED, cls.SENT]
|
||||
|
||||
@classmethod
|
||||
def failure_statuses(cls):
|
||||
return [
|
||||
cls.FAILED,
|
||||
cls.TEMPORARY_FAILURE,
|
||||
cls.PERMANENT_FAILURE,
|
||||
cls.TECHNICAL_FAILURE,
|
||||
cls.VALIDATION_FAILED,
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def requested_statuses(cls):
|
||||
return (
|
||||
cls.sending_statuses() + cls.delivered_statuses() + cls.failure_statuses()
|
||||
)
|
||||
|
||||
|
||||
class NotificationType(StrEnum):
|
||||
EMAIL = "email"
|
||||
SMS = "sms"
|
||||
|
||||
|
||||
class OrganizationType(StrEnum):
|
||||
FEDERAL = "federal"
|
||||
STATE = "state"
|
||||
OTHER = "other"
|
||||
|
||||
|
||||
class ApiKeyType(StrEnum):
|
||||
NORMAL = "normal"
|
||||
|
||||
Reference in New Issue
Block a user