class AccountDetailTypeController {

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

		ModelMapper mapper = new ModelMapper();
		AccountDetailTypeSearch domain = new AccountDetailTypeSearch();
		mapper.map(accountDetailTypeSearchContract, domain);
		AccountDetailTypeContract contract;
		ModelMapper model = new ModelMapper();
		List<AccountDetailTypeContract> accountDetailTypeContracts = new ArrayList<>();
		Pagination<AccountDetailType> accountdetailtypes = accountDetailTypeService.search(domain, errors);

		for (AccountDetailType accountDetailType : accountdetailtypes.getPagedData()) {
			contract = new AccountDetailTypeContract();
			model.map(accountDetailType, contract);
			accountDetailTypeContracts.add(contract);
		}

		AccountDetailTypeResponse response = new AccountDetailTypeResponse();
		response.setAccountDetailTypes(accountDetailTypeContracts);
		response.setPage(new PaginationContract(accountdetailtypes));
		response.setResponseInfo(getResponseInfo(requestInfo));

		return response;

	}

}