Add pis.services
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
f5c740bac5
commit
038670acf2
16
src/services/pis.services.js
Normal file
16
src/services/pis.services.js
Normal file
@ -0,0 +1,16 @@
|
||||
// Finds PIS Codes using DB Lookups
|
||||
|
||||
const db = require('../services/dbAccess.services')
|
||||
const log = require('../utils/log.utils')
|
||||
|
||||
async function findPisByOrigDest(start,end) {
|
||||
log.out(`pisServices.findPisByOrigDest: Searching for PIS for Orig: ${start}, Dest: ${end}`, "dbug")
|
||||
/* Here, I need to query the collection for a document with a stops array starting with $start
|
||||
and ending with $end. This will return an array of one or more pis codes and stopping patterns*/
|
||||
const search = db.query("pis", {query:query})
|
||||
return search
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
findPisByOrigDest
|
||||
}
|
Loading…
Reference in New Issue
Block a user