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,9 +22,15 @@ export class CategorySchema extends PothosSchema {
return this.builder.prismaObject('Category', { return this.builder.prismaObject('Category', {
description: 'A category of services.', description: 'A category of services.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
name: t.exposeString('name'), description: 'The unique identifier of the category.',
subCategory: t.relation('SubCategory'), }),
name: t.exposeString('name', {
description: 'The name of the category.',
}),
subCategory: t.relation('SubCategory', {
description: 'The subcategory of the category.',
}),
}), }),
}); });
} }
@@ -35,10 +41,20 @@ export class CategorySchema extends PothosSchema {
description: 'A subcategory of services.', description: 'A subcategory of services.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
name: t.exposeString('name'), name: t.exposeString('name', {
categoryId: t.exposeID('categoryId'), description: 'The name of the subcategory.',
category: t.relation('category'), }),
serviceAndCategory: t.relation('serviceAndCategory'), categoryId: t.exposeID('categoryId', {
description:
'The ID of the category that the subcategory belongs to.',
}),
category: t.relation('category', {
description: 'The category that the subcategory belongs to.',
}),
serviceAndCategory: t.relation('serviceAndCategory', {
description:
'The service and category that the subcategory belongs to.',
}),
}), }),
}); });
} }

View File

@@ -22,22 +22,50 @@ export class CenterSchema extends PothosSchema {
return this.builder.prismaObject('Center', { return this.builder.prismaObject('Center', {
description: 'A center in the system.', description: 'A center in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
centerOwnerId: t.exposeID('centerOwnerId'), description: 'The unique identifier of the center.',
name: t.exposeString('name'), }),
description: t.exposeString('description'), centerOwnerId: t.exposeID('centerOwnerId', {
logoUrl: t.exposeString('logoUrl'), description: 'The ID of the center owner.',
logoFile: t.relation('logoFile'), }),
location: t.exposeString('location'), name: t.exposeString('name', {
individual: t.exposeBoolean('individual'), description: 'The name of the center.',
}),
description: t.exposeString('description', {
description: 'The description of the center.',
}),
logoUrl: t.exposeString('logoUrl', {
description: 'The URL of the center logo.',
}),
logoFile: t.relation('logoFile', {
description: 'The file associated with the center logo.',
}),
location: t.exposeString('location', {
description: 'The location of the center.',
}),
individual: t.exposeBoolean('individual', {
description: 'Whether the center is an individual center.',
}),
createdAt: t.expose('createdAt', { type: 'DateTime' }), createdAt: t.expose('createdAt', { type: 'DateTime' }),
updatedAt: t.expose('updatedAt', { type: 'DateTime' }), updatedAt: t.expose('updatedAt', { type: 'DateTime' }),
services: t.relation('services'), services: t.relation('services', {
centerOwner: t.relation('centerOwner'), description: 'The services provided by the center.',
chatRoom: t.relation('chatRoom'), }),
centerStaff: t.relation('CenterStaff'), centerOwner: t.relation('centerOwner', {
resume: t.relation('Resume'), description: 'The owner of the center.',
uploadedFileId: t.exposeID('uploadedFileId'), }),
chatRoom: t.relation('chatRoom', {
description: 'The chat room associated with the center.',
}),
centerStaff: t.relation('CenterStaff', {
description: 'The staff members of the center.',
}),
resume: t.relation('Resume', {
description: 'The resume of the center.',
}),
uploadedFileId: t.exposeID('uploadedFileId', {
description: 'The ID of the uploaded file.',
}),
}), }),
}); });
} }

View File

@@ -22,13 +22,18 @@ export class CenterStaffSchema extends PothosSchema {
return this.builder.prismaObject('CenterStaff', { return this.builder.prismaObject('CenterStaff', {
description: 'A staff member of a center.', description: 'A staff member of a center.',
fields: (t) => ({ fields: (t) => ({
staffId: t.exposeID('staffId'), staffId: t.exposeID('staffId', {
centerId: t.exposeID('centerId'), description: 'The ID of the staff member.',
serviceId: t.exposeID('serviceId'), }),
staff: t.relation('staff'), centerId: t.exposeID('centerId', {
center: t.relation('center'), description: 'The ID of the center.',
service: t.relation('service'), }),
createdWorkshop: t.relation('createdWorkshop'), serviceId: t.exposeID('serviceId', {
description: 'The ID of the service.',
}),
staff: t.relation('staff', {
description: 'The staff member.',
}),
}), }),
}); });
} }

View File

@@ -22,17 +22,37 @@ export class ChatroomSchema extends PothosSchema {
return this.builder.prismaObject('ChatRoom', { return this.builder.prismaObject('ChatRoom', {
description: 'A chat room in the system.', description: 'A chat room in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
type: t.exposeString('type'), description: 'The ID of the chat room.',
customerId: t.exposeID('customerId'), }),
centerId: t.exposeID('centerId'), type: t.exposeString('type', {
centerStaffId: t.exposeID('centerStaffId'), description: 'The type of the chat room.',
}),
customerId: t.exposeID('customerId', {
description: 'The ID of the customer.',
}),
centerId: t.exposeID('centerId', {
description: 'The ID of the center.',
}),
centerStaffId: t.exposeID('centerStaffId', {
description: 'The ID of the center staff member.',
}),
createdAt: t.expose('createdAt', { type: 'DateTime' }), createdAt: t.expose('createdAt', { type: 'DateTime' }),
message: t.relation('message'), message: t.relation('message', {
customer: t.relation('customer'), description: 'The messages in the chat room.',
center: t.relation('center'), }),
centerStaff: t.relation('centerStaff'), customer: t.relation('customer', {
meetingRoom: t.relation('meetingRoom'), description: 'The customer.',
}),
center: t.relation('center', {
description: 'The center.',
}),
centerStaff: t.relation('centerStaff', {
description: 'The center staff member.',
}),
meetingRoom: t.relation('meetingRoom', {
description: 'The meeting room.',
}),
}), }),
}); });
} }

View File

@@ -22,14 +22,30 @@ export class MessageSchema extends PothosSchema {
return this.builder.prismaObject('Message', { return this.builder.prismaObject('Message', {
description: 'A message in the system.', description: 'A message in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
senderId: t.exposeID('senderId'), description: 'The ID of the message.',
chatRoomId: t.exposeID('chatRoomId'), }),
// eslint-disable-next-line @typescript-eslint/no-explicit-any senderId: t.exposeID('senderId', {
message: t.expose('message', { type: 'Json' as any }), description: 'The ID of the sender.',
sentAt: t.expose('sentAt', { type: 'DateTime' }), }),
sender: t.relation('sender'), chatRoomId: t.exposeID('chatRoomId', {
chatRoom: t.relation('chatRoom'), description: 'The ID of the chat room.',
}),
message: t.expose('message', {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type: 'Json' as any,
description: 'The message content.',
}),
sentAt: t.expose('sentAt', {
type: 'DateTime',
description: 'The date and time the message was sent.',
}),
sender: t.relation('sender', {
description: 'The sender of the message.',
}),
chatRoom: t.relation('chatRoom', {
description: 'The chat room.',
}),
}), }),
}); });
} }

View File

@@ -22,13 +22,22 @@ export class MilestoneSchema extends PothosSchema {
return this.builder.prismaObject('Milestone', { return this.builder.prismaObject('Milestone', {
description: 'A milestone in the system.', description: 'A milestone in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
name: t.exposeString('name'), description: 'The ID of the milestone.',
order: t.exposeInt('order'), }),
description: t.exposeString('description'), name: t.exposeString('name', {
createdAt: t.expose('createdAt', { type: 'DateTime' }), description: 'The name of the milestone.',
updatedAt: t.expose('updatedAt', { type: 'DateTime' }), }),
service: t.relation('service'), order: t.exposeInt('order', {
description: 'The order of the milestone.',
}),
description: t.exposeString('description', {
description: 'The description of the milestone.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
description: 'The date and time the milestone was created.',
}),
}), }),
}); });
} }

View File

@@ -23,21 +23,46 @@ export class OrderSchema extends PothosSchema {
return this.builder.prismaObject('Order', { return this.builder.prismaObject('Order', {
description: 'An order in the system.', description: 'An order in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
paymentId: t.exposeString('paymentId'), description: 'The ID of the order.',
userId: t.exposeID('userId'), }),
serviceId: t.exposeID('serviceId'), 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', { status: t.expose('status', {
type: OrderStatus, type: OrderStatus,
nullable: false, 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'),
}), }),
}); });
} }

View File

@@ -24,15 +24,28 @@ export class PaymentSchema extends PothosSchema {
return this.builder.prismaObject('Payment', { return this.builder.prismaObject('Payment', {
description: 'A payment in the system.', description: 'A payment in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
amount: t.exposeFloat('amount'), description: 'The ID of the payment.',
}),
amount: t.exposeFloat('amount', {
description: 'The amount of the payment.',
}),
status: t.expose('status', { status: t.expose('status', {
type: PaymentStatus, type: PaymentStatus,
nullable: false, nullable: false,
description: 'The status of the payment.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
description: 'The date and time the payment was created.',
}),
updatedAt: t.expose('updatedAt', {
type: 'DateTime',
description: 'The date and time the payment was updated.',
}),
order: t.relation('Order', {
description: 'The order for the payment.',
}), }),
createdAt: t.expose('createdAt', { type: 'DateTime' }),
updatedAt: t.expose('updatedAt', { type: 'DateTime' }),
order: t.relation('Order'),
}), }),
}); });
} }

View File

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

View File

@@ -47,19 +47,31 @@ export class ResumeSchema extends PothosSchema {
return this.builder.prismaObject('ResumeFile', { return this.builder.prismaObject('ResumeFile', {
description: 'A file associated with a resume.', description: 'A file associated with a resume.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
resumeId: t.exposeID('resumeId'), description: 'The ID of the resume file.',
fileUrl: t.exposeString('fileUrl'), }),
type: t.exposeString('type'), resumeId: t.exposeID('resumeId', {
description: 'The ID of the resume.',
}),
fileUrl: t.exposeString('fileUrl', {
description: 'The URL of the resume file.',
}),
type: t.exposeString('type', {
description: 'The type of the resume file.',
}),
createdAt: t.expose('createdAt', { createdAt: t.expose('createdAt', {
type: 'DateTime', type: 'DateTime',
nullable: true, nullable: true,
description: 'The date and time the resume file was created.',
}), }),
updatedAt: t.expose('updatedAt', { updatedAt: t.expose('updatedAt', {
type: 'DateTime', type: 'DateTime',
nullable: true, nullable: true,
description: 'The date and time the resume file was updated.',
}),
resume: t.relation('resume', {
description: 'The resume for the resume file.',
}), }),
resume: t.relation('resume'),
}), }),
}); });
} }

View File

@@ -22,31 +22,67 @@ export class ServiceSchema extends PothosSchema {
return this.builder.prismaObject('Service', { return this.builder.prismaObject('Service', {
description: 'A service offered by a center.', description: 'A service offered by a center.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
name: t.exposeString('name'), description: 'The ID of the service.',
description: t.exposeString('description'), }),
price: t.exposeFloat('price'), name: t.exposeString('name', {
rating: t.exposeFloat('rating'), description: 'The name of the service.',
imageFile: t.relation('imageFile'), }),
imageFileId: t.exposeID('imageFileId'), description: t.exposeString('description', {
imageFileUrl: t.exposeString('imageFileUrl'), 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', { createdAt: t.expose('createdAt', {
type: 'DateTime', type: 'DateTime',
nullable: true, nullable: true,
description: 'The date and time the service was created.',
}), }),
updatedAt: t.expose('updatedAt', { updatedAt: t.expose('updatedAt', {
type: 'DateTime', type: 'DateTime',
nullable: true, 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'),
}), }),
}); });
} }

View File

@@ -22,10 +22,18 @@ export class ServiceAndCategorySchema extends PothosSchema {
return this.builder.prismaObject('ServiceAndCategory', { return this.builder.prismaObject('ServiceAndCategory', {
description: 'A service and category in the system.', description: 'A service and category in the system.',
fields: (t) => ({ fields: (t) => ({
serviceId: t.exposeID('serviceId'), serviceId: t.exposeID('serviceId', {
service: t.relation('service'), description: 'The ID of the service.',
subCategory: t.relation('SubCategory'), }),
subCategoryId: t.exposeID('subCategoryId'), service: t.relation('service', {
description: 'The service for the service and category.',
}),
subCategory: t.relation('SubCategory', {
description: 'The sub category for the service and category.',
}),
subCategoryId: t.exposeID('subCategoryId', {
description: 'The ID of the sub category.',
}),
}), }),
}); });
} }

View File

@@ -22,15 +22,37 @@ export class ServiceFeedbackSchema extends PothosSchema {
return this.builder.prismaObject('ServiceFeedback', { return this.builder.prismaObject('ServiceFeedback', {
description: 'A feedback for a service.', description: 'A feedback for a service.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
userId: t.exposeID('userId'), description: 'The ID of the service feedback.',
serviceId: t.exposeID('serviceId'), }),
rating: t.exposeFloat('rating'), userId: t.exposeID('userId', {
comments: t.exposeString('comments'), description: 'The ID of the user who provided the feedback.',
createdAt: t.expose('createdAt', { type: 'DateTime' }), }),
updatedAt: t.expose('updatedAt', { type: 'DateTime' }), serviceId: t.exposeID('serviceId', {
user: t.relation('user'), description: 'The ID of the service that was provided.',
service: t.relation('service'), }),
rating: t.exposeFloat('rating', {
description: 'The rating of the service.',
}),
comments: t.exposeString('comments', {
description: 'The comments of the service feedback.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
nullable: true,
description: 'The date and time the service feedback was created.',
}),
updatedAt: t.expose('updatedAt', {
type: 'DateTime',
nullable: true,
description: 'The date and time the service feedback was updated.',
}),
user: t.relation('user', {
description: 'The user who provided the feedback.',
}),
service: t.relation('service', {
description: 'The service that was provided.',
}),
}), }),
}); });
} }

View File

@@ -24,17 +24,30 @@ export class UploadedFileSchema extends PothosSchema {
return this.builder.prismaObject('UploadedFile', { return this.builder.prismaObject('UploadedFile', {
description: 'A file uploaded by a user.', description: 'A file uploaded by a user.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
userId: t.exposeID('userId'), description: 'The ID of the uploaded file.',
fileName: t.exposeString('fileName'), }),
userId: t.exposeID('userId', {
description: 'The ID of the user who uploaded the file.',
}),
fileName: t.exposeString('fileName', {
description: 'The name of the file.',
}),
// expose enum // expose enum
fileType: t.expose('fileType', { fileType: t.expose('fileType', {
type: UploadedFileType, type: UploadedFileType,
nullable: false, nullable: false,
description: 'The type of the file.',
}), }),
fileUrl: t.exposeString('fileUrl'), fileUrl: t.exposeString('fileUrl'),
uploadedAt: t.expose('uploadedAt', { type: 'DateTime' }), uploadedAt: t.expose('uploadedAt', {
user: t.relation('user'), type: 'DateTime',
nullable: true,
description: 'The date and time the file was uploaded.',
}),
user: t.relation('user', {
description: 'The user who uploaded the file.',
}),
}), }),
}); });
} }

View File

@@ -23,15 +23,38 @@ export class UserSchema extends PothosSchema {
return this.builder.prismaObject('User', { return this.builder.prismaObject('User', {
description: 'A user in the system.', description: 'A user in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
name: t.exposeString('name'), description: 'The ID of the user.',
email: t.exposeString('email'), }),
phoneNumber: t.exposeString('phoneNumber'), name: t.exposeString('name', {
oauthToken: t.exposeString('oauthToken', { nullable: true }), description: 'The name of the user.',
role: t.exposeString('role'), }),
createdAt: t.expose('createdAt', { type: 'DateTime' }), email: t.exposeString('email', {
updatedAt: t.expose('updatedAt', { type: 'DateTime' }), description: 'The email of the user.',
center: t.relation('center'), }),
phoneNumber: t.exposeString('phoneNumber', {
description: 'The phone number of the user.',
}),
oauthToken: t.exposeString('oauthToken', {
nullable: true,
description: 'The OAuth token of the user.',
}),
role: t.exposeString('role', {
description: 'The role of the user.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
nullable: true,
description: 'The date and time the user was created.',
}),
updatedAt: t.expose('updatedAt', {
type: 'DateTime',
nullable: true,
description: 'The date and time the user was updated.',
}),
center: t.relation('center', {
description: 'The center of the user.',
}),
}), }),
}); });
} }

View File

@@ -22,29 +22,58 @@ export class WorkshopSchema extends PothosSchema {
return this.builder.prismaObject('Workshop', { return this.builder.prismaObject('Workshop', {
description: 'A workshop in the system.', description: 'A workshop in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
title: t.exposeString('title'), description: 'The ID of the workshop.',
description: t.exposeString('description'), }),
staffId: t.exposeID('staffId'), title: t.exposeString('title', {
serviceId: t.exposeID('serviceId'), description: 'The title of the workshop.',
}),
description: t.exposeString('description', {
description: 'The description of the workshop.',
}),
staffId: t.exposeID('staffId', {
description:
'The ID of the staff member who is leading the workshop.',
}),
serviceId: t.exposeID('serviceId', {
description: 'The ID of the service that the workshop is for.',
}),
imageFile: t.relation('imageFile', { imageFile: t.relation('imageFile', {
nullable: true, nullable: true,
}), }),
imageFileId: t.exposeID('imageFileId'), imageFileId: t.exposeID('imageFileId', {
imageFileUrl: t.exposeString('imageFileUrl'), description: 'The ID of the image file for the workshop.',
}),
imageFileUrl: t.exposeString('imageFileUrl', {
description: 'The URL of the image file for the workshop.',
}),
date: t.expose('date', { date: t.expose('date', {
type: 'DateTime', type: 'DateTime',
nullable: true,
description: 'The date and time the workshop is scheduled.',
}), }),
createdAt: t.expose('createdAt', { createdAt: t.expose('createdAt', {
type: 'DateTime', type: 'DateTime',
nullable: true,
description: 'The date and time the workshop was created.',
}), }),
updatedAt: t.expose('updatedAt', { updatedAt: t.expose('updatedAt', {
type: 'DateTime', type: 'DateTime',
nullable: true,
description: 'The date and time the workshop was updated.',
}),
service: t.relation('service', {
description: 'The service that the workshop is for.',
}),
workshopOrganization: t.relation('workshopOrganization', {
description: 'The organization that the workshop is for.',
}),
workshopSubscription: t.relation('workshopSubscription', {
description: 'The subscription that the workshop is for.',
}),
staff: t.relation('staff', {
description: 'The staff member who is leading the workshop.',
}), }),
service: t.relation('service'),
workshopOrganization: t.relation('workshopOrganization'),
workshopSubscription: t.relation('workshopSubscription'),
staff: t.relation('staff'),
}), }),
}); });
} }

View File

@@ -21,8 +21,12 @@ export class WorkshopMeetingRoomSchema extends PothosSchema {
workshopMeetingRoom() { workshopMeetingRoom() {
return this.builder.prismaObject('WorkshopMeetingRoom', { return this.builder.prismaObject('WorkshopMeetingRoom', {
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id', {
workshopId: t.exposeID('workshopId'), description: 'The ID of the workshop meeting room.',
}),
workshopId: t.exposeID('workshopId', {
description: 'The ID of the workshop that the meeting room is for.',
}),
}), }),
}); });
} }

View File

@@ -20,10 +20,18 @@ export class WorkshopOrganizationSchema extends PothosSchema {
workshopOrganization() { workshopOrganization() {
return this.builder.prismaObject('WorkshopOrganization', { return this.builder.prismaObject('WorkshopOrganization', {
fields: (t) => ({ fields: (t) => ({
workshopId: t.exposeID('workshopId'), workshopId: t.exposeID('workshopId', {
serviceId: t.exposeID('serviceId'), description: 'The ID of the workshop that the organization is for.',
workshop: t.relation('workshop'), }),
service: t.relation('service'), serviceId: t.exposeID('serviceId', {
description: 'The ID of the service that the organization is for.',
}),
workshop: t.relation('workshop', {
description: 'The workshop that the organization is for.',
}),
service: t.relation('service', {
description: 'The service that the organization is for.',
}),
}), }),
}); });
} }

View File

@@ -21,10 +21,18 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
return this.builder.prismaObject('WorkshopSubscription', { return this.builder.prismaObject('WorkshopSubscription', {
description: 'A workshop subscription in the system.', description: 'A workshop subscription in the system.',
fields: (t) => ({ fields: (t) => ({
userId: t.exposeID('userId'), userId: t.exposeID('userId', {
workshopId: t.exposeID('workshopId'), description: 'The ID of the user who subscribed to the workshop.',
user: t.relation('user'), }),
workshop: t.relation('workshop'), workshopId: t.exposeID('workshopId', {
description: 'The ID of the workshop that the user subscribed to.',
}),
user: t.relation('user', {
description: 'The user who subscribed to the workshop.',
}),
workshop: t.relation('workshop', {
description: 'The workshop that the user subscribed to.',
}),
}), }),
}); });
} }