2020-07-21 18:10:03 +02:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/jinzhu/gorm"
|
|
|
|
)
|
|
|
|
|
2020-10-02 16:37:24 +02:00
|
|
|
const ObjectTypeWorkgroup = "workgroup"
|
|
|
|
|
2020-07-21 18:10:03 +02:00
|
|
|
type Workgroup struct {
|
|
|
|
gorm.Model
|
|
|
|
Name *string `json:"name"`
|
|
|
|
ClosedAt time.Time `json:"closedAt"`
|
2020-10-02 16:37:24 +02:00
|
|
|
Members []*User `gorm:"many2many:users_workgroups;association_autoupdate:false"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *Workgroup) ObjectID() uint {
|
|
|
|
return w.ID
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *Workgroup) ObjectType() string {
|
|
|
|
return ObjectTypeWorkgroup
|
2020-07-21 18:10:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type WorkgroupChanges struct {
|
|
|
|
Name *string `json:"name"`
|
|
|
|
}
|