mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
31 lines
1.3 KiB
Go
31 lines
1.3 KiB
Go
package entities
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type ProjectFlock struct {
|
|
Id uint `gorm:"primaryKey"`
|
|
FlockName string `gorm:"type:varchar(255);not null;uniqueIndex"`
|
|
AreaId uint `gorm:"not null"`
|
|
Category string `gorm:"type:varchar(20);not null"`
|
|
FcrId uint `gorm:"not null"`
|
|
LocationId 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:"-"`
|
|
|
|
Area Area `gorm:"foreignKey:AreaId;references:Id"`
|
|
Fcr Fcr `gorm:"foreignKey:FcrId;references:Id"`
|
|
Location Location `gorm:"foreignKey:LocationId;references:Id"`
|
|
CreatedUser User `gorm:"foreignKey:CreatedBy;references:Id"`
|
|
Kandangs []Kandang `gorm:"many2many:project_flock_kandangs;joinTableForeignKey:project_flock_id;joinTableReferences:kandang_id" json:"kandangs,omitempty"`
|
|
KandangHistory []ProjectFlockKandang `gorm:"foreignKey:ProjectFlockId;references:Id" json:"-"`
|
|
Budgets []ProjectBudget `gorm:"foreignKey:ProjectFlockId;references:Id" json:"-"`
|
|
|
|
LatestApproval *Approval `gorm:"-" json:"-"`
|
|
}
|