public IActionResult GetAvailable2(SearchAppointmentsDTO appoitmentsDTO) { PriorityParameters parameters = AppointmentMapper.SearchAppointmentsDTOToPriorityParameters(appoitmentsDTO); List <Appointment> appointments = _appointmentService.GetAvailableByStrategy(parameters).ToList(); List <AvailableAppointmentsDTO> dto = AppointmentMapper.AppointmentsToAvailableAppointmentsDTOWithDoctor(appointments); return(Ok(dto)); }
public static PriorityParameters SearchAppointmentsDTOToPriorityParameters(SearchAppointmentsDTO dto) { return(new PriorityParameters { DoctorId = dto.DoctorId, ChosenStartDate = dto.StartInterval, ChosenEndDate = dto.EndInterval, Priority = IntToPriorityType(dto.Priority), SpecializationId = dto.SpecializationId }); }