2021-01-04 14:52:13 +01:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-24 17:21:34 +01:00
|
|
|
func orgWriteModelToDomainPolicy(wm *OrgDomainPolicyWriteModel) *domain.DomainPolicy {
|
|
|
|
return &domain.DomainPolicy{
|
2022-05-16 16:08:47 +02:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.PolicyDomainWriteModel.WriteModel),
|
|
|
|
UserLoginMustBeDomain: wm.UserLoginMustBeDomain,
|
|
|
|
ValidateOrgDomains: wm.ValidateOrgDomains,
|
|
|
|
SMTPSenderAddressMatchesInstanceDomain: wm.SMTPSenderAddressMatchesInstanceDomain,
|
2021-01-04 14:52:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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{
|
2024-05-13 16:01:50 +02:00
|
|
|
ObjectRoot: writeModelToObjectRoot(wm.PrivacyPolicyWriteModel.WriteModel),
|
|
|
|
TOSLink: wm.TOSLink,
|
|
|
|
PrivacyLink: wm.PrivacyLink,
|
|
|
|
HelpLink: wm.HelpLink,
|
|
|
|
SupportEmail: wm.SupportEmail,
|
|
|
|
DocsLink: wm.DocsLink,
|
|
|
|
CustomLink: wm.CustomLink,
|
|
|
|
CustomLinkText: wm.CustomLinkText,
|
2021-07-05 10:36:51 +02:00
|
|
|
}
|
|
|
|
}
|