update payment status string to enum
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
|||||||
} from '@smatch-corp/nestjs-pothos';
|
} from '@smatch-corp/nestjs-pothos';
|
||||||
import { Builder } from '../Graphql/graphql.builder';
|
import { Builder } from '../Graphql/graphql.builder';
|
||||||
import { PrismaService } from '../Prisma/prisma.service';
|
import { PrismaService } from '../Prisma/prisma.service';
|
||||||
|
import { PaymentStatus } from '@prisma/client';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PaymentSchema extends PothosSchema {
|
export class PaymentSchema extends PothosSchema {
|
||||||
@@ -24,7 +25,10 @@ export class PaymentSchema extends PothosSchema {
|
|||||||
fields: (t) => ({
|
fields: (t) => ({
|
||||||
id: t.exposeID('id'),
|
id: t.exposeID('id'),
|
||||||
amount: t.exposeFloat('amount'),
|
amount: t.exposeFloat('amount'),
|
||||||
status: t.exposeString('status'),
|
status: t.expose('status', {
|
||||||
|
type: PaymentStatus,
|
||||||
|
nullable: false,
|
||||||
|
}),
|
||||||
createdAt: t.expose('createdAt', { type: 'DateTime' }),
|
createdAt: t.expose('createdAt', { type: 'DateTime' }),
|
||||||
updatedAt: t.expose('updatedAt', { type: 'DateTime' }),
|
updatedAt: t.expose('updatedAt', { type: 'DateTime' }),
|
||||||
order: t.relation('Order'),
|
order: t.relation('Order'),
|
||||||
|
|||||||
Reference in New Issue
Block a user