mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
7f26f1815b
* feat: remove previous sequence check * feat: object creation date * feat: simplify member write model * feat: simplify write model * feat: simplify write model
44 lines
897 B
Go
44 lines
897 B
Go
package idp
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/caos/zitadel/internal/errors"
|
|
"github.com/caos/zitadel/internal/eventstore/v2"
|
|
"github.com/caos/zitadel/internal/eventstore/v2/repository"
|
|
)
|
|
|
|
type ConfigReactivatedEvent struct {
|
|
eventstore.BaseEvent `json:"-"`
|
|
|
|
ConfigID string `idpConfigId`
|
|
}
|
|
|
|
func NewConfigReactivatedEvent(
|
|
base *eventstore.BaseEvent,
|
|
configID string,
|
|
) *ConfigReactivatedEvent {
|
|
|
|
return &ConfigReactivatedEvent{
|
|
BaseEvent: *base,
|
|
ConfigID: configID,
|
|
}
|
|
}
|
|
|
|
func (e *ConfigReactivatedEvent) Data() interface{} {
|
|
return e
|
|
}
|
|
|
|
func ConfigReactivatedEventMapper(event *repository.Event) (eventstore.EventReader, error) {
|
|
e := &ConfigReactivatedEvent{
|
|
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
|
}
|
|
|
|
err := json.Unmarshal(event.Data, e)
|
|
if err != nil {
|
|
return nil, errors.ThrowInternal(err, "OIDC-plaBZ", "unable to unmarshal event")
|
|
}
|
|
|
|
return e, nil
|
|
}
|