feat: e-mail templates (#1158)

* View definition added

* Get templates and texts from the database.

* Fill in texts in templates

* Fill in texts in templates

* Client API added

* Weekly backup

* Weekly backup

* Daily backup

* Weekly backup

* Tests added

* Corrections from merge branch

* Fixes from pull request review
This commit is contained in:
Michael Waeger
2021-01-18 14:17:22 +01:00
committed by GitHub
parent e7540e5e05
commit f2a32871a7
88 changed files with 5325 additions and 155 deletions

View File

@@ -1,8 +1,9 @@
package model
import (
"github.com/caos/zitadel/internal/model"
"time"
"github.com/caos/zitadel/internal/model"
)
type ProjectRoleView struct {
@@ -13,6 +14,7 @@ type ProjectRoleView struct {
DisplayName string
Group string
CreationDate time.Time
ChangeDate time.Time
Sequence uint64
}

View File

@@ -2,12 +2,13 @@ package model
import (
"encoding/json"
"time"
"github.com/caos/logging"
caos_errs "github.com/caos/zitadel/internal/errors"
"github.com/caos/zitadel/internal/eventstore/models"
"github.com/caos/zitadel/internal/project/model"
es_model "github.com/caos/zitadel/internal/project/repository/eventsourcing/model"
"time"
)
const (
@@ -27,6 +28,7 @@ type ProjectRoleView struct {
ResourceOwner string `json:"-" gorm:"resource_owner"`
CreationDate time.Time `json:"-" gorm:"column:creation_date"`
ChangeDate time.Time `json:"-" gorm:"column:change_date"`
}
func ProjectRoleViewFromModel(role *model.ProjectRoleView) *ProjectRoleView {
@@ -39,6 +41,7 @@ func ProjectRoleViewFromModel(role *model.ProjectRoleView) *ProjectRoleView {
Group: role.Group,
Sequence: role.Sequence,
CreationDate: role.CreationDate,
ChangeDate: role.ChangeDate,
}
}
@@ -52,6 +55,7 @@ func ProjectRoleToModel(role *ProjectRoleView) *model.ProjectRoleView {
Group: role.Group,
Sequence: role.Sequence,
CreationDate: role.CreationDate,
ChangeDate: role.ChangeDate,
}
}
@@ -71,6 +75,7 @@ func (r *ProjectRoleView) AppendEvent(event *models.Event) (err error) {
r.CreationDate = event.CreationDate
err = r.SetData(event)
case es_model.ProjectRoleChanged:
r.ChangeDate = event.CreationDate
err = r.SetData(event)
}
return err