Added author to shape model

This commit is contained in:
Veljko Tosic
2026-02-09 23:48:54 +01:00
parent 1f6af52f14
commit 0d08a64e6f
9 changed files with 37 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
using AipsCore.Domain.Common.ValueObjects;
using AipsCore.Domain.Models.Shape.Enums;
using AipsCore.Domain.Models.Shape.ValueObjects;
using AipsCore.Domain.Models.User.ValueObjects;
using AipsCore.Domain.Models.Whiteboard.ValueObjects;
namespace AipsCore.Domain.Models.Shape;
@@ -11,17 +12,20 @@ public abstract class Shape
public WhiteboardId WhiteboardId { get; private set; }
public UserId AuthorId { get; private set; }
public abstract ShapeType ShapeType { get; }
public Position Position { get; private set; }
public Color Color { get; private set; }
protected Shape(ShapeId id, WhiteboardId whiteboardId, Position position, Color color)
protected Shape(ShapeId id, WhiteboardId whiteboardId, UserId authorId, Position position, Color color)
{
Id = id;
Position = position;
Color = color;
AuthorId = authorId;
WhiteboardId = whiteboardId;
}
@@ -29,8 +33,9 @@ public abstract class Shape
string id,
string whiteboardId,
int positionX, int positionY,
string color)
string color, UserId authorId)
{
AuthorId = authorId;
Id = new ShapeId(id);
Position = new Position(positionX, positionY);
Color = new Color(color);