mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
55 lines
1.2 KiB
Go
55 lines
1.2 KiB
Go
|
package milestone
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/zitadel/zitadel/internal/eventstore"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
eventTypePrefix = eventstore.EventType("milestone.")
|
||
|
PushedEventType = eventTypePrefix + "pushed"
|
||
|
)
|
||
|
|
||
|
type PushedEvent struct {
|
||
|
*eventstore.BaseEvent `json:"-"`
|
||
|
MilestoneType Type `json:"type"`
|
||
|
ExternalDomain string `json:"externalDomain"`
|
||
|
PrimaryDomain string `json:"primaryDomain"`
|
||
|
Endpoints []string `json:"endpoints"`
|
||
|
}
|
||
|
|
||
|
func (p *PushedEvent) Data() interface{} {
|
||
|
return p
|
||
|
}
|
||
|
|
||
|
func (p *PushedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (p *PushedEvent) SetBaseEvent(b *eventstore.BaseEvent) {
|
||
|
p.BaseEvent = b
|
||
|
}
|
||
|
|
||
|
var PushedEventMapper = eventstore.GenericEventMapper[PushedEvent]
|
||
|
|
||
|
func NewPushedEvent(
|
||
|
ctx context.Context,
|
||
|
aggregate *Aggregate,
|
||
|
msType Type,
|
||
|
endpoints []string,
|
||
|
externalDomain, primaryDomain string,
|
||
|
) *PushedEvent {
|
||
|
return &PushedEvent{
|
||
|
BaseEvent: eventstore.NewBaseEventForPush(
|
||
|
ctx,
|
||
|
&aggregate.Aggregate,
|
||
|
PushedEventType,
|
||
|
),
|
||
|
MilestoneType: msType,
|
||
|
Endpoints: endpoints,
|
||
|
ExternalDomain: externalDomain,
|
||
|
PrimaryDomain: primaryDomain,
|
||
|
}
|
||
|
}
|