Class InterventionResourceService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.execution.rs1.interventionresource.InterventionResourceService
@RestController
@RequestMapping("work-orders/execution/r1/interventions/resources-accounted-hours")
@Resource(logging=true)
public class InterventionResourceService
extends PrivateService
Service to manage intervention resources.
- Since:
- 18.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> Delete a intervention resource, by calling theInterventionResourceDeleteEvent.org.springframework.http.ResponseEntity<PageResponse<DTOInterventionResource>> getCollection(@Valid Page page, String order, Collection<String> fields, @Valid DTOInterventionResourceFilter filter) Returns the collection of all the stored intervention resources by calling theInterventionResourceSearchEvent.org.springframework.http.ResponseEntity<Void> patch(Long intervention, Long resource, Long workingHourType, @Valid DTOInterventionResourceUpdate dto) Update a intervention resource by calling theInterventionResourceUpdateEventorg.springframework.http.ResponseEntity<DTOIdentifier<Long>> Inserts new accounted hours for the resource by calling theInterventionResourceInsertEvent.org.springframework.http.ResponseEntity<Void> Validate an intervention resource by calling theInterventionResourceValidateEvent.
-
Constructor Details
-
InterventionResourceService
public InterventionResourceService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOInterventionResource>> getCollection(@RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,value="_order") String order, @RequestParam(required=false,value="_fields") Collection<String> fields, @Valid @Valid DTOInterventionResourceFilter filter) throws DAValidateException, DAException Returns the collection of all the stored intervention resources by calling theInterventionResourceSearchEvent.- Parameters:
page- the page that will contain the paginated resultorder- the ordering fieldfields- the collection of fields that will be contained in the responsefilter- theDTOInterventionResourceFilter- Returns:
- the collection of
DTOInterventionResources - Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionis thrown
-
post
@PostMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid @RequestBody @Valid DTOInterventionResourceInsert dto) throws DAValidateException, DAException Inserts new accounted hours for the resource by calling theInterventionResourceInsertEvent.- Parameters:
dto- theDTOInterventionResourceInsert- Returns:
- the response containing the ID of the newly created resource accounted hours
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
delete
@DeleteMapping(produces="application/json") public org.springframework.http.ResponseEntity<Void> delete(@RequestParam(name="interventionId") Long intervention, @RequestParam(name="resourceId") Long resource, @RequestParam(name="workingHourTypeId") Long workingHourType) throws DAValidateException, DAException Delete a intervention resource, by calling theInterventionResourceDeleteEvent.- Parameters:
intervention- the intervention idresource- the resource idworkingHourType- the working hour type id- Returns:
- the empty response entity
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@RequestParam(name="interventionId") Long intervention, @RequestParam(name="resourceId") Long resource, @RequestParam(name="workingHourTypeId") Long workingHourType, @Valid @RequestBody @Valid DTOInterventionResourceUpdate dto) throws DAValidateException, DAException Update a intervention resource by calling theInterventionResourceUpdateEvent- Parameters:
intervention- the intervention idresource- the resource idworkingHourType- the working hour type iddto- theDTOInterventionResourceUpdate- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
validation
@PostMapping(path="validations", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> validation(@Valid @RequestBody @Valid DTOInterventionResourceValidate dto) throws DAValidateException, DAException Validate an intervention resource by calling theInterventionResourceValidateEvent.- Parameters:
dto- theDTOInterventionResourceInsert- Returns:
- the response containing the ID of the newly created resource accounted hours
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-