newStaffLDB-API #48

Merged
fred.boniface merged 85 commits from newStaffLDB-API into main 2023-10-03 21:35:03 +01:00
1 changed files with 4 additions and 7 deletions
Showing only changes of commit 648c72fa34 - Show all commits

View File

@ -1,17 +1,14 @@
// Finds PIS Codes using DB Lookups
const db = require("../services/dbAccess.services");
const log = require("../utils/logs.utils");
const clean = require("../utils/sanitizer.utils");
import { logger } from "../utils/logger.utils";
const supported = ["GW", "UK"];
async function findPisByOrigDest(start, end) {
log.out(
"pisServices.findPisByOrigDest: Searching for PIS for Orig: " +
`${start}, Dest: ${end}`,
"dbug"
);
logger.debug(`pisServices.findPisByOrigDest: Searching for Orig: ${start}, Dest: ${end}`);
const firstCrs = clean.cleanApiEndpointTxt(start.toLowerCase());
const lastCrs = clean.cleanApiEndpointTxt(end.toLowerCase());
const query = {
@ -33,7 +30,7 @@ async function findPisByOrigDest(start, end) {
}
async function findPisByCode(code) {
log.out(`pisServices.findPisByCode: Searching for PIS code: ${code}`, "dbug");
logger.debug(`pisServices.findPisByCode: Searching for PIS code: ${code}`);
const cleanCode = clean.removeNonNumeric(code);
const query = {
code: parseInt(cleanCode),