avance creando entidades

This commit is contained in:
fede committed 2026-05-14 17:21:28 -03:00
1 parent 1d755376f6
commit 7cadb9c84b
25 files changed
+200 -47

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package models_seguridad
import (
"time"
"gorm.io/gorm"
)
type Usuario struct {
ID uint `gorm:"primaryKey" json:"id"`
Email string `gorm:"uniqueIndex;not null;type:varchar(100)" json:"email"`
Password string `gorm:"not null" json:"-"`
Name string `gorm:"not null" json:"name"`
Grupos []Grupo `gorm:"many2many:user_groups;" json:"grupos,omitempty"`
Empresas []Empresa `gorm:"many2many:user_empresa;" json:"empresas,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (Usuario) TableName() string {
return "users"
}