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

@@ -23,21 +23,46 @@ export class OrderSchema extends PothosSchema {
return this.builder.prismaObject('Order', {
description: 'An order in the system.',
fields: (t) => ({
id: t.exposeID('id'),
paymentId: t.exposeString('paymentId'),
userId: t.exposeID('userId'),
serviceId: t.exposeID('serviceId'),
id: t.exposeID('id', {
description: 'The ID of the order.',
}),
paymentId: t.exposeString('paymentId', {
description: 'The ID of the payment.',
}),
userId: t.exposeID('userId', {
description: 'The ID of the user.',
}),
serviceId: t.exposeID('serviceId', {
description: 'The ID of the service.',
}),
status: t.expose('status', {
type: OrderStatus,
nullable: false,
description: 'The status of the order.',
}),
total: t.exposeInt('total', {
description: 'The total price of the order.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
description: 'The date and time the order was created.',
}),
updatedAt: t.expose('updatedAt', {
type: 'DateTime',
description: 'The date and time the order was updated.',
}),
user: t.relation('user', {
description: 'The user who made the order.',
}),
payment: t.relation('payment', {
description: 'The payment for the order.',
}),
service: t.relation('service', {
description: 'The service for the order.',
}),
refundTicket: t.relation('refundTicket', {
description: 'The refund ticket for the order.',
}),
total: t.exposeInt('total'),
createdAt: t.expose('createdAt', { type: 'DateTime' }),
updatedAt: t.expose('updatedAt', { type: 'DateTime' }),
user: t.relation('user'),
payment: t.relation('payment'),
service: t.relation('service'),
refundTicket: t.relation('refundTicket'),
}),
});
}