20 lines
448 B
Go
20 lines
448 B
Go
package model
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Organization struct {
|
|
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primarykey"`
|
|
gorm.Model
|
|
Name string `json:"name" gorm:"unique;index"`
|
|
ParentID uint `json:"parent_id"`
|
|
Positions []Position `json:"positions,omitempty"`
|
|
}
|
|
|
|
type OrganizationApi struct {
|
|
Name string `json:"name" gorm:"unique;index"`
|
|
ParentID uint `json:"parent_id"`
|
|
}
|