Update CenterMentorSchema to include 'active' field for mentor status and adjust role assignment to use Role enum. Enhance payment cancellation logic in CronService to update associated order status to 'FAILED'. Bump epess-database subproject commit reference to reflect recent changes.
This commit is contained in:
@@ -6,6 +6,7 @@ import { MailService } from '../Mail/mail.service'
|
||||
import { JwtUtils } from '../common/utils/jwt.utils'
|
||||
import { clerkClient } from '@clerk/express'
|
||||
import { RedisService } from 'src/Redis/redis.service'
|
||||
import { Role } from '@prisma/client'
|
||||
@Injectable()
|
||||
export class CenterMentorSchema extends PothosSchema {
|
||||
constructor(
|
||||
@@ -38,6 +39,9 @@ export class CenterMentorSchema extends PothosSchema {
|
||||
center: t.relation('center', {
|
||||
description: 'The center.',
|
||||
}),
|
||||
active: t.exposeBoolean('active', {
|
||||
description: 'Whether the mentor is active.',
|
||||
}),
|
||||
createdWorkshop: t.relation('createdWorkshop', {
|
||||
description: 'The workshops created by the center mentor.',
|
||||
}),
|
||||
@@ -84,7 +88,7 @@ export class CenterMentorSchema extends PothosSchema {
|
||||
resolve: async (query, _root, args) => {
|
||||
return await this.prisma.centerMentor.create({
|
||||
...query,
|
||||
data: args.data,
|
||||
data: { ...args.data, active: false },
|
||||
})
|
||||
},
|
||||
}),
|
||||
@@ -259,7 +263,7 @@ export class CenterMentorSchema extends PothosSchema {
|
||||
await prisma.user.update({
|
||||
where: args.where,
|
||||
data: {
|
||||
role: 'CENTER_MENTOR',
|
||||
role: Role.CENTER_MENTOR,
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
})
|
||||
@@ -281,6 +285,7 @@ export class CenterMentorSchema extends PothosSchema {
|
||||
},
|
||||
data: {
|
||||
adminNote: { connect: { id: adminNote.id } },
|
||||
active: true,
|
||||
},
|
||||
})
|
||||
return updatedCenterMentor
|
||||
|
||||
Reference in New Issue
Block a user