zitadel/internal/repository/iam/custom_text.go
Fabi bdf3887f9e
feat: custom message text (#1801)
* feat: default custom message text

* feat: org custom message text

* feat: org custom message text

* feat: custom messages query side

* feat: default messages

* feat: message text user fields

* feat: check for inactive user

* feat: fix send password reset

* feat: fix custom org text

* feat: add variables to docs

* feat: custom text tests

* feat: fix notifications

* feat: add custom text feature

* feat: add custom text feature

* feat: feature in custom message texts

* feat: add custom text feature in frontend

* feat: merge main

* feat: feature tests

* feat: change phone message in setup

* fix: remove unused code, add event translation

* fix: merge main and fix problems

* fix: english translation file

* fix: migration versions

* fix: setup

* feat: fix pr requests

* feat: fix phone code message

* feat: migration

* feat: setup

* fix: remove unused tests

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2021-06-10 11:49:10 +00:00

47 lines
1012 B
Go

package iam
import (
"context"
"golang.org/x/text/language"
"github.com/caos/zitadel/internal/eventstore"
"github.com/caos/zitadel/internal/eventstore/repository"
"github.com/caos/zitadel/internal/repository/policy"
)
var (
CustomTextSetEventType = iamEventTypePrefix + policy.CustomTextSetEventType
)
type CustomTextSetEvent struct {
policy.CustomTextSetEvent
}
func NewCustomTextSetEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
template,
key,
text string,
language language.Tag,
) *CustomTextSetEvent {
return &CustomTextSetEvent{
CustomTextSetEvent: *policy.NewCustomTextSetEvent(
eventstore.NewBaseEventForPush(ctx, aggregate, CustomTextSetEventType),
template,
key,
text,
language),
}
}
func CustomTextSetEventMapper(event *repository.Event) (eventstore.EventReader, error) {
e, err := policy.CustomTextSetEventMapper(event)
if err != nil {
return nil, err
}
return &CustomTextSetEvent{CustomTextSetEvent: *e.(*policy.CustomTextSetEvent)}, nil
}