Migration 000065 adds nullable gender text column; persona API and Postman expose it alongside profile_picture. Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.5 KiB
Go
40 lines
1.5 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"`
|
|
// ProfilePicture is always serialized (null when not set); clients rely on stable keys in list payloads.
|
|
ProfilePicture *string `json:"profile_picture"` // image URL (e.g. MinIO or HTTPS); JSON null when unset
|
|
// Gender matches learner-style free text (nullable); always present in JSON for stable list payloads.
|
|
Gender *string `json:"gender"`
|
|
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"`
|
|
ProfilePicture *string `json:"profile_picture,omitempty"`
|
|
Gender *string `json:"gender,omitempty"`
|
|
IsActive *bool `json:"is_active,omitempty"`
|
|
}
|
|
|
|
type UpdateLmsPersonaInput struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
ProfilePicture *string `json:"profile_picture,omitempty"`
|
|
Gender *string `json:"gender,omitempty"`
|
|
IsActive *bool `json:"is_active,omitempty"`
|
|
}
|