package models import "time" type UserRole string const ( RoleViewer UserRole = "viewer" RoleEditor UserRole = "editor" RolePricingAdmin UserRole = "pricing_admin" RoleAdmin UserRole = "admin" ) type User struct { ID uint `gorm:"primaryKey;autoIncrement" json:"id"` Username string `gorm:"size:100;uniqueIndex;not null" json:"username"` Email string `gorm:"size:255;uniqueIndex;not null" json:"email"` PasswordHash string `gorm:"size:255;not null" json:"-"` // Kept for backward-compatible schema; local mode does not enforce role-based app auth. Role UserRole `gorm:"type:enum('viewer','editor','pricing_admin','admin');default:'viewer'" json:"role"` IsActive bool `gorm:"default:true" json:"is_active"` CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"` UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"` } func (User) TableName() string { return "qt_users" }