initial rebuild

This commit is contained in:
allanice001
2025-09-01 13:34:13 +01:00
commit 95bd9615d1
100 changed files with 12440 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package models
import (
"time"
"github.com/google/uuid"
)
type Role string
const (
RoleAdmin Role = "admin"
RoleUser Role = "user"
)
type User struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
Name string `gorm:"type:varchar(255);not null" json:"name"`
Email string `gorm:"uniqueIndex" json:"email"`
EmailVerified bool `gorm:"default:false" json:"email_verified"`
EmailVerifiedAt time.Time `gorm:"default:null" json:"email_verified_at"`
Password string
Role Role
Timestamped
}
func (r Role) IsValid() bool {
switch r {
case RoleAdmin, RoleUser:
return true
}
return false
}