push code push code

This commit is contained in:
2024-10-17 15:02:25 +07:00
parent 053fb38273
commit 59923b02cb
18 changed files with 106 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ export class CategorySchema extends PothosSchema {
@PothosRef() @PothosRef()
category() { category() {
return this.builder.prismaObject('Category', { return this.builder.prismaObject('Category', {
description: 'A category of services.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
name: t.exposeString('name'), name: t.exposeString('name'),
@@ -31,6 +32,7 @@ export class CategorySchema extends PothosSchema {
@PothosRef() @PothosRef()
subCategory() { subCategory() {
return this.builder.prismaObject('SubCategory', { return this.builder.prismaObject('SubCategory', {
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'),
@@ -45,6 +47,8 @@ export class CategorySchema extends PothosSchema {
init(): void { init(): void {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
categories: t.prismaField({ categories: t.prismaField({
description:
'Retrieve a list of categories with optional filtering, ordering, and pagination.',
type: [this.category()], type: [this.category()],
args: this.builder.generator.findManyArgs('Category'), args: this.builder.generator.findManyArgs('Category'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -58,6 +62,7 @@ export class CategorySchema extends PothosSchema {
}, },
}), }),
category: t.prismaField({ category: t.prismaField({
description: 'Retrieve a single category by its unique identifier.',
type: this.category(), type: this.category(),
args: this.builder.generator.findUniqueArgs('Category'), args: this.builder.generator.findUniqueArgs('Category'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -68,6 +73,8 @@ export class CategorySchema extends PothosSchema {
}, },
}), }),
subCategories: t.prismaField({ subCategories: t.prismaField({
description:
'Retrieve a list of subcategories with optional filtering, ordering, and pagination.',
type: [this.subCategory()], type: [this.subCategory()],
args: this.builder.generator.findManyArgs('SubCategory'), args: this.builder.generator.findManyArgs('SubCategory'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -85,6 +92,7 @@ export class CategorySchema extends PothosSchema {
// mutation // mutation
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
createCategory: t.prismaField({ createCategory: t.prismaField({
description: 'Create a new category.',
type: this.category(), type: this.category(),
args: { args: {
input: t.arg({ input: t.arg({
@@ -99,6 +107,7 @@ export class CategorySchema extends PothosSchema {
}, },
}), }),
createManyCategories: t.prismaField({ createManyCategories: t.prismaField({
description: 'Create multiple new categories.',
type: [this.category()], type: [this.category()],
args: { args: {
data: t.arg({ data: t.arg({
@@ -115,6 +124,7 @@ export class CategorySchema extends PothosSchema {
}), }),
createSubCategory: t.prismaField({ createSubCategory: t.prismaField({
description: 'Create a new subcategory.',
type: this.subCategory(), type: this.subCategory(),
args: { args: {
input: t.arg({ input: t.arg({

View File

@@ -20,6 +20,7 @@ export class CenterSchema extends PothosSchema {
@PothosRef() @PothosRef()
center() { center() {
return this.builder.prismaObject('Center', { return this.builder.prismaObject('Center', {
description: 'A center in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
centerOwnerId: t.exposeID('centerOwnerId'), centerOwnerId: t.exposeID('centerOwnerId'),
@@ -45,6 +46,8 @@ export class CenterSchema extends PothosSchema {
init(): void { init(): void {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
centers: t.prismaField({ centers: t.prismaField({
description:
'Retrieve a list of centers with optional filtering, ordering, and pagination.',
type: [this.center()], type: [this.center()],
args: this.builder.generator.findManyArgs('Center'), args: this.builder.generator.findManyArgs('Center'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
@@ -59,6 +62,7 @@ export class CenterSchema extends PothosSchema {
}), }),
center: t.prismaField({ center: t.prismaField({
type: this.center(), type: this.center(),
description: 'Retrieve a single center by its unique identifier.',
args: this.builder.generator.findUniqueArgs('Center'), args: this.builder.generator.findUniqueArgs('Center'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.center.findUnique({ return await this.prisma.center.findUnique({
@@ -70,6 +74,7 @@ export class CenterSchema extends PothosSchema {
// get current center of centerstaff by providing userId // get current center of centerstaff by providing userId
centerByCenterStaff: t.prismaField({ centerByCenterStaff: t.prismaField({
type: this.center(), type: this.center(),
description: 'Retrieve a single center by its unique identifier.',
args: { args: {
userId: t.arg({ type: 'String', required: true }), userId: t.arg({ type: 'String', required: true }),
}, },
@@ -90,6 +95,7 @@ export class CenterSchema extends PothosSchema {
// mutation section // mutation section
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
createCenter: t.prismaField({ createCenter: t.prismaField({
description: 'Create a new center.',
type: this.center(), type: this.center(),
args: { args: {
input: t.arg({ input: t.arg({
@@ -106,6 +112,7 @@ export class CenterSchema extends PothosSchema {
}), }),
updateCenter: t.prismaField({ updateCenter: t.prismaField({
type: this.center(), type: this.center(),
description: 'Update an existing center.',
args: { args: {
input: t.arg({ input: t.arg({
type: this.builder.generator.getUpdateInput('Center'), type: this.builder.generator.getUpdateInput('Center'),
@@ -126,6 +133,7 @@ export class CenterSchema extends PothosSchema {
}), }),
deleteCenter: t.prismaField({ deleteCenter: t.prismaField({
type: this.center(), type: this.center(),
description: 'Delete an existing center.',
args: { args: {
where: t.arg({ where: t.arg({
type: this.builder.generator.getWhereUnique('Center'), type: this.builder.generator.getWhereUnique('Center'),

View File

@@ -20,6 +20,7 @@ export class CenterStaffSchema extends PothosSchema {
@PothosRef() @PothosRef()
centerStaff() { centerStaff() {
return this.builder.prismaObject('CenterStaff', { return this.builder.prismaObject('CenterStaff', {
description: 'A staff member of a center.',
fields: (t) => ({ fields: (t) => ({
staffId: t.exposeID('staffId'), staffId: t.exposeID('staffId'),
centerId: t.exposeID('centerId'), centerId: t.exposeID('centerId'),
@@ -36,6 +37,8 @@ export class CenterStaffSchema extends PothosSchema {
init(): void { init(): void {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
centerStaff: t.prismaField({ centerStaff: t.prismaField({
description:
'Retrieve a list of center staff members with optional filtering, ordering, and pagination.',
type: [this.centerStaff()], type: [this.centerStaff()],
args: this.builder.generator.findManyArgs('CenterStaff'), args: this.builder.generator.findManyArgs('CenterStaff'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -54,6 +57,7 @@ export class CenterStaffSchema extends PothosSchema {
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
createCenterStaff: t.prismaField({ createCenterStaff: t.prismaField({
type: this.centerStaff(), type: this.centerStaff(),
description: 'Create a new center staff member.',
args: { args: {
data: t.arg({ data: t.arg({
type: this.builder.generator.getCreateInput('CenterStaff'), type: this.builder.generator.getCreateInput('CenterStaff'),
@@ -70,6 +74,7 @@ export class CenterStaffSchema extends PothosSchema {
updateCenterStaff: t.prismaField({ updateCenterStaff: t.prismaField({
type: this.centerStaff(), type: this.centerStaff(),
description: 'Update an existing center staff member.',
args: { args: {
where: t.arg({ where: t.arg({
type: this.builder.generator.getWhereUnique('CenterStaff'), type: this.builder.generator.getWhereUnique('CenterStaff'),
@@ -91,6 +96,7 @@ export class CenterStaffSchema extends PothosSchema {
deleteCenterStaff: t.prismaField({ deleteCenterStaff: t.prismaField({
type: this.centerStaff(), type: this.centerStaff(),
description: 'Delete an existing center staff member.',
args: { args: {
where: t.arg({ where: t.arg({
type: this.builder.generator.getWhereUnique('CenterStaff'), type: this.builder.generator.getWhereUnique('CenterStaff'),

View File

@@ -20,6 +20,7 @@ export class ChatroomSchema extends PothosSchema {
@PothosRef() @PothosRef()
chatRoom() { chatRoom() {
return this.builder.prismaObject('ChatRoom', { return this.builder.prismaObject('ChatRoom', {
description: 'A chat room in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
type: t.exposeString('type'), type: t.exposeString('type'),
@@ -41,6 +42,7 @@ export class ChatroomSchema extends PothosSchema {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
chatRoom: t.prismaField({ chatRoom: t.prismaField({
type: this.chatRoom(), type: this.chatRoom(),
description: 'Retrieve a single chat room by its unique identifier.',
args: this.builder.generator.findUniqueArgs('ChatRoom'), args: this.builder.generator.findUniqueArgs('ChatRoom'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.chatRoom.findUnique({ return await this.prisma.chatRoom.findUnique({
@@ -52,6 +54,8 @@ export class ChatroomSchema extends PothosSchema {
chatRooms: t.prismaField({ chatRooms: t.prismaField({
type: [this.chatRoom()], type: [this.chatRoom()],
description:
'Retrieve a list of chat rooms with optional filtering, ordering, and pagination.',
args: this.builder.generator.findManyArgs('ChatRoom'), args: this.builder.generator.findManyArgs('ChatRoom'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.chatRoom.findMany({ return await this.prisma.chatRoom.findMany({

View File

@@ -20,6 +20,7 @@ export class MessageSchema extends PothosSchema {
@PothosRef() @PothosRef()
message() { message() {
return this.builder.prismaObject('Message', { return this.builder.prismaObject('Message', {
description: 'A message in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
senderId: t.exposeID('senderId'), senderId: t.exposeID('senderId'),
@@ -38,6 +39,7 @@ export class MessageSchema extends PothosSchema {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
message: t.prismaField({ message: t.prismaField({
type: this.message(), type: this.message(),
description: 'Retrieve a single message by its unique identifier.',
args: this.builder.generator.findUniqueArgs('Message'), args: this.builder.generator.findUniqueArgs('Message'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
return await this.prisma.message.findUnique({ return await this.prisma.message.findUnique({
@@ -48,6 +50,8 @@ export class MessageSchema extends PothosSchema {
}), }),
messages: t.prismaField({ messages: t.prismaField({
type: [this.message()], type: [this.message()],
description:
'Retrieve a list of messages with optional filtering, ordering, and pagination.',
args: this.builder.generator.findManyArgs('Message'), args: this.builder.generator.findManyArgs('Message'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
return await this.prisma.message.findMany({ return await this.prisma.message.findMany({

View File

@@ -20,6 +20,7 @@ export class MilestoneSchema extends PothosSchema {
@PothosRef() @PothosRef()
milestone() { milestone() {
return this.builder.prismaObject('Milestone', { return this.builder.prismaObject('Milestone', {
description: 'A milestone in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
name: t.exposeString('name'), name: t.exposeString('name'),
@@ -38,6 +39,8 @@ export class MilestoneSchema extends PothosSchema {
milestones: t.prismaField({ milestones: t.prismaField({
type: [this.milestone()], type: [this.milestone()],
args: this.builder.generator.findManyArgs('Milestone'), args: this.builder.generator.findManyArgs('Milestone'),
description:
'Retrieve a list of milestones with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.milestone.findMany({ return await this.prisma.milestone.findMany({
...query, ...query,
@@ -51,6 +54,7 @@ export class MilestoneSchema extends PothosSchema {
milestone: t.prismaField({ milestone: t.prismaField({
type: this.milestone(), type: this.milestone(),
args: this.builder.generator.findUniqueArgs('Milestone'), args: this.builder.generator.findUniqueArgs('Milestone'),
description: 'Retrieve a single milestone by its unique identifier.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.milestone.findUnique({ return await this.prisma.milestone.findUnique({
...query, ...query,

View File

@@ -21,6 +21,7 @@ export class OrderSchema extends PothosSchema {
@PothosRef() @PothosRef()
order() { order() {
return this.builder.prismaObject('Order', { return this.builder.prismaObject('Order', {
description: 'An order in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
paymentId: t.exposeString('paymentId'), paymentId: t.exposeString('paymentId'),
@@ -47,6 +48,8 @@ export class OrderSchema extends PothosSchema {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
orders: t.prismaField({ orders: t.prismaField({
type: [this.order()], type: [this.order()],
description:
'Retrieve a list of orders with optional filtering, ordering, and pagination.',
args: this.builder.generator.findManyArgs('Order'), args: this.builder.generator.findManyArgs('Order'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.order.findMany({ return await this.prisma.order.findMany({
@@ -61,6 +64,7 @@ export class OrderSchema extends PothosSchema {
order: t.prismaField({ order: t.prismaField({
type: this.order(), type: this.order(),
args: this.builder.generator.findUniqueArgs('Order'), args: this.builder.generator.findUniqueArgs('Order'),
description: 'Retrieve a single order by its unique identifier.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.order.findUnique({ return await this.prisma.order.findUnique({
...query, ...query,
@@ -73,6 +77,7 @@ export class OrderSchema extends PothosSchema {
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
createOrder: t.prismaField({ createOrder: t.prismaField({
type: this.order(), type: this.order(),
description: 'Create a new order.',
args: { args: {
data: t.arg({ data: t.arg({
type: this.builder.generator.getCreateInput('Order'), type: this.builder.generator.getCreateInput('Order'),
@@ -88,6 +93,7 @@ export class OrderSchema extends PothosSchema {
}), }),
deleteOrder: t.prismaField({ deleteOrder: t.prismaField({
type: this.order(), type: this.order(),
description: 'Delete an existing order.',
args: { args: {
where: t.arg({ where: t.arg({
type: this.builder.generator.getWhereUnique('Order'), type: this.builder.generator.getWhereUnique('Order'),
@@ -103,6 +109,7 @@ export class OrderSchema extends PothosSchema {
}), }),
updateOrder: t.prismaField({ updateOrder: t.prismaField({
type: this.order(), type: this.order(),
description: 'Update an existing order.',
args: { args: {
data: t.arg({ data: t.arg({
type: this.builder.generator.getUpdateInput('Order'), type: this.builder.generator.getUpdateInput('Order'),

View File

@@ -22,6 +22,7 @@ export class PaymentSchema extends PothosSchema {
@PothosRef() @PothosRef()
payment() { payment() {
return this.builder.prismaObject('Payment', { return this.builder.prismaObject('Payment', {
description: 'A payment in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
amount: t.exposeFloat('amount'), amount: t.exposeFloat('amount'),
@@ -42,6 +43,7 @@ export class PaymentSchema extends PothosSchema {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
payment: t.prismaField({ payment: t.prismaField({
type: this.payment(), type: this.payment(),
description: 'Retrieve a single payment by its unique identifier.',
args: this.builder.generator.findUniqueArgs('Payment'), args: this.builder.generator.findUniqueArgs('Payment'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.payment.findUnique({ return await this.prisma.payment.findUnique({
@@ -53,6 +55,8 @@ export class PaymentSchema extends PothosSchema {
payments: t.prismaField({ payments: t.prismaField({
type: [this.payment()], type: [this.payment()],
args: this.builder.generator.findManyArgs('Payment'), args: this.builder.generator.findManyArgs('Payment'),
description:
'Retrieve a list of payments with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.payment.findMany({ return await this.prisma.payment.findMany({
...query, ...query,

View File

@@ -22,6 +22,7 @@ export class ResumeSchema extends PothosSchema {
@PothosRef() @PothosRef()
resume() { resume() {
return this.builder.prismaObject('Resume', { return this.builder.prismaObject('Resume', {
description: 'A resume in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
userId: t.exposeID('userId'), userId: t.exposeID('userId'),
@@ -44,6 +45,7 @@ export class ResumeSchema extends PothosSchema {
@PothosRef() @PothosRef()
resumeFile() { resumeFile() {
return this.builder.prismaObject('ResumeFile', { return this.builder.prismaObject('ResumeFile', {
description: 'A file associated with a resume.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
resumeId: t.exposeID('resumeId'), resumeId: t.exposeID('resumeId'),
@@ -65,6 +67,8 @@ export class ResumeSchema extends PothosSchema {
init(): void { init(): void {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
resumes: t.prismaField({ resumes: t.prismaField({
description:
'Retrieve a list of resumes with optional filtering, ordering, and pagination.',
type: [this.resume()], type: [this.resume()],
args: this.builder.generator.findManyArgs('Resume'), args: this.builder.generator.findManyArgs('Resume'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -79,6 +83,7 @@ export class ResumeSchema extends PothosSchema {
}), }),
resume: t.prismaField({ resume: t.prismaField({
description: 'Retrieve a single resume by its unique identifier.',
type: this.resume(), type: this.resume(),
args: this.builder.generator.findUniqueArgs('Resume'), args: this.builder.generator.findUniqueArgs('Resume'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -91,6 +96,7 @@ export class ResumeSchema extends PothosSchema {
}), }),
resumeFile: t.prismaField({ resumeFile: t.prismaField({
description: 'Retrieve a single resume file by its unique identifier.',
type: this.resumeFile(), type: this.resumeFile(),
args: this.builder.generator.findUniqueArgs('ResumeFile'), args: this.builder.generator.findUniqueArgs('ResumeFile'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -105,6 +111,8 @@ export class ResumeSchema extends PothosSchema {
}, },
}), }),
resumeFiles: t.prismaField({ resumeFiles: t.prismaField({
description:
'Retrieve a list of resume files with optional filtering, ordering, and pagination.',
type: [this.resumeFile()], type: [this.resumeFile()],
args: this.builder.generator.findManyArgs('ResumeFile'), args: this.builder.generator.findManyArgs('ResumeFile'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -124,6 +132,7 @@ export class ResumeSchema extends PothosSchema {
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
upsertResume: t.prismaField({ upsertResume: t.prismaField({
type: this.resume(), type: this.resume(),
description: 'Create or update a resume.',
args: { args: {
resumeFile: t.arg({ resumeFile: t.arg({
type: 'Upload', type: 'Upload',
@@ -183,6 +192,7 @@ export class ResumeSchema extends PothosSchema {
updateResumeStatus: t.prismaField({ updateResumeStatus: t.prismaField({
type: this.resume(), type: this.resume(),
description: 'Update the status of a resume.',
args: { args: {
resumeId: t.arg({ resumeId: t.arg({
type: 'String', type: 'String',

View File

@@ -20,6 +20,7 @@ export class ScheduleSchema extends PothosSchema {
@PothosRef() @PothosRef()
schedule() { schedule() {
return this.builder.prismaObject('Schedule', { return this.builder.prismaObject('Schedule', {
description: 'A schedule in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
serviceId: t.exposeID('serviceId'), serviceId: t.exposeID('serviceId'),
@@ -35,6 +36,7 @@ export class ScheduleSchema extends PothosSchema {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
schedule: t.prismaField({ schedule: t.prismaField({
type: this.schedule(), type: this.schedule(),
description: 'Retrieve a single schedule by its unique identifier.',
args: this.builder.generator.findUniqueArgs('Schedule'), args: this.builder.generator.findUniqueArgs('Schedule'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.schedule.findUnique({ return await this.prisma.schedule.findUnique({
@@ -47,6 +49,8 @@ export class ScheduleSchema extends PothosSchema {
schedules: t.prismaField({ schedules: t.prismaField({
type: [this.schedule()], type: [this.schedule()],
args: this.builder.generator.findManyArgs('Schedule'), args: this.builder.generator.findManyArgs('Schedule'),
description:
'Retrieve a list of schedules with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.schedule.findMany({ return await this.prisma.schedule.findMany({
...query, ...query,

View File

@@ -20,6 +20,7 @@ export class ServiceSchema extends PothosSchema {
@PothosRef() @PothosRef()
service() { service() {
return this.builder.prismaObject('Service', { return this.builder.prismaObject('Service', {
description: 'A service offered by a center.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
name: t.exposeString('name'), name: t.exposeString('name'),
@@ -54,6 +55,8 @@ export class ServiceSchema extends PothosSchema {
init() { init() {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
services: t.prismaField({ services: t.prismaField({
description:
'Retrieve a list of services with optional filtering, ordering, and pagination.',
type: [this.service()], type: [this.service()],
args: this.builder.generator.findManyArgs('Service'), args: this.builder.generator.findManyArgs('Service'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
@@ -67,6 +70,7 @@ export class ServiceSchema extends PothosSchema {
}, },
}), }),
service: t.prismaField({ service: t.prismaField({
description: 'Retrieve a single service by its unique identifier.',
type: this.service(), type: this.service(),
args: { args: {
input: t.arg({ input: t.arg({
@@ -86,6 +90,7 @@ export class ServiceSchema extends PothosSchema {
// Mutation section // Mutation section
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
createService: t.prismaField({ createService: t.prismaField({
description: 'Create a new service.',
type: this.service(), type: this.service(),
args: { args: {
input: t.arg({ input: t.arg({
@@ -100,6 +105,7 @@ export class ServiceSchema extends PothosSchema {
}, },
}), }),
updateService: t.prismaField({ updateService: t.prismaField({
description: 'Update an existing service.',
type: this.service(), type: this.service(),
args: { args: {
input: t.arg({ input: t.arg({
@@ -120,6 +126,7 @@ export class ServiceSchema extends PothosSchema {
}, },
}), }),
deleteService: t.prismaField({ deleteService: t.prismaField({
description: 'Delete an existing service.',
type: this.service(), type: this.service(),
args: { args: {
where: t.arg({ where: t.arg({

View File

@@ -20,6 +20,7 @@ export class ServiceAndCategorySchema extends PothosSchema {
@PothosRef() @PothosRef()
serviceAndCategory() { serviceAndCategory() {
return this.builder.prismaObject('ServiceAndCategory', { return this.builder.prismaObject('ServiceAndCategory', {
description: 'A service and category in the system.',
fields: (t) => ({ fields: (t) => ({
serviceId: t.exposeID('serviceId'), serviceId: t.exposeID('serviceId'),
service: t.relation('service'), service: t.relation('service'),
@@ -35,6 +36,8 @@ export class ServiceAndCategorySchema extends PothosSchema {
serviceAndCategories: t.prismaField({ serviceAndCategories: t.prismaField({
type: [this.serviceAndCategory()], type: [this.serviceAndCategory()],
args: this.builder.generator.findManyArgs('ServiceAndCategory'), args: this.builder.generator.findManyArgs('ServiceAndCategory'),
description:
'Retrieve a list of service and categories with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.serviceAndCategory.findMany({ return await this.prisma.serviceAndCategory.findMany({
...query, ...query,

View File

@@ -20,6 +20,7 @@ export class ServiceFeedbackSchema extends PothosSchema {
@PothosRef() @PothosRef()
serviceFeedback() { serviceFeedback() {
return this.builder.prismaObject('ServiceFeedback', { return this.builder.prismaObject('ServiceFeedback', {
description: 'A feedback for a service.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
userId: t.exposeID('userId'), userId: t.exposeID('userId'),
@@ -40,6 +41,8 @@ export class ServiceFeedbackSchema extends PothosSchema {
serviceFeedbacks: t.prismaField({ serviceFeedbacks: t.prismaField({
type: [this.serviceFeedback()], type: [this.serviceFeedback()],
args: this.builder.generator.findManyArgs('ServiceFeedback'), args: this.builder.generator.findManyArgs('ServiceFeedback'),
description:
'Retrieve a list of service feedbacks with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.serviceFeedback.findMany({ return await this.prisma.serviceFeedback.findMany({
...query, ...query,

View File

@@ -20,6 +20,7 @@ export class ServiceMeetingRoomSchema extends PothosSchema {
@PothosRef() @PothosRef()
serviceMeetingRoom() { serviceMeetingRoom() {
return this.builder.prismaObject('ServiceMeetingRoom', { return this.builder.prismaObject('ServiceMeetingRoom', {
description: 'A service meeting room in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
chattingRoomId: t.exposeString('chattingRoomId'), chattingRoomId: t.exposeString('chattingRoomId'),
@@ -34,6 +35,8 @@ export class ServiceMeetingRoomSchema extends PothosSchema {
serviceMeetingRoom: t.prismaField({ serviceMeetingRoom: t.prismaField({
type: this.serviceMeetingRoom(), type: this.serviceMeetingRoom(),
args: this.builder.generator.findUniqueArgs('ServiceMeetingRoom'), args: this.builder.generator.findUniqueArgs('ServiceMeetingRoom'),
description:
'Retrieve a single service meeting room by its unique identifier.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.serviceMeetingRoom.findUnique({ return await this.prisma.serviceMeetingRoom.findUnique({
...query, ...query,
@@ -44,6 +47,8 @@ export class ServiceMeetingRoomSchema extends PothosSchema {
serviceMeetingRooms: t.prismaField({ serviceMeetingRooms: t.prismaField({
type: [this.serviceMeetingRoom()], type: [this.serviceMeetingRoom()],
args: this.builder.generator.findManyArgs('ServiceMeetingRoom'), args: this.builder.generator.findManyArgs('ServiceMeetingRoom'),
description:
'Retrieve a list of service meeting rooms with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.serviceMeetingRoom.findMany({ return await this.prisma.serviceMeetingRoom.findMany({
...query, ...query,

View File

@@ -22,6 +22,7 @@ export class UploadedFileSchema extends PothosSchema {
@PothosRef() @PothosRef()
uploadedFile() { uploadedFile() {
return this.builder.prismaObject('UploadedFile', { return this.builder.prismaObject('UploadedFile', {
description: 'A file uploaded by a user.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
userId: t.exposeID('userId'), userId: t.exposeID('userId'),
@@ -42,6 +43,8 @@ export class UploadedFileSchema extends PothosSchema {
init(): void { init(): void {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
uploadedFile: t.prismaField({ uploadedFile: t.prismaField({
description:
'Retrieve a single uploaded file by its unique identifier.',
type: this.uploadedFile(), type: this.uploadedFile(),
args: this.builder.generator.findUniqueArgs('UploadedFile'), args: this.builder.generator.findUniqueArgs('UploadedFile'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -64,6 +67,8 @@ export class UploadedFileSchema extends PothosSchema {
}, },
}), }),
uploadedFiles: t.prismaField({ uploadedFiles: t.prismaField({
description:
'Retrieve a list of uploaded files with optional filtering, ordering, and pagination.',
type: [this.uploadedFile()], type: [this.uploadedFile()],
args: this.builder.generator.findManyArgs('UploadedFile'), args: this.builder.generator.findManyArgs('UploadedFile'),
resolve: async (query, root, args) => { resolve: async (query, root, args) => {
@@ -90,6 +95,7 @@ export class UploadedFileSchema extends PothosSchema {
// Mutations section // Mutations section
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
singleUpload: t.prismaField({ singleUpload: t.prismaField({
description: 'Upload a single file for a user.',
type: this.uploadedFile(), type: this.uploadedFile(),
args: { args: {
userId: t.arg({ userId: t.arg({
@@ -140,6 +146,7 @@ export class UploadedFileSchema extends PothosSchema {
}), }),
multipleUpload: t.prismaField({ multipleUpload: t.prismaField({
description: 'Upload multiple files for a user.',
type: [this.uploadedFile()], type: [this.uploadedFile()],
args: { args: {
userId: t.arg({ userId: t.arg({
@@ -194,6 +201,7 @@ export class UploadedFileSchema extends PothosSchema {
}), }),
deleteUploadedFile: t.prismaField({ deleteUploadedFile: t.prismaField({
description: 'Delete a single uploaded file by its unique identifier.',
type: this.uploadedFile(), type: this.uploadedFile(),
args: { args: {
id: t.arg({ id: t.arg({
@@ -221,6 +229,8 @@ export class UploadedFileSchema extends PothosSchema {
}), }),
deleteUploadedFiles: t.prismaField({ deleteUploadedFiles: t.prismaField({
description:
'Delete multiple uploaded files by their unique identifiers.',
type: [this.uploadedFile()], type: [this.uploadedFile()],
args: { args: {
ids: t.arg({ ids: t.arg({

View File

@@ -21,6 +21,7 @@ export class UserSchema extends PothosSchema {
@PothosRef() @PothosRef()
user() { user() {
return this.builder.prismaObject('User', { return this.builder.prismaObject('User', {
description: 'A user in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
name: t.exposeString('name'), name: t.exposeString('name'),
@@ -40,6 +41,8 @@ export class UserSchema extends PothosSchema {
init(): void { init(): void {
this.builder.queryFields((t) => ({ this.builder.queryFields((t) => ({
users: t.prismaField({ users: t.prismaField({
description:
'Retrieve a list of users with optional filtering, ordering, and pagination.',
type: [this.user()], type: [this.user()],
args: this.builder.generator.findManyArgs('User'), args: this.builder.generator.findManyArgs('User'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
@@ -54,6 +57,7 @@ export class UserSchema extends PothosSchema {
}), }),
user: t.prismaField({ user: t.prismaField({
description: 'Retrieve a single user by their unique identifier.',
type: this.user(), type: this.user(),
args: this.builder.generator.findUniqueArgs('User'), args: this.builder.generator.findUniqueArgs('User'),
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
@@ -64,6 +68,7 @@ export class UserSchema extends PothosSchema {
}, },
}), }),
userBySession: t.prismaField({ userBySession: t.prismaField({
description: 'Retrieve a single user by their session ID.',
type: this.user(), type: this.user(),
args: { args: {
sessionId: t.arg({ type: 'String', required: true }), sessionId: t.arg({ type: 'String', required: true }),
@@ -85,6 +90,7 @@ export class UserSchema extends PothosSchema {
// Mutation section // Mutation section
this.builder.mutationFields((t) => ({ this.builder.mutationFields((t) => ({
updateUser: t.prismaField({ updateUser: t.prismaField({
description: 'Update an existing user.',
type: this.user(), type: this.user(),
args: { args: {
input: t.arg({ input: t.arg({

View File

@@ -20,6 +20,7 @@ export class WorkshopSchema extends PothosSchema {
@PothosRef() @PothosRef()
workshop() { workshop() {
return this.builder.prismaObject('Workshop', { return this.builder.prismaObject('Workshop', {
description: 'A workshop in the system.',
fields: (t) => ({ fields: (t) => ({
id: t.exposeID('id'), id: t.exposeID('id'),
title: t.exposeString('title'), title: t.exposeString('title'),
@@ -54,6 +55,7 @@ export class WorkshopSchema extends PothosSchema {
workshop: t.prismaField({ workshop: t.prismaField({
type: this.workshop(), type: this.workshop(),
args: this.builder.generator.findUniqueArgs('Workshop'), args: this.builder.generator.findUniqueArgs('Workshop'),
description: 'Retrieve a single workshop by its unique identifier.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.workshop.findUnique({ return await this.prisma.workshop.findUnique({
...query, ...query,
@@ -65,6 +67,8 @@ export class WorkshopSchema extends PothosSchema {
workshops: t.prismaField({ workshops: t.prismaField({
type: [this.workshop()], type: [this.workshop()],
args: this.builder.generator.findManyArgs('Workshop'), args: this.builder.generator.findManyArgs('Workshop'),
description:
'Retrieve a list of workshops with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.workshop.findMany({ return await this.prisma.workshop.findMany({
...query, ...query,
@@ -87,6 +91,7 @@ export class WorkshopSchema extends PothosSchema {
required: true, required: true,
}), }),
}, },
description: 'Create a new workshop.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.workshop.create({ return await this.prisma.workshop.create({
...query, ...query,
@@ -107,6 +112,7 @@ export class WorkshopSchema extends PothosSchema {
required: true, required: true,
}), }),
}, },
description: 'Update an existing workshop.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.workshop.update({ return await this.prisma.workshop.update({
...query, ...query,

View File

@@ -19,6 +19,7 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
@PothosRef() @PothosRef()
workshopSubscription() { workshopSubscription() {
return this.builder.prismaObject('WorkshopSubscription', { return this.builder.prismaObject('WorkshopSubscription', {
description: 'A workshop subscription in the system.',
fields: (t) => ({ fields: (t) => ({
userId: t.exposeID('userId'), userId: t.exposeID('userId'),
workshopId: t.exposeID('workshopId'), workshopId: t.exposeID('workshopId'),
@@ -34,6 +35,8 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
workshopSubscription: t.prismaField({ workshopSubscription: t.prismaField({
type: this.workshopSubscription(), type: this.workshopSubscription(),
args: this.builder.generator.findUniqueArgs('WorkshopSubscription'), args: this.builder.generator.findUniqueArgs('WorkshopSubscription'),
description:
'Retrieve a single workshop subscription by its unique identifier.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.workshopSubscription.findUnique({ return await this.prisma.workshopSubscription.findUnique({
...query, ...query,
@@ -44,6 +47,8 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
workshopSubscriptions: t.prismaField({ workshopSubscriptions: t.prismaField({
type: [this.workshopSubscription()], type: [this.workshopSubscription()],
args: this.builder.generator.findManyArgs('WorkshopSubscription'), args: this.builder.generator.findManyArgs('WorkshopSubscription'),
description:
'Retrieve a list of workshop subscriptions with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => { resolve: async (query, root, args, ctx, info) => {
return await this.prisma.workshopSubscription.findMany({ return await this.prisma.workshopSubscription.findMany({
...query, ...query,