public async Task RemoveJobValuation(RemoveJobValuationRequest dto) { var employeeId = new Guid(dto.EmployeeId); var jobValuationId = new Guid(dto.JobValuationId); var serviceRequestId = new Guid(dto.ServiceRequestId); var jobValuation = await _unitOfWork.ServiceRequestJobValuations.Get(employeeId, jobValuationId, serviceRequestId); // validate if (jobValuation is null) { throw new KeyNotFoundException("JobValuation does not exist."); } var serviceRequest = await _unitOfWork.ServiceRequests.Get(serviceRequestId); if (serviceRequest.Status != Status.InProgress) { throw new AppException("This service is not in progress."); } _unitOfWork.ServiceRequestJobValuations.Remove(jobValuation); _unitOfWork.Commit(); }
public async Task <ActionResult <GetJobValuationResponse> > RemoveJobValuation(Guid serviceRequestId, [FromBody] RemoveJobValuationRequest dto) { await _serviceRequestService.RemoveJobValuation(dto); return(NoContent()); }