zitadel/internal/command/milestone.go

23 lines
569 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,
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-30 02:11:17 +02:00
_, err = c.eventstore.Push(ctx, milestone.NewPushedEvent(ctx, milestone.NewAggregate(ctx, id), msType, endpoints, primaryDomain, c.externalDomain))
2023-06-28 08:19:34 +02:00
return err
}