import { schema } from 'nexus' export const Payment = schema.objectType({ name: 'Payment', definition(t) { t.model.id() t.model.status() t.model.createdAt() t.model.updatedAt() t.model.stripePaymentId() // TODO: Unsure t.model.amount() t.model.isDeposit() t.model.currency() t.model.taxes() t.model.processingFee() t.model.walterFee() t.model.total() t.model.paymentMethodId() t.model.createdBy() t.model.customer() t.model.paymentMethod() t.model.reservations() }, }) export const PaymentQueries = schema.extendType({ type: 'Query', definition(t) { t.crud.payment() t.crud.payments({ filtering: true, ordering: true }) }, }) export const PaymentMutation = schema.extendType({ type: 'Mutation', definition: (t) => { t.crud.deleteOnePayment({ alias: 'deletePayment' }) t.crud.updateOnePayment({ alias: 'updatePayment' }) t.crud.createOnePayment({ alias: 'createPayment' }) }, })