refactor: use flag in graphql objects
This commit is contained in:
parent
4116069bd5
commit
f394606821
4 changed files with 14 additions and 10 deletions
|
|
@ -16,6 +16,7 @@ const machineEventsByIdBatch = require('../../postgresql_interface').machineEven
|
|||
const promoCodeManager = require('../../promo-codes')
|
||||
const notifierQueries = require('../../notifier/queries')
|
||||
const bills = require('../bills')
|
||||
const anonymous = require('../../constants').anonymousCustomer
|
||||
|
||||
const serverVersion = require('../../../package.json').version
|
||||
const transactions = require('../transactions')
|
||||
|
|
@ -86,7 +87,7 @@ const typeDefs = gql`
|
|||
frontCameraPath: String
|
||||
frontCameraOverride: String
|
||||
phone: String
|
||||
name: String
|
||||
isAnonymous: Boolean
|
||||
smsOverride: String
|
||||
idCardData: JSONObject
|
||||
idCardDataOverride: String
|
||||
|
|
@ -213,6 +214,7 @@ const typeDefs = gql`
|
|||
cashInFeeCrypto: String
|
||||
minimumTx: Float
|
||||
customerId: ID
|
||||
isAnonymous: Boolean
|
||||
txVersion: Int!
|
||||
termsAccepted: Boolean
|
||||
commissionPercentage: String
|
||||
|
|
@ -356,7 +358,11 @@ const resolvers = {
|
|||
JSONObject: GraphQLJSONObject,
|
||||
Date: GraphQLDateTime,
|
||||
Customer: {
|
||||
transactions: parent => transactionsLoader.load(parent.id)
|
||||
transactions: parent => transactionsLoader.load(parent.id),
|
||||
isAnonymous: parent => (parent.id === anonymous.uuid)
|
||||
},
|
||||
Transaction: {
|
||||
isAnonymous: parent => (parent.customerId === anonymous.uuid)
|
||||
},
|
||||
Machine: {
|
||||
latestEvent: parent => machineEventsLoader.load(parent.deviceId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue