mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
31 lines
589 B
Go
31 lines
589 B
Go
|
package milestone
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/zitadel/zitadel/internal/api/authz"
|
||
|
"github.com/zitadel/zitadel/internal/eventstore"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
AggregateType = "milestone"
|
||
|
AggregateVersion = "v1"
|
||
|
)
|
||
|
|
||
|
type Aggregate struct {
|
||
|
eventstore.Aggregate
|
||
|
}
|
||
|
|
||
|
func NewAggregate(ctx context.Context, id string) *Aggregate {
|
||
|
instanceID := authz.GetInstance(ctx).InstanceID()
|
||
|
return &Aggregate{
|
||
|
Aggregate: eventstore.Aggregate{
|
||
|
Type: AggregateType,
|
||
|
Version: AggregateVersion,
|
||
|
ID: id,
|
||
|
ResourceOwner: instanceID,
|
||
|
InstanceID: instanceID,
|
||
|
},
|
||
|
}
|
||
|
}
|