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

@@ -22,9 +22,15 @@ export class CategorySchema extends PothosSchema {
return this.builder.prismaObject('Category', {
description: 'A category of services.',
fields: (t) => ({
id: t.exposeID('id'),
name: t.exposeString('name'),
subCategory: t.relation('SubCategory'),
id: t.exposeID('id', {
description: 'The unique identifier of the category.',
}),
name: t.exposeString('name', {
description: 'The name of the category.',
}),
subCategory: t.relation('SubCategory', {
description: 'The subcategory of the category.',
}),
}),
});
}
@@ -35,10 +41,20 @@ export class CategorySchema extends PothosSchema {
description: 'A subcategory of services.',
fields: (t) => ({
id: t.exposeID('id'),
name: t.exposeString('name'),
categoryId: t.exposeID('categoryId'),
category: t.relation('category'),
serviceAndCategory: t.relation('serviceAndCategory'),
name: t.exposeString('name', {
description: 'The name of the subcategory.',
}),
categoryId: t.exposeID('categoryId', {
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.',
}),
}),
});
}