update payment

This commit is contained in:
2024-11-03 20:28:14 +07:00
parent e8c0e0d312
commit bc2eda7490
10 changed files with 208 additions and 14 deletions

View File

@@ -72,6 +72,20 @@ export class ScheduleSchema extends PothosSchema {
})
}
@PothosRef()
scheduleConnection() {
return this.builder.simpleObject('ScheduleConnection', {
fields: (t) => ({
totalCount: t.int({
nullable: true,
}),
schedules: t.field({
type: [this.schedule()],
}),
}),
})
}
@PothosRef()
scheduleSlot() {
return this.builder.simpleObject('ScheduleSlot', {
@@ -326,6 +340,28 @@ d72a864e-2f41-45ab-9c9b-bf0512a31883,e9be51fd-2382-4e43-9988-74e76fde4b56,2024-1
})
},
}),
updateScheduleStatus: t.prismaField({
type: this.schedule(),
description: 'Update a schedule status.',
args: {
scheduleId: t.arg({
type: 'String',
required: true,
}),
status: t.arg({
type: ScheduleStatus,
required: true,
}),
},
resolve: async (query, _root, args, _ctx, _info) => {
return await this.prisma.schedule.update({
...query,
where: { id: args.scheduleId },
data: { status: args.status },
})
},
}),
}))
}
}