Introduce lms_personas table, repoint practice persona_id FKs off users, validate persona refs on LMS and exam-prep practice flows, personas.* RBAC permissions, and OpenAPI docs. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package domain
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
// ErrPersonaNotFound is returned when an lms_personas row does not exist.
|
|
var ErrPersonaNotFound = errors.New("persona not found")
|
|
|
|
// LmsPersona is a coach / character profile stored in lms_personas and referenced by practice shells.
|
|
type LmsPersona struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description,omitempty"`
|
|
AvatarURL *string `json:"avatar_url,omitempty"`
|
|
IsActive bool `json:"is_active"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
|
}
|
|
|
|
type CreateLmsPersonaInput struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Description *string `json:"description,omitempty"`
|
|
AvatarURL *string `json:"avatar_url,omitempty"`
|
|
IsActive *bool `json:"is_active,omitempty"`
|
|
}
|
|
|
|
type UpdateLmsPersonaInput struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
AvatarURL *string `json:"avatar_url,omitempty"`
|
|
IsActive *bool `json:"is_active,omitempty"`
|
|
}
|