Introduce exam_prep.practice_parents, migrate lesson links, and add create/list APIs with progress rollups, sequential gating, and RBAC permissions. Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
1.2 KiB
Go
19 lines
1.2 KiB
Go
package ports
|
|
|
|
import (
|
|
"Yimaru-Backend/internal/domain"
|
|
"context"
|
|
)
|
|
|
|
// ExamPrepPracticeStore persists exam_prep.lesson_practices and exam_prep.practice_parents.
|
|
type ExamPrepPracticeStore interface {
|
|
CreateExamPrepPractice(ctx context.Context, parent domain.ExamPrepPracticeParent, in domain.CreateExamPrepPracticeInput) (domain.ExamPrepPractice, error)
|
|
GetExamPrepLessonPracticeByID(ctx context.Context, id int64) (domain.ExamPrepPractice, error)
|
|
TryGetExamPrepLessonPracticeByQuestionSetID(ctx context.Context, questionSetID int64) (domain.ExamPrepPractice, bool, error)
|
|
ListExamPrepPracticesByParent(ctx context.Context, parent domain.ExamPrepPracticeParent, publishedOnly bool, limit, offset int32) ([]domain.ExamPrepPractice, int64, error)
|
|
CountExamPrepPracticesByParent(ctx context.Context, kind domain.ExamPrepParentKind, parentID int64) (int64, error)
|
|
CountExamPrepPracticesByParentExcludingPractice(ctx context.Context, kind domain.ExamPrepParentKind, parentID, excludePracticeID int64) (int64, error)
|
|
UpdateExamPrepLessonPractice(ctx context.Context, id int64, input domain.UpdateExamPrepPracticeInput) (domain.ExamPrepPractice, error)
|
|
DeleteExamPrepLessonPractice(ctx context.Context, id int64) error
|
|
}
|