From 434d30b079c3e4b7627716f772004b9cb2e0ab3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Leal?= <37.joao.leal@gmail.com> Date: Tue, 4 May 2021 12:03:44 +0100 Subject: [PATCH] fix: Record outgoing transaction fees to logs --- .../graphql/resolvers/transaction.resolver.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/new-admin/graphql/resolvers/transaction.resolver.js b/lib/new-admin/graphql/resolvers/transaction.resolver.js index 714c7157..f21d5d67 100644 --- a/lib/new-admin/graphql/resolvers/transaction.resolver.js +++ b/lib/new-admin/graphql/resolvers/transaction.resolver.js @@ -5,6 +5,17 @@ const transactions = require('../../services/transactions') const anonymous = require('../../../constants').anonymousCustomer const transactionsLoader = new DataLoader(ids => transactions.getCustomerTransactionsBatch(ids)) +const tx_logFields = ["txClass", "id", "deviceId", "toAddress", "cryptoAtoms", + "cryptoCode", "fiat", "fiatCode", "fee", "status", + "dispense", "notified", "redeem", "phone", "error", + "created", "confirmedAt", "hdIndex", "swept", "timedout", + "dispenseConfirmed", "provisioned1", "provisioned2", + "denomination1", "denomination2", "errorCode", "customerId", + "txVersion", "publishedAt", "termsAccepted", "layer2Address", + "commissionPercentage", "rawTickerPrice", "receivedCryptoAtoms", + "discount", "txHash", "customerPhone", "customerIdCardDataNumber", + "customerIdCardDataExpiration", "customerIdCardData", "customerName", + "customerFrontCameraPath", "customerIdCardPhotoPath", "expired", "machineName"] const resolvers = { Customer: { @@ -17,7 +28,7 @@ const resolvers = { transactions: (...[, { from, until, limit, offset, deviceId }]) => transactions.batch(from, until, limit, offset, deviceId), transactionsCsv: (...[, { from, until, limit, offset }]) => - transactions.batch(from, until, limit, offset).then(parseAsync) + transactions.batch(from, until, limit, offset).then(data => parseAsync(data, {fields: tx_logFields})) } }