@defikitdotnet/education-module-ai
Version:
AI Education Module using Agent Framework
55 lines (54 loc) • 1.43 kB
TypeScript
import { Category } from "../models/Category";
import { CategoryRepository } from "../repositories/CategoryRepository";
/**
* DTO for category creation
*/
export interface CreateCategoryDTO {
teacherId: string;
name: string;
description?: string;
displayOrder?: number;
}
/**
* DTO for category update
*/
export interface UpdateCategoryDTO {
name?: string;
description?: string;
displayOrder?: number;
}
/**
* Service class for handling category-related business logic
*/
export declare class CategoryService {
private categoryRepository;
constructor(categoryRepository: CategoryRepository);
/**
* Create a new category
*/
createCategory(categoryData: CreateCategoryDTO): Promise<Category>;
/**
* Get all categories for a teacher
*/
getCategoriesByTeacherId(teacherId: string): Promise<Category[]>;
/**
* Get all categories with pagination
*/
getAllCategories(page?: number, limit?: number): Promise<Category[]>;
/**
* Get a category by ID
*/
getCategoryById(id: string): Promise<Category | null>;
/**
* Update a category
*/
updateCategory(id: string, data: UpdateCategoryDTO): Promise<Category | null>;
/**
* Delete a category
*/
deleteCategory(id: string): Promise<boolean>;
/**
* Get total count of categories
*/
getTotalCategoryCount(): Promise<number>;
}