From f9b942bb9492be0f7da44e63a872f7d6d3b1239d Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 19 May 2026 00:45:05 -0400 Subject: [PATCH] feat(notification-outbox): add NotificationType and NotificationStatus enums --- .../Types/Enums/NotificationStatus.cs | 14 +++++++++++++ .../Types/Enums/NotificationType.cs | 9 ++++++++ .../Types/NotificationEnumTests.cs | 21 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 src/ScadaLink.Commons/Types/Enums/NotificationStatus.cs create mode 100644 src/ScadaLink.Commons/Types/Enums/NotificationType.cs create mode 100644 tests/ScadaLink.Commons.Tests/Types/NotificationEnumTests.cs diff --git a/src/ScadaLink.Commons/Types/Enums/NotificationStatus.cs b/src/ScadaLink.Commons/Types/Enums/NotificationStatus.cs new file mode 100644 index 0000000..b3fb288 --- /dev/null +++ b/src/ScadaLink.Commons/Types/Enums/NotificationStatus.cs @@ -0,0 +1,14 @@ +namespace ScadaLink.Commons.Types.Enums; + +/// +/// Lifecycle status of a notification in the central outbox. The site-local +/// Forwarding concept is intentionally not part of the central status set. +/// +public enum NotificationStatus +{ + Pending, + Retrying, + Delivered, + Parked, + Discarded +} diff --git a/src/ScadaLink.Commons/Types/Enums/NotificationType.cs b/src/ScadaLink.Commons/Types/Enums/NotificationType.cs new file mode 100644 index 0000000..767975c --- /dev/null +++ b/src/ScadaLink.Commons/Types/Enums/NotificationType.cs @@ -0,0 +1,9 @@ +namespace ScadaLink.Commons.Types.Enums; + +/// +/// Delivery channel for a notification. Currently only email is supported. +/// +public enum NotificationType +{ + Email +} diff --git a/tests/ScadaLink.Commons.Tests/Types/NotificationEnumTests.cs b/tests/ScadaLink.Commons.Tests/Types/NotificationEnumTests.cs new file mode 100644 index 0000000..be6a434 --- /dev/null +++ b/tests/ScadaLink.Commons.Tests/Types/NotificationEnumTests.cs @@ -0,0 +1,21 @@ +using ScadaLink.Commons.Types.Enums; + +namespace ScadaLink.Commons.Tests.Types; + +public class NotificationEnumTests +{ + [Fact] + public void NotificationStatus_HasExactlyTheCentralStates() + { + var names = Enum.GetNames(); + Assert.Equal( + new[] { "Pending", "Retrying", "Delivered", "Parked", "Discarded" }, + names); + } + + [Fact] + public void NotificationType_HasEmail() + { + Assert.True(Enum.IsDefined(NotificationType.Email)); + } +}