zitadel/internal/api/grpc/management/mail_template_converter.go
Fabi d8e42744b4
fix: move v2 pkgs (#1331)
* fix: move eventstore pkgs

* fix: move eventstore pkgs

* fix: remove v2 view

* fix: remove v2 view
2021-02-23 15:13:04 +01:00

32 lines
1.0 KiB
Go

package management
import (
"github.com/caos/zitadel/internal/domain"
iam_model "github.com/caos/zitadel/internal/iam/model"
"github.com/caos/zitadel/pkg/grpc/management"
"google.golang.org/protobuf/types/known/timestamppb"
)
func mailTemplateRequestToDomain(mailTemplate *management.MailTemplateUpdate) *domain.MailTemplate {
return &domain.MailTemplate{
Template: mailTemplate.Template,
}
}
func mailTemplateFromDomain(mailTemplate *domain.MailTemplate) *management.MailTemplate {
return &management.MailTemplate{
Template: mailTemplate.Template,
CreationDate: timestamppb.New(mailTemplate.CreationDate),
ChangeDate: timestamppb.New(mailTemplate.ChangeDate),
}
}
func mailTemplateViewFromModel(mailTemplate *iam_model.MailTemplateView) *management.MailTemplateView {
return &management.MailTemplateView{
Default: mailTemplate.Default,
Template: mailTemplate.Template,
CreationDate: timestamppb.New(mailTemplate.CreationDate),
ChangeDate: timestamppb.New(mailTemplate.ChangeDate),
}
}