Domain entities now inheriting from abstract entity
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using AipsCore.Domain.Abstract;
|
||||
using AipsCore.Domain.Common.ValueObjects;
|
||||
using AipsCore.Domain.Models.Shape.Enums;
|
||||
using AipsCore.Domain.Models.Shape.ValueObjects;
|
||||
@@ -6,10 +7,8 @@ using AipsCore.Domain.Models.Whiteboard.ValueObjects;
|
||||
|
||||
namespace AipsCore.Domain.Models.Shape;
|
||||
|
||||
public abstract class Shape
|
||||
public abstract class Shape : DomainEntity<ShapeId>
|
||||
{
|
||||
public ShapeId Id { get; init; }
|
||||
|
||||
public WhiteboardId WhiteboardId { get; private set; }
|
||||
|
||||
public UserId AuthorId { get; private set; }
|
||||
@@ -21,8 +20,8 @@ public abstract class Shape
|
||||
public Color Color { get; private set; }
|
||||
|
||||
protected Shape(ShapeId id, WhiteboardId whiteboardId, UserId authorId, Position position, Color color)
|
||||
: base(id)
|
||||
{
|
||||
Id = id;
|
||||
Position = position;
|
||||
Color = color;
|
||||
AuthorId = authorId;
|
||||
@@ -35,10 +34,10 @@ public abstract class Shape
|
||||
int positionX, int positionY,
|
||||
string color, UserId authorId)
|
||||
{
|
||||
AuthorId = authorId;
|
||||
Id = new ShapeId(id);
|
||||
Position = new Position(positionX, positionY);
|
||||
Color = new Color(color);
|
||||
AuthorId = authorId;
|
||||
WhiteboardId = new WhiteboardId(whiteboardId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user