Exemplo n.º 1
0
        public void Create(string negotiatorEmail, CreateDebtDTO debt)
        {
            var negotiator = _userService.GetUserByEmail(negotiatorEmail);

            var calculatedDebt = this.CalculateDebt(negotiator, debt);

            _debtRepository.Create(calculatedDebt);
        }
Exemplo n.º 2
0
        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));
            }
        }