class BudgetController {

    @PostMapping("/_search")
    @ResponseBody
    @ResponseStatus(HttpStatus.OK)
    public BudgetResponse search(@ModelAttribute final BudgetSearchContract budgetSearchContract,
            @RequestBody final RequestInfo requestInfo, final BindingResult errors) {

        final BudgetMapper mapper = new BudgetMapper();
        final BudgetSearch domain = mapper.toSearchDomain(budgetSearchContract);
        BudgetContract contract = null;
        final List<BudgetContract> budgetContracts = new ArrayList<BudgetContract>();
        final Pagination<Budget> budgets = budgetService.search(domain);

        for (final Budget budget : budgets.getPagedData()) {
            contract = mapper.toContract(budget);
            budgetContracts.add(contract);
        }

        final BudgetResponse response = new BudgetResponse();
        response.setBudgets(budgetContracts);
        response.setPage(new PaginationContract(budgets));
        response.setResponseInfo(getResponseInfo(requestInfo));

        return response;

    }

}