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,
|
2021-01-18 10:24:15 +00:00
|
|
|
HasUppercase: wm.HasUppercase,
|
2021-01-04 13:52:13 +00:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|