chore: update subproject commit and enhance ServiceFeedback schema

- Updated the subproject commit reference in epess-database to the latest version.
- Added Logger to the ServiceFeedback schema for improved logging of arguments during feedback submission.
- Modified the Prisma types to include new Quiz and Question entities, enhancing the schema's capabilities and data structure.
This commit is contained in:
2024-12-06 21:25:25 +07:00
parent 59b221a6ee
commit 6cbaf44c7f
5 changed files with 59 additions and 31 deletions

8
src/Quiz/quiz.module.ts Normal file
View File

@@ -0,0 +1,8 @@
import { Module } from '@nestjs/common'
import { QuizSchema } from './quiz.schema'
@Module({
providers: [QuizSchema],
exports: [QuizSchema],
})
export class QuizModule {}

4
src/Quiz/quiz.schema.ts Normal file
View File

@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common'
@Injectable()
export class QuizSchema {}

View File

@@ -1,4 +1,4 @@
import { Inject, Injectable } from '@nestjs/common'
import { Inject, Injectable, Logger } from '@nestjs/common'
import { Pothos, PothosRef, PothosSchema, SchemaBuilderToken } from '@smatch-corp/nestjs-pothos'
import { Builder } from '../Graphql/graphql.builder'
import { PrismaService } from '../Prisma/prisma.service'
@@ -94,6 +94,7 @@ export class ServiceFeedbackSchema extends PothosSchema {
if (!ctx.http?.me) throw new Error('Unauthorized')
// allow only when user is CUSTOMER and order is completed
if (ctx.http?.me?.role !== Role.CUSTOMER) throw new Error('Unauthorized')
Logger.log(`args: ${JSON.stringify(args)}`)
const order = await this.prisma.order.findFirst({
where: {
id: args.orderId,

File diff suppressed because one or more lines are too long