mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
32 lines
856 B
Go
32 lines
856 B
Go
package entities
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Employee struct {
|
|
Id uint `gorm:"primaryKey"`
|
|
Name string `gorm:"not null"`
|
|
IsActive bool `gorm:"not null"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
|
|
EmployeeKandangs []EmployeeKandang `gorm:"foreignKey:EmployeeId;references:Id"`
|
|
}
|
|
|
|
type Employees = Employee
|
|
|
|
type EmployeeKandang struct {
|
|
Id uint `gorm:"primaryKey"`
|
|
EmployeeId uint `gorm:"not null"`
|
|
KandangId uint `gorm:"not null"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
|
|
Employee Employee `gorm:"foreignKey:EmployeeId;references:Id"`
|
|
Kandang KandangGroup `gorm:"foreignKey:KandangId;references:Id"`
|
|
}
|