mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
33 lines
565 B
Go
33 lines
565 B
Go
package domain
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
|
)
|
|
|
|
type Org struct {
|
|
models.ObjectRoot
|
|
|
|
State OrgState
|
|
Name string
|
|
|
|
PrimaryDomain string
|
|
Domains []*OrgDomain
|
|
}
|
|
|
|
func (o *Org) IsValid() bool {
|
|
return o != nil && o.Name != ""
|
|
}
|
|
|
|
func (o *Org) AddIAMDomain(iamDomain string) {
|
|
o.Domains = append(o.Domains, &OrgDomain{Domain: NewIAMDomainName(o.Name, iamDomain), Verified: true, Primary: true})
|
|
}
|
|
|
|
type OrgState int32
|
|
|
|
const (
|
|
OrgStateUnspecified OrgState = iota
|
|
OrgStateActive
|
|
OrgStateInactive
|
|
OrgStateRemoved
|
|
)
|