class MarriageDocumentTypeController {

	@PostMapping
	@RequestMapping("/_search")
	public ResponseEntity<?> search(@RequestBody @Valid RequestInfoWrapper requestInfoWrapper,
			BindingResult bindingResultsForRequestInfoWrapper,
			@ModelAttribute @Valid MarriageDocumentTypeSearchCriteria marriageDocTypeSearchCriteria,
			BindingResult bindingResult) {

		RequestInfo requestInfo = requestInfoWrapper.getRequestInfo();

		if (bindingResult.hasErrors())
			return new ResponseEntity<>(errorHandler.getErrorResponse(bindingResult, requestInfo),
					HttpStatus.BAD_REQUEST);

		ResponseEntity<?> marriageDocumentTypeResponse = null;
		try {
			marriageDocumentTypeResponse = marriageDocumentTypeService.search(marriageDocTypeSearchCriteria,
					requestInfo);
		} catch (Exception e) {
			log.info(" Error While Procssing the Request!");
			return errorHandler.getUnExpectedErrorResponse(bindingResultsForRequestInfoWrapper, requestInfo,
					"Encountered : " + e.getMessage());
		}
		return marriageDocumentTypeResponse;
	}

}