This commit is contained in:
CFOU
2026-09-14 20:50:19 +02:00
commit 3091fb4020
135 changed files with 10262 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
// Package users owns the user account entity and its CRUD operations.
// The auth module depends on this package to look up credentials, but
// never owns or duplicates the User model itself.
package users
import (
"time"
"github.com/google/uuid"
)
const (
RoleAdmin = "admin"
RoleCustomer = "customer"
)
type User struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
Email string `gorm:"uniqueIndex;not null"`
PasswordHash string `gorm:"not null"`
Role string `gorm:"not null;default:admin"`
IsActive bool `gorm:"not null;default:true"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (User) TableName() string { return "users" }