diff --git a/reporting-service/ReportingService.js b/reporting-service/ReportingService.js index 4664e9f..eeaa0d1 100644 --- a/reporting-service/ReportingService.js +++ b/reporting-service/ReportingService.js @@ -263,18 +263,24 @@ class ReportingService { console.log(result); } - this._bindUserDetails(evt, (err, boundEvt) => { + self.settingsService.readSetting(SETTINGS.networkName, (err, networkName) => { if (err) - return callback(`Could not bind user details`); - self.http.doPost(API_HUB_ENDPOINT, JSON.stringify(boundEvt), HEADERS, (err, result) => { + return callback(err); + + evt.networkName = networkName; + this._bindUserDetails(evt, (err, boundEvt) => { if (err) - return callback(err); - try{ - result = JSON.parse(result); - } catch (e) { - return callback(e); - } - callback(undefined, result); + return callback(`Could not bind user details`); + self.http.doPost(API_HUB_ENDPOINT, JSON.stringify(boundEvt), HEADERS, (err, result) => { + if (err) + return callback(err); + try{ + result = JSON.parse(result); + } catch (e) { + return callback(e); + } + callback(undefined, result); + }); }); }); }); diff --git a/reporting-service/constants.js b/reporting-service/constants.js index f9a4e7f..0bbc0ca 100644 --- a/reporting-service/constants.js +++ b/reporting-service/constants.js @@ -25,7 +25,8 @@ const HEADERS = { const SETTINGS = { enableAcdc: 'acdc-enabled', didKey: 'acdc-did', - locationKey: 'acdc-location' + locationKey: 'acdc-location', + networkName: "networkName" } /** diff --git a/reporting-service/middleware/acdc-middleware.js b/reporting-service/middleware/acdc-middleware.js index 7272376..43ac99c 100644 --- a/reporting-service/middleware/acdc-middleware.js +++ b/reporting-service/middleware/acdc-middleware.js @@ -56,7 +56,7 @@ function startACDCMiddleware(server){ const resolver = opendsu.loadApi('resolver'); const keyssi = opendsu.loadApi('keyssi'); - const productSSI = keyssi.createArraySSI('epi', [event.productCode]); + const productSSI = keyssi.createArraySSI(event.networkName, [event.productCode]); resolver.loadDSU(productSSI, async (err, dsu) => { if (err)