63ede5c237
- refactor: move HTTP status and DTO concerns out of model and service layers into API and handler code. - feat: add admin service boundary and route auth through services instead of direct repository access. - test: add architecture and error tests covering package boundaries, redaction, and service behavior. - docs: record the protocol-neutral boundary decision and update architecture and roadmap notes.
24 lines
633 B
Go
24 lines
633 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// User represents a registered account.
|
|
type User struct {
|
|
ID string `gorm:"primaryKey;type:varchar(36)"`
|
|
Username string `gorm:"uniqueIndex;type:varchar(64);not null"`
|
|
Email string `gorm:"uniqueIndex;type:varchar(255);not null"`
|
|
PasswordHash string `gorm:"type:varchar(255);not null" json:"-"`
|
|
IsAdmin bool `gorm:"default:false"`
|
|
Status string `gorm:"type:varchar(32);not null;default:active;index"`
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
// User status constants.
|
|
const (
|
|
StatusActive = "active"
|
|
StatusAdminDeleted = "admin_deleted"
|
|
)
|