This commit is contained in:
2025-11-03 12:24:01 +02:00
commit 0806865287
177 changed files with 18453 additions and 0 deletions

25
server/internal/models/user.go Executable file
View File

@@ -0,0 +1,25 @@
package models
import "time"
type PlatformRole string
const (
PlatformRoleUser PlatformRole = "USER"
PlatformRoleAdmin PlatformRole = "ADMIN"
)
func (User) TableName() string {
return "users"
}
type User struct {
ID []byte `gorm:"primaryKey;type:bytea" json:"id" db:"id"`
CreatedAt time.Time `json:"createdAt" db:"created_at"`
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
FirstName string `json:"firstName" db:"first_name"`
LastName string `json:"lastName" db:"last_name"`
Email string `gorm:"uniqueIndex;not null" json:"email" db:"email"`
Password string `gorm:"not null" json:"password" db:"password"`
PlatformRole PlatformRole `gorm:"not null" json:"platformRole" db:"platform_role"`
}