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,31 +22,67 @@ export class ServiceSchema extends PothosSchema {
return this.builder.prismaObject('Service', {
description: 'A service offered by a center.',
fields: (t) => ({
id: t.exposeID('id'),
name: t.exposeString('name'),
description: t.exposeString('description'),
price: t.exposeFloat('price'),
rating: t.exposeFloat('rating'),
imageFile: t.relation('imageFile'),
imageFileId: t.exposeID('imageFileId'),
imageFileUrl: t.exposeString('imageFileUrl'),
id: t.exposeID('id', {
description: 'The ID of the service.',
}),
name: t.exposeString('name', {
description: 'The name of the service.',
}),
description: t.exposeString('description', {
description: 'The description of the service.',
}),
price: t.exposeFloat('price', {
description: 'The price of the service.',
}),
rating: t.exposeFloat('rating', {
description: 'The rating of the service.',
}),
imageFile: t.relation('imageFile', {
description: 'The image file for the service.',
}),
imageFileId: t.exposeID('imageFileId', {
description: 'The ID of the image file for the service.',
}),
imageFileUrl: t.exposeString('imageFileUrl', {
description: 'The URL of the image file for the service.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
nullable: true,
description: 'The date and time the service was created.',
}),
updatedAt: t.expose('updatedAt', {
type: 'DateTime',
nullable: true,
description: 'The date and time the service was updated.',
}),
center: t.relation('center', {
description: 'The center that offers the service.',
}),
centerId: t.exposeID('centerId', {
description: 'The ID of the center that offers the service.',
}),
workshop: t.relation('workshop', {
description: 'The workshop for the service.',
}),
milestone: t.relation('milestone', {
description: 'The milestone for the service.',
}),
schedule: t.relation('schedule', {
description: 'The schedule for the service.',
}),
serviceAndCategory: t.relation('serviceAndCategory', {
description: 'The service and category for the service.',
}),
workshopOrganization: t.relation('workshopOrganization', {
description: 'The workshop organization for the service.',
}),
user: t.relation('user', {
description: 'The user who requested the service.',
}),
userId: t.exposeID('userId', {
description: 'The ID of the user who requested the service.',
}),
center: t.relation('center'),
centerId: t.exposeID('centerId'),
workshop: t.relation('workshop'),
milestone: t.relation('milestone'),
schedule: t.relation('schedule'),
serviceAndCategory: t.relation('serviceAndCategory'),
workshopOrganization: t.relation('workshopOrganization'),
user: t.relation('user'),
userId: t.exposeID('userId'),
}),
});
}