Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
PhucNghi176 committed Oct 24, 2024
1 parent 8c6494f commit 9e259b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public async Task<Result> Handle(Command.CreateSlot request, CancellationToken c

return new
{
Date = x.Date,
x.Date,
StartTime = startTime,
EndTime = endTime,
IsDateInvalid = date < currentSemester.From || date > semesterEndDate,
IsDurationInvalid = duration < TimeSpan.FromHours(1.5)
IsDurationInvalid = duration < TimeSpan.FromMinutes(30) || duration > TimeSpan.FromHours(1)
};
})
.Where(x => x.IsDateInvalid || x.IsDurationInvalid)
Expand All @@ -68,7 +68,7 @@ public async Task<Result> Handle(Command.CreateSlot request, CancellationToken c

if (durationErrors.Any())
errorMessages.Add(
$"Slots must be at least 1.5 hours long. Invalid slots: {string.Join(", ", durationErrors)}");
$"Slots must be between 30 minutes and 1 hour long. Invalid slots: {string.Join(", ", durationErrors)}");

return Result.Failure(new Error("400", string.Join(". ", errorMessages)));
}
Expand Down
1 change: 0 additions & 1 deletion MBS_COMMAND.Domain/Entities/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using static MBS_CONTRACT.SHARE.Services.Mentors.DomainEvent;

namespace MBS_COMMAND.Domain.Entities;

public class User : AggregateRoot<Guid>, IAuditableEntity
{
public string Email { get; set; }
Expand Down

0 comments on commit 9e259b8

Please sign in to comment.