class ProjectFinanceRowController {

    @PutMapping("/{id}")
    public RestResult<ValidationMessages> update(@PathVariable final long id, @RequestBody final FinanceRowItem financeRowItem) {
        ValidationMessages validationMessages = validationUtil.validateProjectCostItem(financeRowItem);
        if(!validationMessages.hasErrors()){
            RestResult<FinanceRowItem> updateResult = projectFinanceRowService.update(id, financeRowItem).toGetResponse();
            if (updateResult.isFailure()) {
                return restFailure(updateResult.getFailure());
            }
        }
        return restSuccess(validationMessages);
    }

}