-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.go
42 lines (37 loc) · 855 Bytes
/
model.go
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
41
42
package user
import (
"net/mail"
"time"
"github.com/google/uuid"
)
// User represents information about an individual user.
type User struct {
ID uuid.UUID
Name string
Email mail.Address
Roles []Role
PasswordHash []byte
Department string
Enabled bool
DateCreated time.Time
DateUpdated time.Time
}
// NewUser contains information needed to create a new user.
type NewUser struct {
Name string
Email mail.Address
Roles []Role
Department string
Password string
PasswordConfirm string
}
// UpdateUser contains information needed to update a user.
type UpdateUser struct {
Name *string
Email *mail.Address
Roles []Role
Department *string
Password *string
PasswordConfirm *string
Enabled *bool
}