class BankController {

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

		ModelMapper mapper = new ModelMapper();
		BankSearch domain = new BankSearch();
		mapper.map(bankSearchContract, domain);
		BankContract contract;
		ModelMapper model = new ModelMapper();
		List<BankContract> bankContracts = new ArrayList<>();
		Pagination<Bank> banks = bankService.search(domain, errors);

		for (Bank bank : banks.getPagedData()) {
			contract = new BankContract();
			model.map(bank, contract);
			bankContracts.add(contract);
		}

		BankResponse response = new BankResponse();
		response.setBanks(bankContracts);
		response.setPage(new PaginationContract(banks));
		response.setResponseInfo(getResponseInfo(requestInfo));

		return response;

	}

}