Return per-module lesson and practice aggregates under unit modules listing so clients can render module depth without additional queries. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
// ExamPrepModule is a module under an exam-prep unit (stored in exam_prep.unit_modules).
|
|
type ExamPrepModule struct {
|
|
ID int64 `json:"id"`
|
|
UnitID int64 `json:"unit_id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description,omitempty"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
Icon *string `json:"icon,omitempty"`
|
|
SortOrder int `json:"sort_order"`
|
|
LessonsCount *int64 `json:"lessons_count,omitempty"`
|
|
PracticesCount *int64 `json:"practices_count,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
|
}
|
|
|
|
type CreateExamPrepModuleInput struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Description *string `json:"description,omitempty"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
Icon *string `json:"icon,omitempty"`
|
|
}
|
|
|
|
type UpdateExamPrepModuleInput struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
Icon *string `json:"icon,omitempty"`
|
|
SortOrder *int `json:"sort_order,omitempty"`
|
|
}
|