zitadel/internal/v2/repository/iam/event_iam_project_set.go

36 lines
644 B
Go
Raw Normal View History

2020-11-06 16:25:07 +00:00
package iam
import (
"context"
"github.com/caos/zitadel/internal/eventstore/v2"
)
const (
2020-11-06 21:09:19 +00:00
ProjectSetEventType eventstore.EventType = "iam.project.iam.set"
2020-11-06 16:25:07 +00:00
)
2020-11-06 21:09:19 +00:00
type ProjectSetEvent struct {
2020-11-06 16:25:07 +00:00
eventstore.BaseEvent `json:"-"`
ProjectID string `json:"iamProjectId"`
}
2020-11-06 21:09:19 +00:00
func (e *ProjectSetEvent) CheckPrevious() bool {
2020-11-06 16:25:07 +00:00
return e.Type() == SetupStartedEventType
}
2020-11-06 21:09:19 +00:00
func (e *ProjectSetEvent) Data() interface{} {
2020-11-06 16:25:07 +00:00
return e
}
2020-11-06 21:09:19 +00:00
func NewProjectSetEvent(ctx context.Context, projectID string) *ProjectSetEvent {
return &ProjectSetEvent{
2020-11-06 16:25:07 +00:00
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
SetupDoneEventType,
),
ProjectID: projectID,
}
}