Yimaru-BackEnd/internal/domain/lms_persona.go
Yared Yemane 9ff418247f Always include profile_picture in persona JSON responses.
Remove omitempty on LmsPersona.profile_picture so list/get return null when unset. Add LMS-Personas Postman collection matching current API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-20 06:25:55 -07:00

36 lines
1.3 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
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"`
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"`
IsActive *bool `json:"is_active,omitempty"`
}