zitadel/internal/v2/repository/member/event_changed.go

38 lines
573 B
Go
Raw Normal View History

2020-11-06 21:09:19 +00:00
package member
import (
"github.com/caos/zitadel/internal/eventstore/v2"
)
2020-11-11 16:51:44 +00:00
const (
ChangedEventType = "member.changed"
)
type ChangedEvent struct {
2020-11-06 21:09:19 +00:00
eventstore.BaseEvent `json:"-"`
Roles []string `json:"roles"`
UserID string `json:"userId"`
}
2020-11-11 16:51:44 +00:00
func (e *ChangedEvent) CheckPrevious() bool {
2020-11-06 21:09:19 +00:00
return true
}
2020-11-11 16:51:44 +00:00
func (e *ChangedEvent) Data() interface{} {
2020-11-06 21:09:19 +00:00
return e
}
func NewMemberChangedEvent(
2020-11-11 16:51:44 +00:00
base *eventstore.BaseEvent,
2020-11-06 21:09:19 +00:00
userID string,
roles ...string,
2020-11-11 16:51:44 +00:00
) *ChangedEvent {
return &ChangedEvent{
BaseEvent: *base,
Roles: roles,
UserID: userID,
2020-11-06 21:09:19 +00:00
}
}