update order and service

This commit is contained in:
2024-10-27 17:02:04 +07:00
parent 1a7b5a5fb6
commit 734d7e5f89
4 changed files with 31 additions and 6 deletions

View File

@@ -42,6 +42,9 @@ export class OrderSchema extends PothosSchema {
total: t.exposeInt('total', {
description: 'The total price of the order.',
}),
scheduleId: t.exposeID('scheduleId', {
description: 'The ID of the schedule.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
description: 'The date and time the order was created.',
@@ -62,6 +65,9 @@ export class OrderSchema extends PothosSchema {
refundTicket: t.relation('refundTicket', {
description: 'The refund ticket for the order.',
}),
schedule: t.relation('schedule', {
description: 'The schedule for the order.',
}),
}),
});
}
@@ -104,7 +110,10 @@ export class OrderSchema extends PothosSchema {
description: 'Create a new order.',
args: {
data: t.arg({
type: this.builder.generator.getCreateInput('Order'),
type: this.builder.generator.getCreateInput('Order', [
'status',
'total',
]),
required: true,
}),
},
@@ -136,7 +145,10 @@ export class OrderSchema extends PothosSchema {
description: 'Update an existing order.',
args: {
data: t.arg({
type: this.builder.generator.getUpdateInput('Order'),
type: this.builder.generator.getUpdateInput('Order', [
'status',
'total',
]),
required: true,
}),
where: t.arg({

View File

@@ -35,6 +35,9 @@ export class ServiceSchema extends PothosSchema {
description: t.exposeString('description', {
description: 'The description of the service.',
}),
content: t.exposeString('content', {
description: 'The content of the service.',
}),
centerId: t.exposeID('centerId', {
description: 'The ID of the center that offers the service.',
}),

File diff suppressed because one or more lines are too long