2025-08-19 21:29:37 +07:00

18 lines
585 B
Go

package entities
import (
"time"
"github.com/google/uuid"
)
type Module struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
Name string `gorm:"not null" json:"name"`
Code string `gorm:"uniqueIndex;not null" json:"code"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
Permissions []Permission `gorm:"foreignKey:ModuleID" json:"permissions,omitempty"`
}
func (Module) TableName() string { return "modules" }