mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
add alert/notification functionality (for server connection events and messages)
This commit is contained in:
33
SharedLibraryCore/Alerts/Alert.cs
Normal file
33
SharedLibraryCore/Alerts/Alert.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using Data.Models.Client;
|
||||
|
||||
namespace SharedLibraryCore.Alerts;
|
||||
|
||||
public class Alert
|
||||
{
|
||||
public enum AlertCategory
|
||||
{
|
||||
Information,
|
||||
Warning,
|
||||
Error,
|
||||
Message,
|
||||
}
|
||||
|
||||
public class AlertState
|
||||
{
|
||||
public Guid AlertId { get; } = Guid.NewGuid();
|
||||
public AlertCategory Category { get; set; }
|
||||
public DateTime OccuredAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? ExpiresAt { get; set; }
|
||||
public string Message { get; set; }
|
||||
public string Source { get; set; }
|
||||
public int? RecipientId { get; set; }
|
||||
public int? SourceId { get; set; }
|
||||
public int? ReferenceId { get; set; }
|
||||
public bool? Delivered { get; set; }
|
||||
public bool? Consumed { get; set; }
|
||||
public EFClient.Permission? MinimumPermission { get; set; }
|
||||
public string Type { get; set; }
|
||||
public static AlertState Build() => new();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user