Introduce plan and content categories across programs and exam-prep catalog roots, wire category-aware checkout and access checks, and keep learner gating temporarily bypassed until data migration is ready. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.4 KiB
Go
34 lines
1.4 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
// Program is the top-level container in the LMS hierarchy (e.g. tracks like Beginner / Intermediate / Advanced).
|
|
type Program struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description,omitempty"`
|
|
Category string `json:"category"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
SortOrder int `json:"sort_order"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
|
Access *LMSEntityAccess `json:"access,omitempty"`
|
|
}
|
|
|
|
type CreateProgramInput struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Description *string `json:"description,omitempty"`
|
|
Category string `json:"category" validate:"required,oneof=LEARN_ENGLISH IELTS DUOLINGO"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
// SortOrder inserts at this global program order when set; omit to append after current max (sort_order uniqueness is enforced).
|
|
SortOrder *int `json:"sort_order,omitempty" validate:"omitempty,min=0"`
|
|
}
|
|
|
|
type UpdateProgramInput struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
Category *string `json:"category,omitempty" validate:"omitempty,oneof=LEARN_ENGLISH IELTS DUOLINGO"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
SortOrder *int `json:"sort_order,omitempty"`
|
|
}
|