feat: Implement instructor-specific course management with dedicated controller, service, types, and validation.
This commit is contained in:
parent
bca2cc944e
commit
8a2ca592bc
6 changed files with 229 additions and 12 deletions
|
|
@ -1,7 +1,25 @@
|
|||
import { Course, Prisma, User } from '@prisma/client';
|
||||
|
||||
export interface createCourses{
|
||||
data: Prisma.CourseCreateInput;
|
||||
// Custom type for TSOA - avoiding complex Prisma types
|
||||
export interface CreateCourseInput {
|
||||
category_id?: number;
|
||||
title: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
slug: string;
|
||||
description: {
|
||||
th: string;
|
||||
en: string;
|
||||
};
|
||||
thumbnail_url?: string;
|
||||
price?: number;
|
||||
is_free?: boolean;
|
||||
have_certificate?: boolean;
|
||||
}
|
||||
|
||||
export interface createCourses {
|
||||
data: CreateCourseInput;
|
||||
}
|
||||
|
||||
export interface createCourseResponse {
|
||||
|
|
@ -23,7 +41,7 @@ export interface GetMyCourseResponse {
|
|||
data: Course;
|
||||
}
|
||||
|
||||
export interface UpdateMyCourse{
|
||||
export interface UpdateMyCourse {
|
||||
data: Prisma.CourseUpdateInput;
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +61,7 @@ export interface submitCourseResponse {
|
|||
message: string;
|
||||
}
|
||||
|
||||
export interface submitCourse{
|
||||
export interface submitCourse {
|
||||
courseId: number;
|
||||
submitted_by: number;
|
||||
}
|
||||
|
|
@ -56,11 +74,10 @@ export interface submitCourseResponse {
|
|||
export interface listCourseinstructorResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: User[];
|
||||
total: number;
|
||||
data: Course[];
|
||||
}
|
||||
|
||||
export interface addinstructorCourse{
|
||||
export interface addinstructorCourse {
|
||||
user_id: number;
|
||||
course_id: number;
|
||||
}
|
||||
|
|
@ -70,7 +87,7 @@ export interface addinstructorCourseResponse {
|
|||
message: string;
|
||||
}
|
||||
|
||||
export interface removeinstructorCourse{
|
||||
export interface removeinstructorCourse {
|
||||
user_id: number;
|
||||
course_id: number;
|
||||
}
|
||||
|
|
@ -80,7 +97,7 @@ export interface removeinstructorCourseResponse {
|
|||
message: string;
|
||||
}
|
||||
|
||||
export interface setprimaryCourseInstructor{
|
||||
export interface setprimaryCourseInstructor {
|
||||
user_id: number;
|
||||
course_id: number;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue