Example #1
0
 public ClinicsController(
     IClinicApi clinicApi,
     IMapper mapper)
 {
     this.clinicApi = clinicApi;
     this.mapper    = mapper;
 }
Example #2
0
        public CreateConsultationRequestValidator(
            IClinicApi clinicApi,
            IPatientApi patientApi)
        {
            RuleFor(x => x.ClinicId)
            .NotEmpty()
            .WithMessage("Provide ClinicId")
            .MustAsync(async(clinicId, cancellationToken) =>
            {
                var clinic = await clinicApi.GetClinic(clinicId);
                if (!clinic.IsSuccessStatusCode)
                {
                    return(false);
                }

                return(true);
            })
            .WithMessage("Clinic does not exists");

            RuleFor(x => x.PatientId)
            .NotEmpty()
            .WithMessage("Provide PatientId")
            .MustAsync(async(patientId, cancellationToken) =>
            {
                var patient = await patientApi.GetPatient(patientId);
                if (!patient.IsSuccessStatusCode)
                {
                    return(false);
                }

                return(true);
            })
            .WithMessage("Patient does not exists");
        }
 public ConsultationsController(
     IConsultationApi consultationApi,
     IMapper mapper,
     IClinicApi clinicApi,
     IPatientApi patientApi)
 {
     this.consultationApi = consultationApi;
     this.mapper          = mapper;
     this.clinicApi       = clinicApi;
     this.patientApi      = patientApi;
 }
 public AppointmentsController(
     IAppointmentApi appointmentApi,
     IConsultationApi consultationApi,
     IClinicApi clinicApi,
     IPatientApi patientApi,
     IMapper mapper
     )
 {
     this.appointmentApi  = appointmentApi;
     this.consultationApi = consultationApi;
     this.clinicApi       = clinicApi;
     this.patientApi      = patientApi;
     this.mapper          = mapper;
 }