daddy/internal/model/workgroup.go

30 lines
530 B
Go

package model
import (
"time"
"github.com/jinzhu/gorm"
)
const ObjectTypeWorkgroup = "workgroup"
type Workgroup struct {
gorm.Model
Name *string `json:"name"`
Workgroup *string `json:"workgroup"`
ClosedAt time.Time `json:"closedAt"`
Members []*User `gorm:"many2many:users_workgroups;association_autoupdate:false"`
}
func (w *Workgroup) ObjectID() uint {
return w.ID
}
func (w *Workgroup) ObjectType() string {
return ObjectTypeWorkgroup
}
type WorkgroupChanges struct {
Name *string `json:"name"`
}