60 lines
3.4 KiB
Go
60 lines
3.4 KiB
Go
package ports
|
|
|
|
import (
|
|
"context"
|
|
|
|
"Yimaru-Backend/internal/domain"
|
|
)
|
|
|
|
type CourseStore interface{
|
|
CreateCourseCategory(ctx context.Context, name string) (domain.CourseCategory, error)
|
|
GetCourseCategoryByID(ctx context.Context, Id int64) (domain.CourseCategory, error)
|
|
ListActiveCourseCategories(ctx context.Context) ([]domain.CourseCategory, error)
|
|
UpdateCourseCategory(ctx context.Context, id int64, name string, isActive bool) (domain.CourseCategory, error)
|
|
DeactivateCourseCategory(ctx context.Context, id int64) error
|
|
|
|
CreateCourse(ctx context.Context, c domain.Course) (domain.Course, error)
|
|
GetCourseByID(ctx context.Context, id int64) (domain.Course, error)
|
|
ListCoursesByCategory(ctx context.Context, categoryID int64) ([]domain.Course, error)
|
|
ListActiveCourses(ctx context.Context) ([]domain.Course, error)
|
|
UpdateCourse(ctx context.Context, c domain.Course) (domain.Course, error)
|
|
DeactivateCourse(ctx context.Context, id int64) error
|
|
|
|
CreateProgram(ctx context.Context, p domain.Program) (domain.Program, error)
|
|
GetProgramByID(ctx context.Context, id int64) (domain.Program, error)
|
|
ListProgramsByCourse(ctx context.Context, courseID int64) ([]domain.Program, error)
|
|
ListActivePrograms(ctx context.Context) ([]domain.Program, error)
|
|
UpdateProgram(ctx context.Context, p domain.Program) (domain.Program, error)
|
|
DeactivateProgram(ctx context.Context, id int64) error
|
|
|
|
CreateModule(ctx context.Context, m domain.Module) (domain.Module, error)
|
|
GetModuleByID(ctx context.Context, id int64) (domain.Module, error)
|
|
ListModulesByLevel(ctx context.Context, levelID int64) ([]domain.Module, error)
|
|
UpdateModule(ctx context.Context, m domain.Module) (domain.Module, error)
|
|
DeactivateModule(ctx context.Context, id int64) error
|
|
|
|
CreateModuleVideo(ctx context.Context, v domain.ModuleVideo) (domain.ModuleVideo, error)
|
|
GetModuleVideoByID(ctx context.Context, id int64) (domain.ModuleVideo, error)
|
|
ListAllVideosByModule(ctx context.Context, moduleID int64) ([]domain.ModuleVideo, error)
|
|
ListPublishedVideosByModule(ctx context.Context, moduleID int64) ([]domain.ModuleVideo, error)
|
|
UpdateModuleVideo(ctx context.Context, v domain.ModuleVideo) (domain.ModuleVideo, error)
|
|
DeactivateModuleVideo(ctx context.Context, id int64) error
|
|
|
|
CreatePractice(ctx context.Context, p domain.Practice) (domain.Practice, error)
|
|
GetPracticeByID(ctx context.Context, id int64) (domain.Practice, error)
|
|
ListPracticesByOwner(ctx context.Context, ownerType string, ownerID int64) ([]domain.Practice, error)
|
|
UpdatePractice(ctx context.Context, p domain.Practice) (domain.Practice, error)
|
|
DeactivatePractice(ctx context.Context, id int64) error
|
|
|
|
CreatePracticeQuestion(ctx context.Context, qn domain.PracticeQuestion) (domain.PracticeQuestion, error)
|
|
GetPracticeQuestionByID(ctx context.Context, id int64) (domain.PracticeQuestion, error)
|
|
ListPracticeQuestions(ctx context.Context, practiceID int64) ([]domain.PracticeQuestion, error)
|
|
UpdatePracticeQuestion(ctx context.Context, qn domain.PracticeQuestion) (domain.PracticeQuestion, error)
|
|
DeletePracticeQuestion(ctx context.Context, id int64) error
|
|
|
|
CreateLevel(ctx context.Context, l domain.Level) (domain.Level, error)
|
|
GetLevelByID(ctx context.Context, id int64) (domain.Level, error)
|
|
ListLevelsByProgram(ctx context.Context, programID int64) ([]domain.Level, error)
|
|
UpdateLevel(ctx context.Context, l domain.Level) (domain.Level, error)
|
|
DeactivateLevel(ctx context.Context, id int64) error
|
|
} |