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

@@ -23,15 +23,38 @@ export class UserSchema extends PothosSchema {
return this.builder.prismaObject('User', {
description: 'A user in the system.',
fields: (t) => ({
id: t.exposeID('id'),
name: t.exposeString('name'),
email: t.exposeString('email'),
phoneNumber: t.exposeString('phoneNumber'),
oauthToken: t.exposeString('oauthToken', { nullable: true }),
role: t.exposeString('role'),
createdAt: t.expose('createdAt', { type: 'DateTime' }),
updatedAt: t.expose('updatedAt', { type: 'DateTime' }),
center: t.relation('center'),
id: t.exposeID('id', {
description: 'The ID of the user.',
}),
name: t.exposeString('name', {
description: 'The name of the user.',
}),
email: t.exposeString('email', {
description: 'The email of the user.',
}),
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.',
}),
}),
});
}