mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 12:57:34 +00:00
chore: move the go code into a subfolder
This commit is contained in:
35
apps/api/internal/repository/org/aggregate.go
Normal file
35
apps/api/internal/repository/org/aggregate.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package org
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
)
|
||||
|
||||
const (
|
||||
orgEventTypePrefix = eventstore.EventType("org.")
|
||||
)
|
||||
|
||||
const (
|
||||
AggregateType = "org"
|
||||
AggregateVersion = "v1"
|
||||
)
|
||||
|
||||
type Aggregate struct {
|
||||
eventstore.Aggregate
|
||||
}
|
||||
|
||||
func NewAggregate(id string) *Aggregate {
|
||||
return &Aggregate{
|
||||
Aggregate: eventstore.Aggregate{
|
||||
Type: AggregateType,
|
||||
Version: AggregateVersion,
|
||||
ID: id,
|
||||
ResourceOwner: id,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func AggregateFromWriteModel(ctx context.Context, wm *eventstore.WriteModel) *eventstore.Aggregate {
|
||||
return eventstore.AggregateFromWriteModelCtx(ctx, wm, AggregateType, AggregateVersion)
|
||||
}
|
Reference in New Issue
Block a user