Expanded on existing whiteboard
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
using System.Windows.Input;
|
||||
using AipsCore.Application.Abstract.Command;
|
||||
using AipsCore.Domain.Models.Whiteboard.Enums;
|
||||
using AipsCore.Domain.Models.Whiteboard.ValueObjects;
|
||||
|
||||
namespace AipsCore.Application.Models.Whiteboard.Command.CreateWhiteboard;
|
||||
|
||||
public record CreateWhiteboardCommand(string OwnerId, string Title) : ICommand<WhiteboardId>;
|
||||
public record CreateWhiteboardCommand(
|
||||
string OwnerId,
|
||||
string Title,
|
||||
DateTime CreatedAt,
|
||||
DateTime DeletedAt,
|
||||
int MaxParticipants,
|
||||
WhiteboardJoinPolicy JoinPolicy,
|
||||
WhiteboardState State)
|
||||
: ICommand<WhiteboardId>;
|
||||
@@ -20,7 +20,15 @@ public class CreateWhiteboardCommandHandler : ICommandHandler<CreateWhiteboardCo
|
||||
{
|
||||
var whiteboardCode = await WhiteboardCode.GenerateUniqueAsync(_whiteboardRepository);
|
||||
|
||||
var whiteboard = Domain.Models.Whiteboard.Whiteboard.Create(command.OwnerId, whiteboardCode.CodeValue, command.Title);
|
||||
var whiteboard = Domain.Models.Whiteboard.Whiteboard.Create(
|
||||
command.OwnerId,
|
||||
whiteboardCode.CodeValue,
|
||||
command.Title,
|
||||
command.CreatedAt,
|
||||
command.DeletedAt,
|
||||
command.MaxParticipants,
|
||||
command.JoinPolicy,
|
||||
command.State);
|
||||
|
||||
await _whiteboardRepository.Save(whiteboard, cancellationToken);
|
||||
await _unitOfWork.SaveChangesAsync(cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user