32 lines
1.2 KiB
Go
32 lines
1.2 KiB
Go
package ports
|
|
|
|
import (
|
|
"Yimaru-Backend/internal/domain"
|
|
"context"
|
|
)
|
|
|
|
// QuestionSetByID is implemented by the questions store.
|
|
type QuestionSetByID interface {
|
|
GetQuestionSetByID(ctx context.Context, id int64) (domain.QuestionSet, error)
|
|
}
|
|
|
|
// UserByID is implemented by the user store.
|
|
type UserByID interface {
|
|
GetUserByID(ctx context.Context, id int64) (domain.User, error)
|
|
}
|
|
|
|
type LmsPracticeStore interface {
|
|
// courseID, moduleID, lessonID: exactly one non-nil, matching in.ParentKind / in.ParentID.
|
|
CreateLmsPractice(
|
|
ctx context.Context,
|
|
in domain.CreatePracticeInput,
|
|
courseID, moduleID, lessonID *int64,
|
|
) (domain.Practice, error)
|
|
GetLmsPracticeByID(ctx context.Context, id int64) (domain.Practice, error)
|
|
ListLmsPracticesByCourseID(ctx context.Context, courseID int64, limit, offset int32) ([]domain.Practice, int64, error)
|
|
ListLmsPracticesByModuleID(ctx context.Context, moduleID int64, limit, offset int32) ([]domain.Practice, int64, error)
|
|
ListLmsPracticesByLessonID(ctx context.Context, lessonID int64, limit, offset int32) ([]domain.Practice, int64, error)
|
|
UpdateLmsPractice(ctx context.Context, id int64, input domain.UpdatePracticeInput) (domain.Practice, error)
|
|
DeleteLmsPractice(ctx context.Context, id int64) error
|
|
}
|