38 lines
725 B
Go
Raw Normal View History

2023-06-28 08:19:34 +02:00
package pseudo
import (
2023-06-28 11:35:22 +02:00
"context"
2023-06-28 08:19:34 +02:00
"time"
"github.com/zitadel/zitadel/internal/eventstore"
)
const (
eventTypePrefix = eventstore.EventType("pseudo.")
2023-06-28 11:35:22 +02:00
ScheduledEventType = eventTypePrefix + "timestamp"
2023-06-28 08:19:34 +02:00
)
2023-06-28 11:35:22 +02:00
var _ eventstore.Event = (*ScheduledEvent)(nil)
2023-06-28 08:19:34 +02:00
2023-06-28 11:35:22 +02:00
type ScheduledEvent struct {
*eventstore.BaseEvent `json:"-"`
Timestamp time.Time `json:"-"`
InstanceIDs []string `json:"-"`
2023-06-28 08:19:34 +02:00
}
2023-06-28 11:35:22 +02:00
func NewScheduledEvent(
ctx context.Context,
2023-06-28 08:19:34 +02:00
timestamp time.Time,
instanceIDs ...string,
2023-06-28 11:35:22 +02:00
) *ScheduledEvent {
return &ScheduledEvent{
BaseEvent: eventstore.NewBaseEventForPush(
ctx,
&NewAggregate().Aggregate,
ScheduledEventType,
),
2023-06-28 08:19:34 +02:00
Timestamp: timestamp,
InstanceIDs: instanceIDs,
}
}