Manage Appointments DONE!
This commit is contained in:
@@ -13,7 +13,7 @@ public class PatientProfileValidation : AbstractValidator<PatientProfileDto>
|
||||
|
||||
RuleFor(x => x.Id)
|
||||
.NotEmpty().WithMessage("Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
|
||||
.MustAsync(IsPatientRegistered).WithMessage("Patient is registered in system")
|
||||
.MustAsync(IsPatientRegistered).WithMessage("Patient is not registered in system")
|
||||
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
|
||||
|
||||
RuleFor(x => x.Email)
|
||||
@@ -35,8 +35,8 @@ public class PatientProfileValidation : AbstractValidator<PatientProfileDto>
|
||||
|
||||
private async Task<bool> IsPatientRegistered(Guid id, CancellationToken cancellationToken)
|
||||
{
|
||||
var doctor = await _patientRepository.GetByIdAsync(id);
|
||||
return doctor == null;
|
||||
var patient = await _patientRepository.GetByIdAsync(id);
|
||||
return patient != null;
|
||||
}
|
||||
|
||||
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
|
||||
|
||||
Reference in New Issue
Block a user