This commit is contained in:
@@ -12,7 +12,7 @@ public class CreateNotificationCommand : IRequest<Result<Guid>>
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? Platform { get; set; }
|
||||
public NotificationPlatforms Platform { get; set; }
|
||||
|
||||
public string? PlatformAddress { get; set; }
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CreateNotificationCommand : IRequest<Result<Guid>>
|
||||
|
||||
public bool IsInternal { get; set; }
|
||||
|
||||
private CreateNotificationCommand(NotificationDirection direction, string author, string title, string description, string platform, string platformAddress, string correlationId, string correlationIdType, bool isInternal)
|
||||
private CreateNotificationCommand(NotificationDirection direction, string author, string title, string description, NotificationPlatforms platform, string platformAddress, string correlationId, string correlationIdType, bool isInternal)
|
||||
{
|
||||
Direction = direction;
|
||||
Author = author;
|
||||
@@ -35,7 +35,7 @@ public class CreateNotificationCommand : IRequest<Result<Guid>>
|
||||
IsInternal = isInternal;
|
||||
}
|
||||
|
||||
public static CreateNotificationCommand Create(NotificationDirection direction, string author, string title, string description, string platform, string platformAddress, string correlationId, string correlationIdType, bool isInternal)
|
||||
public static CreateNotificationCommand Create(NotificationDirection direction, string author, string title, string description, NotificationPlatforms platform, string platformAddress, string correlationId, string correlationIdType, bool isInternal)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(author))
|
||||
throw new ArgumentException("Author cannot be null or whitespace.", nameof(author));
|
||||
@@ -46,9 +46,6 @@ public class CreateNotificationCommand : IRequest<Result<Guid>>
|
||||
if (string.IsNullOrWhiteSpace(description))
|
||||
throw new ArgumentException("Description cannot be null or whitespace.", nameof(description));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(platform))
|
||||
throw new ArgumentException("Platform cannot be null or whitespace.", nameof(platform));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(platformAddress))
|
||||
throw new ArgumentException("PlatformAddress cannot be null or whitespace.", nameof(platformAddress));
|
||||
|
||||
|
||||
+4
-4
@@ -13,11 +13,11 @@ public class CreateNotificationCommandHandler(IDbContextFactory<ShopDbContext> c
|
||||
var newNotification = context.Notifications.Add(new Entities.Notification
|
||||
{
|
||||
Direction = request.Direction,
|
||||
Author = request.Author,
|
||||
Title = request.Title,
|
||||
Description = request.Description,
|
||||
Sender = request.Author,
|
||||
Subject = request.Title,
|
||||
Message = request.Description,
|
||||
Platform = request.Platform,
|
||||
PlatformAddress = request.PlatformAddress,
|
||||
Recipient = request.PlatformAddress,
|
||||
CorrelationId = request.CorrelationId,
|
||||
CorrelationIdType = request.CorrelationIdType,
|
||||
IsInternal = request.IsInternal,
|
||||
|
||||
Reference in New Issue
Block a user