Manage Appointments DONE!

This commit is contained in:
andrei-mihnea-cerbu
2024-04-08 21:29:18 +03:00
parent 8663a186a0
commit 13bfa2bdd9
91 changed files with 762 additions and 52 deletions
@@ -13,7 +13,7 @@ public class DoctorProfileValidation : AbstractValidator<DoctorProfileUpdateDto>
RuleFor(x => x.Id)
.NotEmpty().WithMessage("Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(IsDoctorRegistered).WithMessage("Doctor is registered in system")
.MustAsync(IsDoctorRegistered).WithMessage("Doctor is not registered in system")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Email)
@@ -40,7 +40,7 @@ public class DoctorProfileValidation : AbstractValidator<DoctorProfileUpdateDto>
private async Task<bool> IsDoctorRegistered(Guid id, CancellationToken cancellationToken)
{
var doctor = await _doctorRepository.GetByIdAsync(id);
return doctor == null;
return doctor != null;
}
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)