phong bat

This commit is contained in:
2024-10-17 15:15:08 +07:00
parent 59923b02cb
commit 5c56e79d63
19 changed files with 456 additions and 145 deletions

View File

@@ -22,12 +22,26 @@ export class RefundTicketSchema extends PothosSchema {
refundTicket() {
return this.builder.prismaObject('RefundTicket', {
fields: (t) => ({
id: t.exposeID('id'),
amount: t.exposeFloat('amount'),
status: t.exposeString('status'),
createdAt: t.expose('createdAt', { type: 'DateTime' }),
updatedAt: t.expose('updatedAt', { type: 'DateTime' }),
order: t.relation('order'),
id: t.exposeID('id', {
description: 'The ID of the refund ticket.',
}),
amount: t.exposeFloat('amount', {
description: 'The amount of the refund ticket.',
}),
status: t.exposeString('status', {
description: 'The status of the refund ticket.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
description: 'The date and time the refund ticket was created.',
}),
updatedAt: t.expose('updatedAt', {
type: 'DateTime',
description: 'The date and time the refund ticket was updated.',
}),
order: t.relation('order', {
description: 'The order for the refund ticket.',
}),
}),
});
}
@@ -38,6 +52,8 @@ export class RefundTicketSchema extends PothosSchema {
this.builder.queryFields((t) => ({
refundTickets: t.prismaField({
type: [this.refundTicket()],
description:
'Retrieve a list of refund tickets with optional filtering, ordering, and pagination.',
args: this.builder.generator.findManyArgs('RefundTicket'),
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.refundTicket.findMany({