I am trying to build a Kanban Board app using .NET core for backend. I lernt that in DDD there are aggregate roots that manages a transaction at db. Only aggregates can have repositories and entities under aggregate roots fetched from db with aggregate roots repositories.
These are my entities.
public class Board : Entity, IAggregateRoot
{
public string Name { get; set; }
public string Description { get; set; }
public int CreatorUserId { get; set; }
public virtual List<PersonBoard>? PersonBoards { get; set; }
public virtual List<Card>? Cards{ get; set; }
}
public class Card : Entity
{
public string? Name { get; set; }
public int? AssignedPersonId { get; set; }
public bool? IsReassigned { get; set; }
public CardStatus Status { get; set; }
public int BoardId { get; set; }
public Color Color { get; set; }
public DateTime? AssignedDate { get; set; }
public DateTime? DueDate { get; set; }
public DateTime? FinishDate { get; set; }
public virtual List<CardFeedback> Feedbacks{ get; set; }
public virtual List<Job> Jobs { get; set; }
public virtual Person AssignedPerson { get; set; }
public virtual Board Board{ get; set; }
}
public class CardFeedback : Feedback
{
public int CardId { get; set; }
}
public class JobFeedback : Feedback
{
public int JobId { get; set; }
}
So I have a few question on my mind. When a user changed a Card's name, added JobFeedback or updated CardFeedback. Also I wanted to continuously update the changes made on frontend on the backend. In which from should I get the request from frontend. Some ideas coming to my mind. However I can't be sure that which one is more suitable or are there any better approaches.
Things that come to my mind:
- Get POST request as a whole board. When a change made on frontend it changes json of the board and send it to the backend. In handler I'll just need to updated sent board.
- In frontend create small events when it occures related part of the board will be send to the backend with boardId and the changes. So only the spesific changed part of the board will ben send to backend. However in this approach I'll need to write a lot of different endpoints and a lot of differen events on frontend.