mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:17:32 +00:00
fix: change to repository event types and removed unused code (#3386)
* fix: change to repository event types and removed unused code * some fixes * remove unused code
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
es_models "github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
"github.com/caos/zitadel/internal/project/repository/eventsourcing/model"
|
||||
"github.com/caos/zitadel/internal/repository/project"
|
||||
)
|
||||
|
||||
func ProjectByIDQuery(id string, latestSequence uint64) (*es_models.SearchQuery, error) {
|
||||
@@ -18,22 +16,6 @@ func ProjectByIDQuery(id string, latestSequence uint64) (*es_models.SearchQuery,
|
||||
|
||||
func ProjectQuery(latestSequence uint64) *es_models.SearchQuery {
|
||||
return es_models.NewSearchQuery().
|
||||
AggregateTypeFilter(model.ProjectAggregate).
|
||||
AggregateTypeFilter(project.AggregateType).
|
||||
LatestSequenceFilter(latestSequence)
|
||||
}
|
||||
|
||||
func ChangesQuery(projectID string, latestSequence, limit uint64, sortAscending bool, retention time.Duration) *es_models.SearchQuery {
|
||||
query := es_models.NewSearchQuery().
|
||||
AggregateTypeFilter(model.ProjectAggregate)
|
||||
if !sortAscending {
|
||||
query.OrderDesc()
|
||||
}
|
||||
if retention > 0 {
|
||||
query.CreationDateNewerFilter(time.Now().Add(-retention))
|
||||
}
|
||||
|
||||
query.LatestSequenceFilter(latestSequence).
|
||||
AggregateIDFilter(projectID).
|
||||
SetLimit(limit)
|
||||
return query
|
||||
}
|
||||
|
Reference in New Issue
Block a user