zitadel/internal/command/milestone.go

24 lines
590 B
Go
Raw Normal View History

2023-06-28 08:19:34 +02:00
package command
import (
"context"
"github.com/zitadel/zitadel/internal/repository/milestone"
)
2023-06-28 11:35:22 +02:00
// MilestonePushed writes a new milestone.PushedEvent with a new milestone.Aggregate to the eventstore
2023-06-28 08:19:34 +02:00
func (c *Commands) MilestonePushed(
ctx context.Context,
instanceID string,
2023-06-28 11:35:22 +02:00
msType milestone.Type,
2023-06-28 08:19:34 +02:00
endpoints []string,
primaryDomain string,
) error {
id, err := c.idGenerator.Next()
if err != nil {
return err
}
2023-06-28 11:35:22 +02:00
_, err = c.eventstore.Push(ctx, milestone.NewPushedEvent(ctx, milestone.NewAggregate(id, instanceID, instanceID), msType, endpoints, primaryDomain))
2023-06-28 08:19:34 +02:00
return err
}