package com.lemans.ds.studioorder import com.lemans.LemansApiController class StudioOrderPartController extends LemansApiController { def studioOrderPartService def studioOrderPartManagerService def index(Integer studioOrderId) { Map criteria = common() + pagination() + filters(['statusId']) + [studioOrderId: studioOrderId] renderPaginated studioOrderPartService.findParts(criteria) } def show(Integer studioOrderId, String partNumber) { renderOne studioOrderPartService.findPart([studioOrderId: studioOrderId, partNumber: partNumber]) } def performActions(Integer studioOrderId) { Map data = studioOrderPartManagerService.performActions(request.JSON + [studioOrderId: studioOrderId], auditUserName) if (data?.messages) { response.status = 400 render toJson(data) } else { render(toJson(data)) } } }