mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
23 lines
795 B
Go
23 lines
795 B
Go
package entities
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Nonstock struct {
|
|
Id uint `gorm:"primaryKey"`
|
|
Name string `gorm:"not null;uniqueIndex:nonstocks_name_unique,where:deleted_at IS NULL"`
|
|
UomId 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"`
|
|
Uom Uom `gorm:"foreignKey:UomId;references:Id"`
|
|
Suppliers []Supplier `gorm:"many2many:nonstock_suppliers;joinForeignKey:NonstockID;joinReferences:SupplierID"`
|
|
Flags []Flag `gorm:"polymorphic:Flagable;polymorphicValue:nonstocks"`
|
|
}
|