zitadel/internal/org/model/org_member_view.go
Silvan 3025ac577b
feat: org queries (#136)
* search orgs

* org by domain

* member spooler

* member

* get roles

* tests

* types duration

* use default func for renew

* correct database

* reorder migrations

* delete unused consts

* move get roles to internal

* use prepared org by domain

* implement org in other objects

* add eventstores
2020-05-26 16:46:16 +02:00

60 lines
1.1 KiB
Go

package model
import (
"time"
"github.com/caos/zitadel/internal/model"
)
type OrgMemberView struct {
UserID string
OrgID string
UserName string
Email string
FirstName string
LastName string
Roles []string
CreationDate time.Time
ChangeDate time.Time
Sequence uint64
}
type OrgMemberSearchRequest struct {
Offset uint64
Limit uint64
SortingColumn OrgMemberSearchKey
Asc bool
Queries []*OrgMemberSearchQuery
}
type OrgMemberSearchKey int32
const (
ORGMEMBERSEARCHKEY_UNSPECIFIED OrgMemberSearchKey = iota
ORGMEMBERSEARCHKEY_USER_NAME
ORGMEMBERSEARCHKEY_EMAIL
ORGMEMBERSEARCHKEY_FIRST_NAME
ORGMEMBERSEARCHKEY_LAST_NAME
ORGMEMBERSEARCHKEY_ORG_ID
ORGMEMBERSEARCHKEY_USER_ID
)
type OrgMemberSearchQuery struct {
Key OrgMemberSearchKey
Method model.SearchMethod
Value string
}
type OrgMemberSearchResponse struct {
Offset uint64
Limit uint64
TotalResult uint64
Result []*OrgMemberView
}
func (r *OrgMemberSearchRequest) EnsureLimit(limit uint64) {
if r.Limit == 0 || r.Limit > limit {
r.Limit = limit
}
}