mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 03:54:21 +00:00
9d4f296c62
* 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>
45 lines
1010 B
Go
45 lines
1010 B
Go
package instance
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/caos/zitadel/internal/eventstore"
|
|
"github.com/caos/zitadel/internal/eventstore/repository"
|
|
"github.com/caos/zitadel/internal/repository/features"
|
|
)
|
|
|
|
var (
|
|
FeaturesSetEventType = instanceEventTypePrefix + features.FeaturesSetEventType
|
|
)
|
|
|
|
type FeaturesSetEvent struct {
|
|
features.FeaturesSetEvent
|
|
}
|
|
|
|
func NewFeaturesSetEvent(
|
|
ctx context.Context,
|
|
aggregate *eventstore.Aggregate,
|
|
changes []features.FeaturesChanges,
|
|
) (*FeaturesSetEvent, error) {
|
|
changedEvent, err := features.NewFeaturesSetEvent(
|
|
eventstore.NewBaseEventForPush(
|
|
ctx,
|
|
aggregate,
|
|
FeaturesSetEventType),
|
|
changes,
|
|
)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &FeaturesSetEvent{FeaturesSetEvent: *changedEvent}, nil
|
|
}
|
|
|
|
func FeaturesSetEventMapper(event *repository.Event) (eventstore.Event, error) {
|
|
e, err := features.FeaturesSetEventMapper(event)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &FeaturesSetEvent{FeaturesSetEvent: *e.(*features.FeaturesSetEvent)}, nil
|
|
}
|