diff --git a/MBS-COMMAND.API/appsettings.Development.json b/MBS-COMMAND.API/appsettings.Development.json index 70f5239..7bd0805 100644 --- a/MBS-COMMAND.API/appsettings.Development.json +++ b/MBS-COMMAND.API/appsettings.Development.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "ConnectionStrings": "Server=(local);Database=PRN_SUPER;Uid=sa;Pwd=12345;Trust Server Certificate=True;", + "ConnectionStrings": "Server=103.162.14.116;Database=PRN_SUPER;Uid=sa;Pwd=MyStrongPassword123@;Trust Server Certificate=True;", "Redis": "103.162.14.116:6379,password=MyStrongPassword123@,abortConnect=false" }, "JwtOption": { @@ -10,11 +10,11 @@ "ExpireMin": 5 }, "MasstransitConfiguration": { - "Host": "local", - "VHost": "phucnghi", + "Host": "103.162.14.116", + "VHost": "myHost", "Port": 5672, - "UserName": "guest", - "Password": "guest" + "UserName": "sa", + "Password": "MyStrongPassword123@" }, "MessageBusOptions": { "retryLimit": 3, diff --git a/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs b/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs index d2082f7..7aa8d99 100644 --- a/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs +++ b/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs @@ -32,7 +32,7 @@ public async Task Handle(Command.CreateScheduleCommand request, Cancella return Result.Failure(new Error("400", "User is not exist !")); } - var group = await _groupRepository.FindSingleAsync(x => x.LeaderId.Equals(user.Id), cancellationToken); + var group = await _groupRepository.FindSingleAsync(x => x.LeaderId.Equals(user.Id) && x.ProjectId.Equals(request.ProjectId), cancellationToken); if (group == null || group.IsDeleted) { @@ -76,6 +76,7 @@ public async Task Handle(Command.CreateScheduleCommand request, Cancella MentorId = slot.MentorId ?? new Guid(), SubjectId = request.SubjectId, GroupId = group.Id, + SlotId = slot.Id }; slot.IsBook = true; diff --git a/MBS_COMMAND.Contract/Services/Schedule/Command.cs b/MBS_COMMAND.Contract/Services/Schedule/Command.cs index b436406..bd46ab4 100644 --- a/MBS_COMMAND.Contract/Services/Schedule/Command.cs +++ b/MBS_COMMAND.Contract/Services/Schedule/Command.cs @@ -14,6 +14,7 @@ public record CreateScheduleCommand : ICommand public Guid SlotId { get; set; } public Guid SubjectId { get; set; } + public Guid ProjectId { get; set; } public string StartTime { get; set; } public string EndTime { get; set; } } diff --git a/MBS_COMMAND.Domain/Entities/Schedule.cs b/MBS_COMMAND.Domain/Entities/Schedule.cs index 3807c41..6bb9cd1 100644 --- a/MBS_COMMAND.Domain/Entities/Schedule.cs +++ b/MBS_COMMAND.Domain/Entities/Schedule.cs @@ -16,8 +16,6 @@ public class Schedule : Entity, IAuditableEntity public DateOnly Date { get; set; } public Guid SubjectId { get; set; } - public string? Description { get; set; } - public virtual Subject? Subject { get; set; } public DateTimeOffset CreatedOnUtc { get ; set ; } public DateTimeOffset? ModifiedOnUtc { get ; set ; } diff --git a/MBS_COMMAND.Presentation/APIs/MentorSkills/MentorSkillsApi.cs b/MBS_COMMAND.Presentation/APIs/MentorSkills/MentorSkillsApi.cs index 635466b..b90b85b 100644 --- a/MBS_COMMAND.Presentation/APIs/MentorSkills/MentorSkillsApi.cs +++ b/MBS_COMMAND.Presentation/APIs/MentorSkills/MentorSkillsApi.cs @@ -32,7 +32,7 @@ public static async Task CreateMentorSkills(ISender sender, [FromForm] command.MentorId = new Guid(userId); var result = await sender.Send(command); - + if (result.IsFailure) return HandlerFailure(result);