mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
22 lines
665 B
Go
22 lines
665 B
Go
|
package view
|
||
|
|
||
|
import (
|
||
|
"github.com/caos/zitadel/internal/errors"
|
||
|
es_models "github.com/caos/zitadel/internal/eventstore/models"
|
||
|
iam_es_model "github.com/caos/zitadel/internal/iam/repository/eventsourcing/model"
|
||
|
)
|
||
|
|
||
|
func IAMByIDQuery(id string, latestSequence uint64) (*es_models.SearchQuery, error) {
|
||
|
if id == "" {
|
||
|
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-4ng8sd", "id should be filled")
|
||
|
}
|
||
|
return IAMQuery(latestSequence).
|
||
|
AggregateIDFilter(id), nil
|
||
|
}
|
||
|
|
||
|
func IAMQuery(latestSequence uint64) *es_models.SearchQuery {
|
||
|
return es_models.NewSearchQuery().
|
||
|
AggregateTypeFilter(iam_es_model.IAMAggregate).
|
||
|
LatestSequenceFilter(latestSequence)
|
||
|
}
|