-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdepartment.go
More file actions
40 lines (32 loc) · 888 Bytes
/
department.go
File metadata and controls
40 lines (32 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package manager
type Departmentable interface {
GetName() string
GetDescription() string
}
type DepartmentableEntry interface {
Entry
Departmentable
GetChildDepartments() (departments []DepartmentableEntry)
CreateChildDepartment(departmentable Departmentable) (DepartmentableEntry, error)
GetUsers() (users []UserableEntry, err error)
}
func NewDepartment() *department {
return new(department)
}
type department struct {
Name string
Description string
}
func (d department) GetName() string {
return d.Name
}
func (d department) GetDescription() string {
return d.Description
}
type DepartmentModifyUserOptions struct {
Role DepartmentUserRole
}
type DepartmentUserWriter interface {
AddToDepartment(options DepartmentModifyUserOptions, extID ExternalIdentity) error
RemoveFromDepartment(options DepartmentModifyUserOptions, extID ExternalIdentity) error
}