2021-01-04 13:52:13 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
2021-01-05 08:33:45 +00:00
|
|
|
"github.com/caos/zitadel/internal/v2/domain"
|
2021-01-04 13:52:13 +00:00
|
|
|
)
|
|
|
|
|
2021-01-08 10:33:45 +00:00
|
|
|
func orgWriteModelToOrg(wm *OrgWriteModel) *domain.Org {
|
|
|
|
return &domain.Org{
|
2021-01-15 08:32:59 +00:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel),
|
|
|
|
Name: wm.Name,
|
|
|
|
State: wm.State,
|
|
|
|
PrimaryDomain: wm.PrimaryDomain,
|
2021-01-08 10:33:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-05 08:33:45 +00:00
|
|
|
func orgWriteModelToOrgIAMPolicy(wm *ORGOrgIAMPolicyWriteModel) *domain.OrgIAMPolicy {
|
|
|
|
return &domain.OrgIAMPolicy{
|
2021-01-04 13:52:13 +00:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.PolicyOrgIAMWriteModel.WriteModel),
|
|
|
|
UserLoginMustBeDomain: wm.UserLoginMustBeDomain,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-05 08:33:45 +00:00
|
|
|
func orgWriteModelToPasswordComplexityPolicy(wm *OrgPasswordComplexityPolicyWriteModel) *domain.PasswordComplexityPolicy {
|
|
|
|
return &domain.PasswordComplexityPolicy{
|
2021-01-04 13:52:13 +00:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.PasswordComplexityPolicyWriteModel.WriteModel),
|
|
|
|
MinLength: wm.MinLength,
|
|
|
|
HasLowercase: wm.HasLowercase,
|
|
|
|
HasUppercase: wm.HasUpperCase,
|
|
|
|
HasNumber: wm.HasNumber,
|
|
|
|
HasSymbol: wm.HasSymbol,
|
|
|
|
}
|
|
|
|
}
|
2021-01-08 10:33:45 +00:00
|
|
|
|
|
|
|
func orgDomainWriteModelToOrgDomain(wm *OrgDomainWriteModel) *domain.OrgDomain {
|
|
|
|
return &domain.OrgDomain{
|
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel),
|
|
|
|
Domain: wm.Domain,
|
|
|
|
Primary: wm.Primary,
|
|
|
|
Verified: wm.Verified,
|
|
|
|
ValidationType: wm.ValidationType,
|
|
|
|
ValidationCode: wm.ValidationCode,
|
|
|
|
}
|
|
|
|
}
|