const pg = require('../pg') const joinjs = require('join-js').default; const debug = require('debug')('sos:db:config') const mappings = require('../mappings') const config = module.exports = {} config.getLatestConfig = async () => { const {rows} = await pg.query('select * from sos.v_config') return joinjs.mapOne(rows, mappings, 'configMap', 'config_') } config.getTaxRate = async () => { const current = await config.getLatestConfig() console.log(parseFloat(current.default_tax_percent)) return parseFloat(current.default_tax_percent) }