public async Task <List <Recordset> > GetInvoiceList(int customerID) { BSSAPIHelper bsshelper = new BSSAPIHelper(); OrderDataAccess _orderAccess = new OrderDataAccess(_iconfiguration); DatabaseResponse systemConfigResponse = await _orderAccess.GetConfiguration(ConfiType.System.ToString()); DatabaseResponse bssConfigResponse = await _orderAccess.GetConfiguration(ConfiType.BSS.ToString()); GridBSSConfi bssConfig = bsshelper.GetGridConfig((List <Dictionary <string, string> >)bssConfigResponse.Results); GridSystemConfig systemConfig = bsshelper.GetGridSystemConfig((List <Dictionary <string, string> >)systemConfigResponse.Results); DatabaseResponse accountResponse = await _orderAccess.GetCustomerBSSAccountNumber(customerID); if (accountResponse.ResponseCode == (int)DbReturnValue.RecordExists) { if (!string.IsNullOrEmpty(((BSSAccount)accountResponse.Results).AccountNumber)) { // Get default daterange in month from config by key - BSSInvoiceDefaultDateRangeInMonths DatabaseResponse dateRangeResponse = ConfigHelper.GetValueByKey(ConfigKeys.BSSInvoiceDefaultDateRangeInMonths.ToString(), _iconfiguration); int rangeInMonths = int.Parse(((string)dateRangeResponse.Results)); DatabaseResponse requestIdRes = await _orderAccess.GetBssApiRequestId(GridMicroservices.Customer.ToString(), BSSApis.GetInvoiceDetails.ToString(), customerID, 0, ""); BSSInvoiceResponseObject invoiceResponse = await bsshelper.GetBSSCustomerInvoice(bssConfig, ((BSSAssetRequest)requestIdRes.Results).request_id, ((BSSAccount)accountResponse.Results).AccountNumber, rangeInMonths); if (invoiceResponse.Response.result_code == "0") { // Get download link prefix from config DatabaseResponse downloadLinkResponse = ConfigHelper.GetValueByKey(ConfigKeys.BSSInvoiceDownloadLink.ToString(), _iconfiguration); string downloadLinkPrefix = (string)downloadLinkResponse.Results; foreach (Recordset recordset in invoiceResponse.Response.invoice_details.recordset) { recordset.download_url = downloadLinkPrefix + recordset.bill_id; } return(invoiceResponse.Response.invoice_details.recordset); } else { LogInfo.Warning(EnumExtensions.GetDescription(CommonErrors.NoInvoiceFound) + " : " + customerID); return(new List <Recordset>()); } } else { LogInfo.Warning(EnumExtensions.GetDescription(CommonErrors.MandatoryFieldMissing) + " for Customer - " + customerID); return(new List <Recordset>()); } } else { LogInfo.Warning(EnumExtensions.GetDescription(CommonErrors.FailedToGetBillingAccount)); return(new List <Recordset>()); } }