diff --git a/MBS_COMMAND.Application/UserCases/Commands/Feedbacks/CreateFeedbackCommandHandler.cs b/MBS_COMMAND.Application/UserCases/Commands/Feedbacks/CreateFeedbackCommandHandler.cs index 6361179..ec13a33 100644 --- a/MBS_COMMAND.Application/UserCases/Commands/Feedbacks/CreateFeedbackCommandHandler.cs +++ b/MBS_COMMAND.Application/UserCases/Commands/Feedbacks/CreateFeedbackCommandHandler.cs @@ -9,6 +9,7 @@ namespace MBS_COMMAND.Application.UserCases.Commands.Feedbacks; public class CreateFeedbackCommandHandler( IRepositoryBase feedbackRepository, + ICurrentUserService currentUserService, IUnitOfWork unitOfWork) : ICommandHandler @@ -19,7 +20,6 @@ public async Task Handle(Command.CreateFeedback request, CancellationTok var feedback = new Feedback { Content = request.Content, - GroupId = request.GroupId, Rating = request.Rating, ScheduleId = request.ScheduleId, IsMentor = role, diff --git a/MBS_COMMAND.Domain/Entities/Feedback.cs b/MBS_COMMAND.Domain/Entities/Feedback.cs index fc2d2ee..93e595a 100644 --- a/MBS_COMMAND.Domain/Entities/Feedback.cs +++ b/MBS_COMMAND.Domain/Entities/Feedback.cs @@ -11,8 +11,7 @@ public class Feedback : Entity, IAuditableEntity public int Rating { get; set; } public Guid? ScheduleId { get; set; } public virtual Schedule? Schedule { get; set; } - public Guid? GroupId { get; set; } - public virtual Group? Group { get; set; } + public bool IsMentor { get; set; } public DateTimeOffset CreatedOnUtc { get; set; } public DateTimeOffset? ModifiedOnUtc { get; set; } diff --git a/MBS_COMMAND.Domain/Entities/Group.cs b/MBS_COMMAND.Domain/Entities/Group.cs index d55fbcc..71b1b96 100644 --- a/MBS_COMMAND.Domain/Entities/Group.cs +++ b/MBS_COMMAND.Domain/Entities/Group.cs @@ -1,24 +1,23 @@ using MBS_COMMAND.Domain.Abstractions.Entities; namespace MBS_COMMAND.Domain.Entities; - public class Group : Entity, IAuditableEntity { - public string Name { get; set; } - public Guid? MentorId { get; set; } + public string Name { get; set; } + public Guid? MentorId { get; set; } public virtual User? Mentor { get; set; } public Guid? LeaderId { get; set; } public virtual User? Leader { get; set; } - public string Stack { get; set; } - public Guid? ProjectId { get; set; } + public string Stack { get; set; } + + public Guid? SubjectId { get; set; } + public virtual Subject? Subject { get; set; } + + public Guid? ProjectId { get; set; } public virtual Project? Project { get; set; } - + public double? BookingPoints { get; set; } public DateTimeOffset CreatedOnUtc { get; set; } public DateTimeOffset? ModifiedOnUtc { get; set; } public virtual ICollection? Members { get; set; } = []; - - -} - - +} \ No newline at end of file diff --git a/MBS_COMMAND.Persistence/Migrations/ApplicationDbContextModelSnapshot.cs b/MBS_COMMAND.Persistence/Migrations/ApplicationDbContextModelSnapshot.cs index cfe28ac..804681a 100644 --- a/MBS_COMMAND.Persistence/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/MBS_COMMAND.Persistence/Migrations/ApplicationDbContextModelSnapshot.cs @@ -112,9 +112,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("CreatedOnUtc") .HasColumnType("datetimeoffset"); - b.Property("GroupId") - .HasColumnType("uniqueidentifier"); - b.Property("IsDeleted") .HasColumnType("bit"); @@ -132,8 +129,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("GroupId"); - b.HasIndex("ScheduleId"); b.ToTable("Feedbacks"); @@ -174,6 +169,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("nvarchar(max)"); + b.Property("SubjectId") + .HasColumnType("uniqueidentifier"); + b.HasKey("Id"); b.HasIndex("LeaderId"); @@ -182,6 +180,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ProjectId"); + b.HasIndex("SubjectId"); + b.ToTable("Groups"); }); @@ -582,16 +582,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("MBS_COMMAND.Domain.Entities.Feedback", b => { - b.HasOne("MBS_COMMAND.Domain.Entities.Group", "Group") - .WithMany() - .HasForeignKey("GroupId"); - b.HasOne("MBS_COMMAND.Domain.Entities.Schedule", "Schedule") .WithMany() .HasForeignKey("ScheduleId"); - b.Navigation("Group"); - b.Navigation("Schedule"); }); @@ -609,11 +603,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) .WithMany() .HasForeignKey("ProjectId"); + b.HasOne("MBS_COMMAND.Domain.Entities.Subject", "Subject") + .WithMany() + .HasForeignKey("SubjectId"); + b.Navigation("Leader"); b.Navigation("Mentor"); b.Navigation("Project"); + + b.Navigation("Subject"); }); modelBuilder.Entity("MBS_COMMAND.Domain.Entities.Group_Student_Mapping", b =>