const {
  GraphQLInputObjectType,
  GraphQLBoolean,
  GraphQLString,
  GraphQLFloat,
  GraphQLNonNull
} = require('graphql')

const addMerchantInput = new GraphQLInputObjectType({
  name: 'AddMerchantInput',
  fields: {
    name: { type: new GraphQLNonNull(GraphQLString) }
  }
})

const addTransactionInput = new GraphQLInputObjectType({
  name: 'AddTransactionInput',
  fields: {
    user_id: { type: new GraphQLNonNull(GraphQLString) },
    description: { type: new GraphQLNonNull(GraphQLString) },
    merchant_id: { type: new GraphQLNonNull(GraphQLString) },
    debit: { type: new GraphQLNonNull(GraphQLBoolean) },
    credit: { type: new GraphQLNonNull(GraphQLBoolean) },
    amount: { type: new GraphQLNonNull(GraphQLFloat) }
  }
})

const addUserInput = new GraphQLInputObjectType({
  name: 'AddUserInput',
  fields: {
    dob: { type: new GraphQLNonNull(GraphQLString) },
    firstName: { type: new GraphQLNonNull(GraphQLString) },
    lastName: { type: new GraphQLNonNull(GraphQLString) }
  }
})

const editMerchantInput = new GraphQLInputObjectType({
  name: 'EditMerchantInput',
  fields: {
    id: { type: GraphQLString },
    name: { type: GraphQLString }
  }
})

const editTransactionInput = new GraphQLInputObjectType({
  name: 'EditTransactionInput',
  fields: {
    id: { type: GraphQLString },
    user_id: { type: GraphQLString },
    description: { type: GraphQLString },
    merchant_id: { type: GraphQLString },
    debit: { type: GraphQLBoolean },
    credit: { type: GraphQLBoolean },
    amount: { type: GraphQLFloat }
  }
})

const editUserInput = new GraphQLInputObjectType({
  name: 'EditUserInput',
  fields: {
    id: { type: GraphQLString },
    dob: { type: GraphQLString },
    firstName: { type: GraphQLString },
    lastName: { type: GraphQLString }
  }
})

const removeMerchantInput = new GraphQLInputObjectType({
  name: 'RemoveMerchantInput',
  fields: {
    id: { type: new GraphQLNonNull(GraphQLString) }
  }
})

const removeTransactionInput = new GraphQLInputObjectType({
  name: 'RemoveTransactionInput',
  fields: {
    id: { type: new GraphQLNonNull(GraphQLString) }
  }
})

const removeUserInput = new GraphQLInputObjectType({
  name: 'RemoveUserInput',
  fields: {
    id: { type: new GraphQLNonNull(GraphQLString) }
  }
})

exports.addMerchantInput = addMerchantInput
exports.addTransactionInput = addTransactionInput
exports.addUserInput = addUserInput
exports.editMerchantInput = editMerchantInput
exports.editTransactionInput = editTransactionInput
exports.editUserInput = editUserInput
exports.removeMerchantInput = removeMerchantInput
exports.removeTransactionInput = removeTransactionInput
exports.removeUserInput = removeUserInput
