2021-01-04 14:52:13 +01:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
2021-02-23 15:13:04 +01:00
|
|
|
"github.com/caos/zitadel/internal/domain"
|
2021-01-04 14:52:13 +01:00
|
|
|
)
|
|
|
|
|
2021-01-08 11:33:45 +01:00
|
|
|
func orgWriteModelToOrg(wm *OrgWriteModel) *domain.Org {
|
|
|
|
return &domain.Org{
|
2021-01-15 09:32:59 +01:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel),
|
|
|
|
Name: wm.Name,
|
|
|
|
State: wm.State,
|
|
|
|
PrimaryDomain: wm.PrimaryDomain,
|
2021-01-08 11:33:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-05 09:33:45 +01:00
|
|
|
func orgWriteModelToOrgIAMPolicy(wm *ORGOrgIAMPolicyWriteModel) *domain.OrgIAMPolicy {
|
|
|
|
return &domain.OrgIAMPolicy{
|
2021-01-04 14:52:13 +01:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.PolicyOrgIAMWriteModel.WriteModel),
|
|
|
|
UserLoginMustBeDomain: wm.UserLoginMustBeDomain,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-05 09:33:45 +01:00
|
|
|
func orgWriteModelToPasswordComplexityPolicy(wm *OrgPasswordComplexityPolicyWriteModel) *domain.PasswordComplexityPolicy {
|
|
|
|
return &domain.PasswordComplexityPolicy{
|
2021-01-04 14:52:13 +01:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.PasswordComplexityPolicyWriteModel.WriteModel),
|
|
|
|
MinLength: wm.MinLength,
|
|
|
|
HasLowercase: wm.HasLowercase,
|
2021-01-18 11:24:15 +01:00
|
|
|
HasUppercase: wm.HasUppercase,
|
2021-01-04 14:52:13 +01:00
|
|
|
HasNumber: wm.HasNumber,
|
|
|
|
HasSymbol: wm.HasSymbol,
|
|
|
|
}
|
|
|
|
}
|
2021-01-08 11:33:45 +01: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,
|
|
|
|
}
|
|
|
|
}
|
2021-07-05 10:36:51 +02:00
|
|
|
|
|
|
|
func orgWriteModelToPrivacyPolicy(wm *OrgPrivacyPolicyWriteModel) *domain.PrivacyPolicy {
|
|
|
|
return &domain.PrivacyPolicy{
|
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.PrivacyPolicyWriteModel.WriteModel),
|
|
|
|
TOSLink: wm.TOSLink,
|
|
|
|
PrivacyLink: wm.PrivacyLink,
|
|
|
|
}
|
|
|
|
}
|