class DemandResponseController {

	@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
	@ResponseBody
	public DemandResponseEventReadDto update(@PathVariable(value = "id") Long id,
			@Valid @RequestBody DemandResponseEventUpdateDto event, HttpServletResponse response,
			BindingResult result) {
		Optional<DemandResponseEvent> op = demandResponseEventService.findById(id);
		if (!op.isPresent()) {
			response.setStatus(HttpStatus.NOT_FOUND_404);
			return null;
		}
		DemandResponseEvent eventOld = op.get();
		DemandResponseEvent save = demandResponseEventService.update(eventOld, event);

		response.setStatus(HttpStatus.OK_200);

		LOGGER.info("update DR event: " + save.toString());

		return dtoMapper.map(save, DemandResponseEventReadDto.class);

	}

}