From 49f9ee5cde1c8b44ef35de3335d9d393b8bd0766 Mon Sep 17 00:00:00 2001 From: Ly Tuan Kiet Date: Wed, 16 Oct 2024 16:50:19 +0700 Subject: [PATCH] update payment status string to enum --- src/Payment/payment.schema.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Payment/payment.schema.ts b/src/Payment/payment.schema.ts index 5315511..afd6d7b 100644 --- a/src/Payment/payment.schema.ts +++ b/src/Payment/payment.schema.ts @@ -7,6 +7,7 @@ import { } from '@smatch-corp/nestjs-pothos'; import { Builder } from '../Graphql/graphql.builder'; import { PrismaService } from '../Prisma/prisma.service'; +import { PaymentStatus } from '@prisma/client'; @Injectable() export class PaymentSchema extends PothosSchema { @@ -24,7 +25,10 @@ export class PaymentSchema extends PothosSchema { fields: (t) => ({ id: t.exposeID('id'), amount: t.exposeFloat('amount'), - status: t.exposeString('status'), + status: t.expose('status', { + type: PaymentStatus, + nullable: false, + }), createdAt: t.expose('createdAt', { type: 'DateTime' }), updatedAt: t.expose('updatedAt', { type: 'DateTime' }), order: t.relation('Order'),