Refactor Category and Center schemas to improve field descriptions and code clarity; update email templates for consistency in messaging. Add Redis service to CenterSchema for session management. Bump epess-database subproject commit reference to indicate changes. Clean up logging in ClerkService and ServiceSchema.

This commit is contained in:
2024-11-27 01:09:13 +07:00
parent c9435a6e04
commit 2581ca396f
11 changed files with 56 additions and 59 deletions

View File

@@ -1,10 +1,5 @@
import { Inject, Injectable } from '@nestjs/common'
import {
Pothos,
PothosRef,
PothosSchema,
SchemaBuilderToken,
} from '@smatch-corp/nestjs-pothos'
import { Pothos, PothosRef, PothosSchema, SchemaBuilderToken } from '@smatch-corp/nestjs-pothos'
import { Builder } from '../Graphql/graphql.builder'
import { PrismaService } from '../Prisma/prisma.service'
@@ -28,6 +23,9 @@ export class CategorySchema extends PothosSchema {
name: t.exposeString('name', {
description: 'The name of the category.',
}),
description: t.exposeString('description', {
description: 'The description of the category.',
}),
subCategory: t.relation('subCategory', {
description: 'The subcategory of the category.',
}),
@@ -46,16 +44,17 @@ export class CategorySchema extends PothosSchema {
name: t.exposeString('name', {
description: 'The name of the subcategory.',
}),
description: t.exposeString('description', {
description: 'The description of the subcategory.',
}),
categoryId: t.exposeID('categoryId', {
description:
'The ID of the category that the subcategory belongs to.',
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.',
description: 'The service and category that the subcategory belongs to.',
}),
}),
})
@@ -65,8 +64,7 @@ export class CategorySchema extends PothosSchema {
init(): void {
this.builder.queryFields((t) => ({
categories: t.prismaField({
description:
'Retrieve a list of categories with optional filtering, ordering, and pagination.',
description: 'Retrieve a list of categories with optional filtering, ordering, and pagination.',
type: [this.category()],
args: this.builder.generator.findManyArgs('Category'),
resolve: async (query, _root, args) => {
@@ -91,8 +89,7 @@ export class CategorySchema extends PothosSchema {
},
}),
subCategories: t.prismaField({
description:
'Retrieve a list of subcategories with optional filtering, ordering, and pagination.',
description: 'Retrieve a list of subcategories with optional filtering, ordering, and pagination.',
type: [this.subCategory()],
args: this.builder.generator.findManyArgs('SubCategory'),
resolve: async (query, _root, args) => {