mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-30 14:02:17 +00:00

* fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename orgiampolicy to domain policy * fix: merge conflicts * fix: protos * fix: md files * implement deprecated org iam policy again Co-authored-by: Livio Amstutz <livio.a@gmail.com>
41 lines
992 B
Go
41 lines
992 B
Go
package command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/caos/logging"
|
|
"github.com/caos/zitadel/internal/domain"
|
|
"github.com/caos/zitadel/internal/eventstore"
|
|
)
|
|
|
|
type Step16 struct {
|
|
DefaultMessageTexts []domain.CustomMessageText
|
|
}
|
|
|
|
func (s *Step16) Step() domain.Step {
|
|
return domain.Step16
|
|
}
|
|
|
|
func (s *Step16) execute(ctx context.Context, commandSide *Commands) error {
|
|
return commandSide.SetupStep16(ctx, s)
|
|
}
|
|
|
|
func (c *Commands) SetupStep16(ctx context.Context, step *Step16) error {
|
|
fn := func(iam *InstanceWriteModel) ([]eventstore.Command, error) {
|
|
iamAgg := InstanceAggregateFromWriteModel(&iam.WriteModel)
|
|
events := make([]eventstore.Command, 0)
|
|
|
|
for _, text := range step.DefaultMessageTexts {
|
|
mailEvents, _, err := c.setDefaultMessageText(ctx, iamAgg, &text)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
events = append(events, mailEvents...)
|
|
}
|
|
|
|
logging.Log("SETUP-4k0LL").Info("default message text set up")
|
|
return events, nil
|
|
}
|
|
return c.setup(ctx, step, fn)
|
|
}
|