public async Task <IActionResult> Post([FromBody] TaxpayerIRCommand model, [FromRoute] int taxpayerId) { try { return(await Response(_taxpayerIRRepository.Add(new TaxpayerIR(model.IR, taxpayerId)), ETipoResponse.Sucess)); } catch (Exception e) { return(await Response(e.Message, ETipoResponse.Error)); } }
public async Task <IActionResult> Post([FromBody] MinimumWageCommand model, [FromRoute] int taxpayerId) { try { var taxpayer = _TaxpayerRepository.GetById(taxpayerId); _taxpayerIRRepository.Add(new TaxpayerIR(_contributionIR.LiquidIncome(taxpayer.GrossIncome, taxpayer.NumberDependents, model.MinimumWageBase), taxpayerId)); return(await Response(_minimumWageRepository.Add(new MinimumWage(model.MinimumWageBase, taxpayerId)), ETipoResponse.Sucess)); } catch (Exception e) { return(await Response(e.Message, ETipoResponse.Error)); } }