Esempio n. 1
0
        public async Task <IActionResult> GetNonBillableProducts(string code, string channel)
        {
            NonBillableProductsInfoDTO result = await _channelEnterpriseService.GetNonBillableProducts(code, channel);

            var response = new ApiResponse <NonBillableProductsInfoDTO>(result);

            return(Ok(response));
        }
        public async Task <NonBillableProductsInfoDTO> GetNonBillableProduct(string code, string channel)
        {
            GetNonBilllableProductsResult dbResult =
                await _unitOfWork.AdministrationSwitchProceduresRepository.GetNonBillableProducts(code, channel);

            if (dbResult == null)
            {
                throw new ValidationException($"Code {code} is billable");
            }

            NonBillableProductsInfoDTO result = _mapper.Map <NonBillableProductsInfoDTO>(dbResult);

            return(result);
        }