package entities import ( "time" "gorm.io/gorm" ) type Kandang struct { Id uint `gorm:"primaryKey"` Name string `gorm:"not null;uniqueIndex:kandangs_name_unique,where:deleted_at IS NULL"` LocationId uint `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"` Pic User `gorm:"foreignKey:PicId;references:Id"` }