v12.0.0 - initial commit
This commit is contained in:
commit
e2c49ea43c
1145 changed files with 97211 additions and 0 deletions
|
|
@ -0,0 +1,126 @@
|
|||
const { parseAsync } = require('json2csv')
|
||||
|
||||
const filters = require('../../filters')
|
||||
const cashOutTx = require('../../../cash-out/cash-out-tx')
|
||||
const cashInTx = require('../../../cash-in/cash-in-tx')
|
||||
const transactions = require('../../services/transactions')
|
||||
const anonymous = require('../../../constants').anonymousCustomer
|
||||
const logDateFormat = require('../../../logs').logDateFormat
|
||||
|
||||
const resolvers = {
|
||||
Transaction: {
|
||||
isAnonymous: parent => parent.customerId === anonymous.uuid,
|
||||
},
|
||||
Query: {
|
||||
transactions: (
|
||||
...[
|
||||
,
|
||||
{
|
||||
from,
|
||||
until,
|
||||
limit,
|
||||
offset,
|
||||
txClass,
|
||||
deviceId,
|
||||
customerName,
|
||||
customerId,
|
||||
fiatCode,
|
||||
cryptoCode,
|
||||
toAddress,
|
||||
status,
|
||||
swept,
|
||||
excludeTestingCustomers,
|
||||
},
|
||||
]
|
||||
) =>
|
||||
transactions.batch({
|
||||
from,
|
||||
until,
|
||||
limit,
|
||||
offset,
|
||||
txClass,
|
||||
deviceId,
|
||||
customerName,
|
||||
customerId,
|
||||
fiatCode,
|
||||
cryptoCode,
|
||||
toAddress,
|
||||
status,
|
||||
swept,
|
||||
excludeTestingCustomers,
|
||||
}),
|
||||
transactionsCsv: (
|
||||
...[
|
||||
,
|
||||
{
|
||||
from,
|
||||
until,
|
||||
limit,
|
||||
offset,
|
||||
txClass,
|
||||
deviceId,
|
||||
customerName,
|
||||
customerId,
|
||||
fiatCode,
|
||||
cryptoCode,
|
||||
toAddress,
|
||||
status,
|
||||
swept,
|
||||
timezone,
|
||||
excludeTestingCustomers,
|
||||
simplified,
|
||||
},
|
||||
]
|
||||
) =>
|
||||
transactions
|
||||
.batch({
|
||||
from,
|
||||
until,
|
||||
limit,
|
||||
offset,
|
||||
txClass,
|
||||
deviceId,
|
||||
customerName,
|
||||
customerId,
|
||||
fiatCode,
|
||||
cryptoCode,
|
||||
toAddress,
|
||||
status,
|
||||
swept,
|
||||
excludeTestingCustomers,
|
||||
simplified,
|
||||
})
|
||||
.then(data =>
|
||||
parseAsync(
|
||||
logDateFormat(timezone, data, [
|
||||
'created',
|
||||
'sendTime',
|
||||
'publishedAt',
|
||||
]),
|
||||
),
|
||||
),
|
||||
transactionCsv: (...[, { id, txClass, timezone }]) =>
|
||||
transactions
|
||||
.getTx(id, txClass)
|
||||
.then(data =>
|
||||
parseAsync(
|
||||
logDateFormat(
|
||||
timezone,
|
||||
[data],
|
||||
['created', 'sendTime', 'publishedAt'],
|
||||
),
|
||||
),
|
||||
),
|
||||
txAssociatedDataCsv: (...[, { id, txClass, timezone }]) =>
|
||||
transactions
|
||||
.getTxAssociatedData(id, txClass)
|
||||
.then(data => parseAsync(logDateFormat(timezone, data, ['created']))),
|
||||
transactionFilters: () => filters.transaction(),
|
||||
},
|
||||
Mutation: {
|
||||
cancelCashOutTransaction: (...[, { id }]) => cashOutTx.cancel(id),
|
||||
cancelCashInTransaction: (...[, { id }]) => cashInTx.cancel(id),
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = resolvers
|
||||
Loading…
Add table
Add a link
Reference in a new issue