Blame view
lib/report/prepaid.js
560 Bytes
d4661aa84
|
1 2 3 4 5 |
const MODULE_NAME = 'REPORT.PREPAID'; const stringify = require('json-stringify-pretty-compact'); const pull = require('komodo-sdk/gateway/pull'); |
3d8701130
|
6 |
const logger = require('tektrans-logger'); |
d4661aa84
|
7 8 9 10 11 12 13 14 |
module.exports = (xid, data) => { if (!data) return; logger.verbose(`${MODULE_NAME} 0FCACC40: Reporting to CORE`, { xid, data, }); |
92940f844
|
15 16 17 |
const reportData = JSON.parse(JSON.stringify(data)); if (typeof reportData.message !== 'string') { reportData.message = stringify(reportData.message); |
d4661aa84
|
18 |
} |
92940f844
|
19 |
pull.report(reportData); |
d4661aa84
|
20 |
}; |