mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-15 12:20:02 +00:00
idp command side done
This commit is contained in:
@@ -15,6 +15,7 @@ const (
|
||||
)
|
||||
|
||||
type IDPOIDCConfigWriteModel struct {
|
||||
eventstore.WriteModel
|
||||
oidc.ConfigWriteModel
|
||||
|
||||
iamID string
|
||||
@@ -28,12 +29,8 @@ func NewIDPOIDCConfigWriteModel(iamID, idpConfigID string) *IDPOIDCConfigWriteMo
|
||||
}
|
||||
}
|
||||
|
||||
func (wm *IDPOIDCConfigWriteModel) Query() *eventstore.SearchQueryFactory {
|
||||
return eventstore.NewSearchQueryFactory(eventstore.ColumnsEvent, AggregateType).
|
||||
AggregateIDs(wm.iamID)
|
||||
}
|
||||
|
||||
func (wm *IDPOIDCConfigWriteModel) AppendEvents(events ...eventstore.EventReader) {
|
||||
wm.WriteModel.AppendEvents(events...)
|
||||
for _, event := range events {
|
||||
switch e := event.(type) {
|
||||
case *IDPOIDCConfigAddedEvent:
|
||||
@@ -52,6 +49,18 @@ func (wm *IDPOIDCConfigWriteModel) AppendEvents(events ...eventstore.EventReader
|
||||
}
|
||||
}
|
||||
|
||||
func (wm *IDPOIDCConfigWriteModel) Reduce() error {
|
||||
if err := wm.ConfigWriteModel.Reduce(); err != nil {
|
||||
return err
|
||||
}
|
||||
return wm.WriteModel.Reduce()
|
||||
}
|
||||
|
||||
func (wm *IDPOIDCConfigWriteModel) Query() *eventstore.SearchQueryFactory {
|
||||
return eventstore.NewSearchQueryFactory(eventstore.ColumnsEvent, AggregateType).
|
||||
AggregateIDs(wm.iamID)
|
||||
}
|
||||
|
||||
type IDPOIDCConfigAddedEvent struct {
|
||||
oidc.ConfigAddedEvent
|
||||
}
|
||||
|
Reference in New Issue
Block a user