public async Task <IActionResult> JobStatusUpdate([FromBody] JobStatusUpdate request) { _diagnosticContext.SetWorkOrderId(int.Parse(request.RelatedWorkOrderReference.ID)); await _updateJobStatusUseCase.Execute(request); return(Ok()); }
public async Task Execute(string appointmentRef, int workOrderId, string notes = null) { var workOrder = await _repairsGateway.GetWorkOrder(workOrderId); if (workOrder is null) { throw new ResourceNotFoundException("work order does not exist"); } workOrder.VerifyCanBookAppointment(); await _appointmentsGateway.CreateSlotBooking(appointmentRef, workOrderId, notes); await _jobStatusUseCase.Execute(new JobStatusUpdate { Comments = notes, OtherType = CustomJobStatusUpdates.AddNote, RelatedWorkOrderReference = new Reference { ID = workOrderId.ToString() }, TypeCode = JobStatusUpdateTypeCode.Other_0 }); }