public void Create(string negotiatorEmail, CreateDebtDTO debt) { var negotiator = _userService.GetUserByEmail(negotiatorEmail); var calculatedDebt = this.CalculateDebt(negotiator, debt); _debtRepository.Create(calculatedDebt); }
public async Task <ActionResult <IEnumerable <WorkLoad> > > SetDebts([FromBody] Debt model, [FromRoute] long workLoadRegistryId) { try { await _workLoadRepository.UpdateRegistry(workLoadRegistryId); return(Ok(await _debtRepository.Create(model))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }