feat(notification-outbox): add NotificationType and NotificationStatus enums
This commit is contained in:
14
src/ScadaLink.Commons/Types/Enums/NotificationStatus.cs
Normal file
14
src/ScadaLink.Commons/Types/Enums/NotificationStatus.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
namespace ScadaLink.Commons.Types.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lifecycle status of a notification in the central outbox. The site-local
|
||||||
|
/// <c>Forwarding</c> concept is intentionally not part of the central status set.
|
||||||
|
/// </summary>
|
||||||
|
public enum NotificationStatus
|
||||||
|
{
|
||||||
|
Pending,
|
||||||
|
Retrying,
|
||||||
|
Delivered,
|
||||||
|
Parked,
|
||||||
|
Discarded
|
||||||
|
}
|
||||||
9
src/ScadaLink.Commons/Types/Enums/NotificationType.cs
Normal file
9
src/ScadaLink.Commons/Types/Enums/NotificationType.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace ScadaLink.Commons.Types.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delivery channel for a notification. Currently only email is supported.
|
||||||
|
/// </summary>
|
||||||
|
public enum NotificationType
|
||||||
|
{
|
||||||
|
Email
|
||||||
|
}
|
||||||
21
tests/ScadaLink.Commons.Tests/Types/NotificationEnumTests.cs
Normal file
21
tests/ScadaLink.Commons.Tests/Types/NotificationEnumTests.cs
Normal file
@@ -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<NotificationStatus>();
|
||||||
|
Assert.Equal(
|
||||||
|
new[] { "Pending", "Retrying", "Delivered", "Parked", "Discarded" },
|
||||||
|
names);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void NotificationType_HasEmail()
|
||||||
|
{
|
||||||
|
Assert.True(Enum.IsDefined(NotificationType.Email));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user