mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
28 lines
1.4 KiB
Go
28 lines
1.4 KiB
Go
package entities
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Kandang struct {
|
|
Id uint `gorm:"primaryKey"`
|
|
Name string `gorm:"type:varchar(50);not null;uniqueIndex:kandangs_name_unique,where:deleted_at IS NULL"`
|
|
Status string `gorm:"type:varchar(50);not null"`
|
|
LocationId uint `gorm:"not null"`
|
|
KandangGroupId uint `gorm:"not null"`
|
|
Capacity float64 `gorm:"not null"`
|
|
PicId uint `gorm:"not null"`
|
|
CreatedBy uint `gorm:"not null"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
CreatedUser User `gorm:"foreignKey:CreatedBy;references:Id"`
|
|
Location Location `gorm:"foreignKey:LocationId;references:Id"`
|
|
KandangGroup KandangGroup `gorm:"foreignKey:KandangGroupId;references:Id"`
|
|
Pic User `gorm:"foreignKey:PicId;references:Id"`
|
|
Warehouses []Warehouse `gorm:"foreignKey:KandangId;references:Id"`
|
|
ProjectFlockKandangs []ProjectFlockKandang `gorm:"foreignKey:KandangId;references:Id" json:"-"`
|
|
}
|