class ApplicationFinanceRowController {

    @PutMapping("/{id}")
    public RestResult<ValidationMessages> update(@PathVariable final long id, @RequestBody final FinanceRowItem financeRowItem) {
        RestResult<FinanceRowItem> updateResult = applicationFinanceRowService.update(id, financeRowItem).toGetResponse();
        if(updateResult.isFailure()){
            return RestResult.restFailure(updateResult.getFailure());
        } else {
            FinanceRowItem updatedFinanceRowItem = updateResult.getSuccess();
            ValidationMessages validationMessages = validationUtil.validateCostItem(updatedFinanceRowItem);
            return RestResult.restSuccess(validationMessages);
        }
    }

}