apifiber/models/models.go

155 lines
4.8 KiB
Go

package models
// ====================================================================
// Adianti tables
type SystemGroup struct {
ID int `gorm:"primaryKey"`
Name string `gorm:"size:256"`
}
func (SystemGroup) TableName() string {
return "system_group"
}
type SystemProgram struct {
ID int `gorm:"primaryKey"`
Name string `gorm:"size:256"`
Controller string `gorm:"size:256"`
}
type SystemUnit struct {
ID int `gorm:"primaryKey"`
Name string `gorm:"size:256"`
ConnectionName string `gorm:"size:256"`
CustomCode string `gorm:"size:256"`
}
type SystemRole struct {
ID int `gorm:"primaryKey"`
Name string `gorm:"size:256"`
CustomCode string `gorm:"size:256"`
}
type SystemPreference struct {
ID string `gorm:"primaryKey;size:256"`
Value string `gorm:"type:citext"`
}
type SystemUser struct {
ID int `gorm:"primaryKey"`
Name string `gorm:"size:256"`
Login string `gorm:"size:256"`
Password string `gorm:"size:256"`
Email string `gorm:"size:256"`
AcceptedTermPolicy string `gorm:"size:1"`
Phone string `gorm:"size:256"`
Address string `gorm:"size:256"`
FunctionName string `gorm:"size:256"`
About string `gorm:"type:citext"`
AcceptedTermPolicyAt string `gorm:"size:20"`
AcceptedTermPolicyData string `gorm:"type:citext"`
FrontpageID int `gorm:"index"`
SystemUnitID int `gorm:"index"`
Active string `gorm:"size:1"`
CustomCode string `gorm:"size:256"`
OTPSecret string `gorm:"size:256"`
SystemUnit SystemUnit `gorm:"foreignKey:SystemUnitID"`
Frontpage SystemProgram `gorm:"foreignKey:FrontpageID"`
}
type SystemUserUnit struct {
ID int `gorm:"primaryKey"`
SystemUserID int
SystemUnitID int
SystemUser SystemUser `gorm:"foreignKey:SystemUserID"`
SystemUnit SystemUnit `gorm:"foreignKey:SystemUnitID"`
}
type SystemUserGroup struct {
ID int `gorm:"primaryKey"`
SystemUserID int
SystemGroupID int
SystemUser SystemUser `gorm:"foreignKey:SystemUserID"`
SystemGroup SystemGroup `gorm:"foreignKey:SystemGroupID"`
}
type SystemUserRole struct {
ID int `gorm:"primaryKey"`
SystemUserID int
SystemRoleID int
SystemUser SystemUser `gorm:"foreignKey:SystemUserID"`
SystemRole SystemRole `gorm:"foreignKey:SystemRoleID"`
}
type SystemGroupProgram struct {
ID int `gorm:"primaryKey"`
SystemGroupID int
SystemProgramID int
SystemGroup SystemGroup `gorm:"foreignKey:SystemGroupID"`
SystemProgram SystemProgram `gorm:"foreignKey:SystemProgramID"`
}
type SystemUserProgram struct {
ID int `gorm:"primaryKey"`
SystemUserID int
SystemProgramID int
SystemUser SystemUser `gorm:"foreignKey:SystemUserID"`
SystemProgram SystemProgram `gorm:"foreignKey:SystemProgramID"`
}
type SystemUserOldPassword struct {
ID int `gorm:"primaryKey"`
SystemUserID int
Password string `gorm:"size:256"`
CreatedAt string `gorm:"size:20"`
SystemUser SystemUser `gorm:"foreignKey:SystemUserID"`
}
type SystemProgramMethodRole struct {
ID int `gorm:"primaryKey"`
SystemProgramID int
SystemRoleID int
MethodName string `gorm:"size:256"`
SystemProgram SystemProgram `gorm:"foreignKey:SystemProgramID"`
SystemRole SystemRole `gorm:"foreignKey:SystemRoleID"`
}
// ====================================================================
// PCast tables
type Customer struct {
ID int `gorm:"primaryKey;autoIncrement"`
CNPJ string `gorm:"unique;not null"`
Nome string `gorm:"not null"`
NomeFantasia string `gorm:"not null"`
Tipo string `gorm:"not null"`
Porte string `gorm:"not null"`
Situacao string `gorm:"not null"`
Abertura string `gorm:"not null"`
NaturezaJuridica string `gorm:"not null"`
Logradouro string `gorm:"not null"`
Numero string `gorm:"not null"`
Complemento string `gorm:"not null"`
Municipio string `gorm:"not null"`
Bairro string `gorm:"not null"`
UF string `gorm:"not null"`
CEP string `gorm:"not null"`
UserID int `gorm:"not null"`
User SystemUser `gorm:"foreignKey:UserID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
type Email struct {
ID int
Name string
EmailText string
}
type Channel struct {
ID int
Name string
TransmissionKey string
CustomerID int
ServerID int
}