class BankAccountController {

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

		ModelMapper mapper = new ModelMapper();
		BankAccountSearch domain = new BankAccountSearch();
		mapper.map(bankAccountSearchContract, domain);
		BankAccountContract contract;
		ModelMapper model = new ModelMapper();
		List<BankAccountContract> bankAccountContracts = new ArrayList<>();
		Pagination<BankAccount> bankaccounts = bankAccountService.search(domain, errors);

		for (BankAccount bankAccount : bankaccounts.getPagedData()) {
			contract = new BankAccountContract();
			model.map(bankAccount, contract);
			bankAccountContracts.add(contract);
		}

		BankAccountResponse response = new BankAccountResponse();
		response.setBankAccounts(bankAccountContracts);
		response.setPage(new PaginationContract(bankaccounts));
		response.setResponseInfo(getResponseInfo(requestInfo));

		return response;

	}

}