protected override ErrorsDTO Validate(Entry entry) { var errors = new ErrorsDTO(); if (!HasLimit(entry)) { errors.Add(entry.GetJSonFieldName("Value"), "Account don't have especial limit"); } return(errors); }
public IActionResult CashFlow([FromQuery] Account account) { var result = _balanceService.CashFlow(account); if (result == null) { var error = new ErrorsDTO(); error.Add("account", "not found"); return(new NotFoundObjectResult(error)); } return(new OkObjectResult(result)); }