Add Single Customer endpoint

This commit is contained in:
goga-m 2017-09-20 20:07:39 +03:00 committed by Josh Harvey
parent ebc346c6ae
commit 0f5dfaa513
3 changed files with 246 additions and 75 deletions

View file

@ -21,6 +21,11 @@ function get (phone) {
})
}
function getById (id) {
const sql = 'select * from customers where id=$1'
return db.oneOrNone(sql, [id])
}
function getDailyVolume (id) {
return Promise.all([
db.one(`select coalesce(sum(fiat), 0) as total from cash_in_txs
@ -41,4 +46,4 @@ function batch () {
return db.any(sql, [ anonymous.uuid, NUM_RESULTS ])
}
module.exports = { add, get, batch }
module.exports = { add, get, batch, getById }