feat(invite): worked on pending invitations list, revoke invite now works, #2353

This commit is contained in:
Torkel Ödegaard
2015-07-20 10:57:39 +02:00
parent 4ac652b127
commit 3242354a4b
11 changed files with 116 additions and 65 deletions
+22 -3
View File
@@ -10,6 +10,15 @@ var (
ErrTempUserNotFound = errors.New("User not found")
)
type TempUserStatus string
const (
TmpUserInvitePending TempUserStatus = "InvitePending"
TmpUserCompleted TempUserStatus = "Completed"
TmpUserEmailPending TempUserStatus = "EmailPending"
TmpUserRevoked TempUserStatus = "Revoked"
)
// TempUser holds data for org invites and unconfirmed sign ups
type TempUser struct {
Id int64
@@ -18,12 +27,13 @@ type TempUser struct {
Email string
Name string
Role RoleType
IsInvite bool
InvitedByUserId int64
Status TempUserStatus
EmailSent bool
EmailSentOn time.Time
Code string
RemoteAddr string
Created time.Time
Updated time.Time
@@ -36,16 +46,24 @@ type CreateTempUserCommand struct {
Email string
Name string
OrgId int64
IsInvite bool
InvitedByUserId int64
Status TempUserStatus
Code string
Role RoleType
RemoteAddr string
Result *TempUser
}
type UpdateTempUserStatusCommand struct {
Id int64
OrgId int64
Status TempUserStatus
}
type GetTempUsersForOrgQuery struct {
OrgId int64
OrgId int64
Status TempUserStatus
Result []*TempUserDTO
}
@@ -56,6 +74,7 @@ type TempUserDTO struct {
Email string `json:"email"`
Role string `json:"role"`
InvitedBy string `json:"invitedBy"`
Code string `json:"code"`
EmailSent bool `json:"emailSent"`
EmailSentOn time.Time `json:"emailSentOn"`
Created time.Time `json:"createdOn"`