22 lines
626 B
Go
22 lines
626 B
Go
package model
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Position struct {
|
|
gorm.Model
|
|
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primarykey"`
|
|
Name string `json:"name" gorm:"unique;index"`
|
|
RightMask int `json:"right_mask"`
|
|
OrganizationID uuid.UUID `json:"organization_id" gorm:"index;not null"`
|
|
Users []User `json:"users,omitempty"`
|
|
}
|
|
|
|
type PositionApi struct {
|
|
Name string `json:"name" gorm:"unique;index"`
|
|
RightMask int `json:"right_mask"`
|
|
OrganizationID uuid.UUID `json:"organization_id" gorm:"index;not null"`
|
|
}
|