feat: добавил отправку уведомлений по почте
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 10s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 1m17s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 12s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 10s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 1m17s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 12s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
namespace UniVerse.Application.DTOs.Notifications;
|
||||
|
||||
public static class NotificationChannels
|
||||
{
|
||||
public const string Email = "email";
|
||||
}
|
||||
|
||||
public record NotificationMessage(
|
||||
string Channel,
|
||||
string Recipient,
|
||||
string Subject,
|
||||
string Body,
|
||||
string? RecipientName = null,
|
||||
IReadOnlyDictionary<string, string>? Metadata = null);
|
||||
|
||||
public record SendNotificationRequest(
|
||||
string Channel,
|
||||
string Recipient,
|
||||
string Subject,
|
||||
string Body,
|
||||
string? RecipientName = null,
|
||||
IReadOnlyDictionary<string, string>? Metadata = null);
|
||||
|
||||
public record ScheduleNotificationRequest(
|
||||
string Channel,
|
||||
string Recipient,
|
||||
string Subject,
|
||||
string Body,
|
||||
DateTimeOffset SendAt,
|
||||
string? RecipientName = null,
|
||||
IReadOnlyDictionary<string, string>? Metadata = null);
|
||||
|
||||
public record ScheduledNotificationResponse(string JobId, DateTimeOffset SendAt);
|
||||
@@ -5,8 +5,8 @@ namespace UniVerse.Application.Interfaces;
|
||||
|
||||
public interface IAuthService
|
||||
{
|
||||
Task<AuthResult> LoginWithMicrosoftAsync(string authorizationCode, string? redirectUri = null);
|
||||
Task<AuthResult> DevLoginAsync(string email, string? displayName, Domain.Enums.UserRole role);
|
||||
Task<AuthResult> LoginWithMicrosoftAsync(string authorizationCode, string? redirectUri = null, string? ipAddress = null);
|
||||
Task<AuthResult> DevLoginAsync(string email, string? displayName, Domain.Enums.UserRole role, string? ipAddress = null);
|
||||
Task<AuthResult> RefreshTokenAsync(string refreshToken);
|
||||
Task RevokeRefreshTokenAsync(string refreshToken);
|
||||
Task<UserDto> GetCurrentUserAsync(int userId);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using UniVerse.Application.DTOs.Notifications;
|
||||
|
||||
namespace UniVerse.Application.Interfaces;
|
||||
|
||||
public interface INotificationProvider
|
||||
{
|
||||
string Channel { get; }
|
||||
Task SendAsync(NotificationMessage message, CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using UniVerse.Application.DTOs.Notifications;
|
||||
|
||||
namespace UniVerse.Application.Interfaces;
|
||||
|
||||
public interface INotificationScheduler
|
||||
{
|
||||
Task<ScheduledNotificationResponse> ScheduleAsync(NotificationMessage message, DateTimeOffset sendAt, CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using UniVerse.Application.DTOs.Notifications;
|
||||
|
||||
namespace UniVerse.Application.Interfaces;
|
||||
|
||||
public interface INotificationService
|
||||
{
|
||||
Task SendAsync(NotificationMessage message, CancellationToken cancellationToken = default);
|
||||
Task<ScheduledNotificationResponse> ScheduleAsync(ScheduleNotificationRequest request, CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user