Exemplo n.º 1
0
        public async Task AddCoverageToInsurance(ViewModel.AddCoverageRequest request)
        {
            var insurance = await _insuranceRepository.GetInsuranceAsync(request.InsuranceId);

            insurance.AddCoverage(request.CoverageId, request.Percentage);
            _insuranceRepository.UpdateInsurance(insurance);

            await _insuranceRepository.UnitOfWork.SaveEntitiesAsync();
        }
        public async Task <IActionResult> AddCoverageToInsurance([FromBody] ViewModel.AddCoverageRequest request)
        {
            await _insuranceService.AddCoverageToInsurance(request);

            return(Ok());
        }