mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-04 12:39:09 +00:00
22 lines
412 B
Go
22 lines
412 B
Go
![]() |
package provider
|
||
|
|
||
|
import "github.com/caos/zitadel/internal/eventstore/v2"
|
||
|
|
||
|
type WriteModel struct {
|
||
|
eventstore.WriteModel
|
||
|
|
||
|
IDPConfigID string
|
||
|
IDPProviderType Type
|
||
|
}
|
||
|
|
||
|
func (wm *WriteModel) Reduce() error {
|
||
|
for _, event := range wm.Events {
|
||
|
switch e := event.(type) {
|
||
|
case *AddedEvent:
|
||
|
wm.IDPConfigID = e.IDPConfigID
|
||
|
wm.IDPProviderType = e.IDPProviderType
|
||
|
}
|
||
|
}
|
||
|
return wm.WriteModel.Reduce()
|
||
|
}
|