daddy/internal/model/workgroup.go

29 lines
487 B
Go
Raw Normal View History

package model
import (
"time"
"github.com/jinzhu/gorm"
)
const ObjectTypeWorkgroup = "workgroup"
type Workgroup struct {
gorm.Model
Name *string `json:"name"`
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"`
}