Initial commit.
This commit is contained in:
23
model/firma.go
Normal file
23
model/firma.go
Normal file
@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type FirmaTyp int
|
||||
|
||||
const (
|
||||
_ FirmaTyp = iota
|
||||
Lieferant
|
||||
Kunde
|
||||
)
|
||||
|
||||
type Firma struct {
|
||||
gorm.Model
|
||||
FirmaTyp FirmaTyp `json:"firma_typ"`
|
||||
Name string `json:"name"`
|
||||
InternerName string `json:"interner_name"`
|
||||
Slug string `gorm:"unique;not null;index" json:"slug"`
|
||||
Branche string `json:"branche"`
|
||||
Tochergesellschaften []*Firma `gorm:"foreignkey:ParentCompany" json:"tochergesellschaften"`
|
||||
ParentCompany *uint `json:"parent_company"`
|
||||
Ansprechpartner []*Ansprechpartner `gorm:"many2many:firma_ansprechpartner" json:"ansprechpartner"`
|
||||
}
|
||||
Reference in New Issue
Block a user