34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
// DefaultCEFRCourseNames are the standard course names seeded for each program (migration 000048).
|
|
// Creating a course via the API may use any of these or a custom name.
|
|
var DefaultCEFRCourseNames = []string{"A1", "A2", "B1", "B2", "C1", "C2"}
|
|
|
|
// Course belongs to a Program.
|
|
type Course struct {
|
|
ID int64 `json:"id"`
|
|
ProgramID int64 `json:"program_id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description,omitempty"`
|
|
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 CreateCourseInput struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Description *string `json:"description,omitempty"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
}
|
|
|
|
type UpdateCourseInput struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
SortOrder *int `json:"sort_order,omitempty"`
|
|
}
|