fix(eventstore): sub queries (#1805)

* sub queries

* fix: tests

* add builder to tests

* new search query

* rename searchquerybuilder to builder

* remove comment from code

* test with multiple queries

* add filters test

* fix(contibute): listing

* add validate module

* fix: search queries

* remove unused event type in query

* ignore query if error in marshal

* go mod tidy

* update privacy policy query

* update queries

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Silvan
2021-07-06 13:55:57 +02:00
committed by GitHub
parent 0e472a347f
commit 5349d96ce4
85 changed files with 1258 additions and 686 deletions

View File

@@ -2,6 +2,7 @@ package command
import (
"context"
"github.com/caos/zitadel/internal/eventstore"
"github.com/caos/zitadel/internal/domain"
@@ -26,9 +27,11 @@ func NewOrgIDPConfigWriteModel(configID, orgID string) *OrgIDPConfigWriteModel {
}
func (wm *OrgIDPConfigWriteModel) Query() *eventstore.SearchQueryBuilder {
return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent, org.AggregateType).
AggregateIDs(wm.AggregateID).
return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent).
ResourceOwner(wm.ResourceOwner).
AddQuery().
AggregateTypes(org.AggregateType).
AggregateIDs(wm.AggregateID).
EventTypes(
org.IDPConfigAddedEventType,
org.IDPConfigChangedEventType,
@@ -36,7 +39,8 @@ func (wm *OrgIDPConfigWriteModel) Query() *eventstore.SearchQueryBuilder {
org.IDPConfigReactivatedEventType,
org.IDPConfigRemovedEventType,
org.IDPOIDCConfigAddedEventType,
org.IDPOIDCConfigChangedEventType)
org.IDPOIDCConfigChangedEventType).
Builder()
}
func (wm *OrgIDPConfigWriteModel) AppendEvents(events ...eventstore.EventReader) {