feat: add cashbox batches log downloader
This commit is contained in:
parent
b8ae64a798
commit
f2f34c6ecd
8 changed files with 60 additions and 30 deletions
|
|
@ -1,8 +1,11 @@
|
|||
const { parseAsync } = require('json2csv')
|
||||
const cashbox = require('../../../cashbox-batches')
|
||||
const logDateFormat = require('../../../logs').logDateFormat
|
||||
|
||||
const resolvers = {
|
||||
Query: {
|
||||
cashboxBatches: () => cashbox.getBatches()
|
||||
cashboxBatches: () => cashbox.getBatches(),
|
||||
cashboxBatchesCsv: (...[, { from, until, timezone }]) => cashbox.getBatches(from, until).then(data => parseAsync(logDateFormat(timezone, data, ['created'])))
|
||||
},
|
||||
Mutation: {
|
||||
createBatch: (...[, { deviceId, cashboxCount }]) => cashbox.createCashboxBatch(deviceId, cashboxCount),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue