public async Task <IActionResult> GetJobFormById(Guid id)
        {
            try
            {
                JobForm jobForm = await _jobFormRepository.GetJobFormById(id);

                return(Ok(new
                {
                    JobForm = jobForm
                }));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
示例#2
0
        public async Task <JobFormDTO> Handle(GetJobFormByIdQuery request, CancellationToken cancellationToken)
        {
            Domain.Model.Soporte.JobForm jobForm = await _jobFormRepository.GetJobFormById(request.Id);

            ServiceOrderDTO serviceOrderDTO = new ServiceOrderDTO(jobForm.Appointment.ServiceOrder.ServiceOrderId, jobForm.Appointment.ServiceOrder.CreationDate,
                                                                  jobForm.Appointment.ServiceOrder.Status);
            AppointmentDTO appointmentDTO = new AppointmentDTO(
                jobForm.Appointment.AppointmentId,
                jobForm.Appointment.Status,
                jobForm.Appointment.VisitDate,
                serviceOrderDTO
                );

            return(new JobFormDTO(
                       jobForm.JobFormId, jobForm.Detail, jobForm.Date, appointmentDTO
                       ));
        }