31 lines
632 B
Go
Raw Normal View History

2020-11-06 13:47:27 +01:00
package iam
2020-11-06 22:09:19 +01:00
import (
2020-11-17 13:44:37 +01:00
"context"
2020-11-06 22:09:19 +01:00
"github.com/caos/zitadel/internal/eventstore/v2"
"github.com/caos/zitadel/internal/v2/domain"
2020-11-06 22:09:19 +01:00
)
2020-11-06 13:47:27 +01:00
const (
iamEventTypePrefix = eventstore.EventType("iam.")
)
const (
AggregateType = "iam"
AggregateVersion = "v1"
)
2020-11-06 13:47:27 +01:00
type Aggregate struct {
eventstore.Aggregate
}
func (a *Aggregate) PushStepStarted(ctx context.Context, step domain.Step) *Aggregate {
2020-11-25 20:04:32 +01:00
a.Aggregate = *a.PushEvents(NewSetupStepStartedEvent(ctx, step))
return a
}
func (a *Aggregate) PushStepDone(ctx context.Context, step domain.Step) *Aggregate {
2020-11-25 20:04:32 +01:00
a.Aggregate = *a.PushEvents(NewSetupStepDoneEvent(ctx, step))
return a
}