Expanded on existing whiteboard

This commit is contained in:
Veljko Tosic
2026-02-09 22:24:33 +01:00
parent 73b222b763
commit db122da753
12 changed files with 237 additions and 20 deletions

View File

@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using AipsCore.Domain.Models.Whiteboard.Enums;
namespace AipsCore.Infrastructure.Persistence.Whiteboard;
@@ -8,7 +9,9 @@ public class Whiteboard
public Guid Id { get; set; }
[Required]
public Guid WhiteboardOwnerId { get; set; }
public Guid OwnerId { get; set; }
public User.User Owner { get; set; } = null!;
[Required]
[MaxLength(8)]
@@ -19,4 +22,14 @@ public class Whiteboard
[MaxLength(32)]
[MinLength(3)]
public string Title { get; set; } = null!;
public DateTime CreatedAt { get; set; }
public DateTime? DeletedAt { get; set; }
public int MaxParticipants { get; set; }
public WhiteboardJoinPolicy JoinPolicy { get; set; }
public WhiteboardState State { get; set; }
}

View File

@@ -22,9 +22,14 @@ public class WhiteboardRepository : IWhiteboardRepository
return Domain.Models.Whiteboard.Whiteboard.Create(
whiteboardEntity.Id.ToString(),
whiteboardEntity.WhiteboardOwnerId.ToString(),
whiteboardEntity.OwnerId.ToString(),
whiteboardEntity.Code,
whiteboardEntity.Title);
whiteboardEntity.Title,
whiteboardEntity.CreatedAt,
whiteboardEntity.DeletedAt,
whiteboardEntity.MaxParticipants,
whiteboardEntity.JoinPolicy,
whiteboardEntity.State);
}
public async Task Save(Domain.Models.Whiteboard.Whiteboard whiteboard, CancellationToken cancellationToken = default)
@@ -33,9 +38,14 @@ public class WhiteboardRepository : IWhiteboardRepository
if (whiteboardEntity is not null)
{
whiteboardEntity.WhiteboardOwnerId = new Guid(whiteboard.WhiteboardOwnerId.IdValue);
whiteboardEntity.OwnerId = new Guid(whiteboard.WhiteboardOwnerId.IdValue);
whiteboardEntity.Code = whiteboard.Code.CodeValue;
whiteboardEntity.Title = whiteboard.Title.TitleValue;
whiteboardEntity.CreatedAt = whiteboard.CreatedAt.CreatedAtValue;
whiteboardEntity.DeletedAt = whiteboard.DeletedAt.DeletedAtValue;
whiteboardEntity.MaxParticipants = whiteboard.MaxParticipants.MaxParticipantsValue;
whiteboardEntity.JoinPolicy = whiteboard.JoinPolicy;
whiteboardEntity.State = whiteboard.State;
_context.Whiteboards.Update(whiteboardEntity);
}
@@ -44,9 +54,14 @@ public class WhiteboardRepository : IWhiteboardRepository
whiteboardEntity = new Whiteboard()
{
Id = new Guid(whiteboard.Id.IdValue),
WhiteboardOwnerId = new Guid(whiteboard.WhiteboardOwnerId.IdValue),
OwnerId = new Guid(whiteboard.WhiteboardOwnerId.IdValue),
Code = whiteboard.Code.CodeValue,
Title = whiteboard.Title.TitleValue,
CreatedAt = whiteboard.CreatedAt.CreatedAtValue,
DeletedAt = whiteboard.DeletedAt.DeletedAtValue,
MaxParticipants = whiteboard.MaxParticipants.MaxParticipantsValue,
JoinPolicy = whiteboard.JoinPolicy,
State = whiteboard.State
};
_context.Whiteboards.Add(whiteboardEntity);