From 05764d1897a59c616dee1f902aac4ed93dfa0beb Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Mon, 7 Aug 2023 10:36:06 +0100 Subject: [PATCH] Add test transformations to staff LDB results Signed-off-by: Fred Boniface --- src/services/ldb.services.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/services/ldb.services.js b/src/services/ldb.services.js index 670a9a6..f248372 100644 --- a/src/services/ldb.services.js +++ b/src/services/ldb.services.js @@ -6,7 +6,7 @@ const util = require('../utils/ldb.utils'); const san = require('../utils/sanitizer.utils'); const db = require('../services/dbAccess.services'); -//import { transform as staffStationTransform } from '../utils/translators/ldb/staffStation'; +import { transform as staffStationTransform } from '../utils/translators/ldb/staffStation'; const ldbKey = process.env.OWL_LDB_KEY; const ldbsvKey = process.env.OWL_LDB_SVKEY; @@ -65,7 +65,14 @@ async function arrDepBoardStaff(CRS) { services: 'PBS' }; const api = new ldb(ldbsvKey,true); - return await api.call('GetArrivalDepartureBoardByCRS',options,false,false); + const result = await api.call('GetArrivalDepartureBoardByCRS',options,false,false); + try { + const transformationTest = staffStationTransform(result) + console.log("Transformation Test Successful") + } catch (err) { + console.log("Transformation Test Failed: " + err) + } + return result } catch (err) { log.out(`ldbService.arrDepBoardStaff: Lookup Failed for: ${CRS}`, 'warn'); log.out(`ldbService.arrDepBoardStaff: ${err}`);