2024-12-14 21:53:29 +01:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2024-12-16 17:42:16 +01:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2024-12-14 21:53:29 +01:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2024-12-16 17:42:16 +01:00
|
|
|
|
using Newtonsoft.Json;
|
2024-12-14 21:53:29 +01:00
|
|
|
|
|
|
|
|
|
namespace API.Schema.NotificationConnectors;
|
|
|
|
|
|
|
|
|
|
[PrimaryKey("NotificationConnectorId")]
|
2024-12-16 18:55:52 +01:00
|
|
|
|
public abstract class NotificationConnector(string notificationConnectorId, NotificationConnectorType notificationConnectorType)
|
2024-12-14 21:53:29 +01:00
|
|
|
|
{
|
|
|
|
|
[MaxLength(64)]
|
|
|
|
|
public string NotificationConnectorId { get; } = notificationConnectorId;
|
|
|
|
|
public NotificationConnectorType NotificationConnectorType { get; init; } = notificationConnectorType;
|
2024-12-16 17:42:16 +01:00
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
[NotMapped]
|
|
|
|
|
protected readonly HttpClient _client = new();
|
|
|
|
|
|
2024-12-16 20:33:59 +01:00
|
|
|
|
public abstract void SendNotification(string title, string notificationText);
|
2024-12-14 21:53:29 +01:00
|
|
|
|
}
|