class BankBranchController {

	@PostMapping("/_search")
	@ResponseBody
	@ResponseStatus(HttpStatus.OK)
	public BankBranchResponse search(@ModelAttribute BankBranchSearchContract bankBranchSearchContract,
			@RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) {

		ModelMapper mapper = new ModelMapper();
		BankBranchSearch domain = new BankBranchSearch();
		mapper.map(bankBranchSearchContract, domain);
		BankBranchContract contract;
		ModelMapper model = new ModelMapper();
		List<BankBranchContract> bankBranchContracts = new ArrayList<>();
		Pagination<BankBranch> bankbranches = bankBranchService.search(domain, errors);

		for (BankBranch bankBranch : bankbranches.getPagedData()) {
			contract = new BankBranchContract();
			model.map(bankBranch, contract);
			bankBranchContracts.add(contract);
		}

		BankBranchResponse response = new BankBranchResponse();
		response.setBankBranches(bankBranchContracts);
		response.setPage(new PaginationContract(bankbranches));
		response.setResponseInfo(getResponseInfo(requestInfo));

		return response;

	}

}