class BankBranchController {

	@PostMapping("/_search")
	@ResponseBody
	@ResponseStatus(HttpStatus.OK)
	public BankBranchContractResponse search(@ModelAttribute BankBranchGetRequest bankBranchGetRequest,
			@RequestBody RequestInfo requestInfo, BindingResult errors) {
		final BankBranchContractRequest bankBranchContractRequest = new BankBranchContractRequest();
		bankBranchContractRequest.setBankBranchGetRequest(bankBranchGetRequest);
		bankBranchContractRequest.setRequestInfo(requestInfo);
		bankBranchService.validate(bankBranchContractRequest, "search", errors);
		if (errors.hasErrors()) {
			throw new CustomBindException(errors);
		}
		bankBranchService.fetchRelatedContracts(bankBranchContractRequest);
		BankBranchContractResponse bankBranchContractResponse = new BankBranchContractResponse();
		bankBranchContractResponse.setBankBranches(new ArrayList<BankBranchContract>());
		bankBranchContractResponse.setPage(new Pagination());

		List<BankBranchContract> bankBranchContractList = null;
		bankBranchContractList = bankBranchService.getBankBranches(bankBranchGetRequest);
		bankBranchContractResponse.getBankBranches().addAll(bankBranchContractList);

		bankBranchContractResponse.getPage().map(new PageImpl<BankBranchContract>(bankBranchContractList));
		bankBranchContractResponse.setResponseInfo(getResponseInfo(bankBranchContractRequest.getRequestInfo()));
		bankBranchContractResponse.getResponseInfo().setStatus(HttpStatus.OK.toString());
		return bankBranchContractResponse;
	}

}