2021-01-04 14:52:13 +01:00
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
2021-02-23 15:13:04 +01:00
|
|
|
"github.com/caos/zitadel/internal/eventstore"
|
|
|
|
"github.com/caos/zitadel/internal/repository/org"
|
|
|
|
"github.com/caos/zitadel/internal/repository/policy"
|
2021-01-04 14:52:13 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type OrgPasswordLockoutPolicyReadModel struct {
|
2021-08-11 08:36:32 +02:00
|
|
|
LockoutPolicyReadModel
|
2021-01-04 14:52:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (rm *OrgPasswordLockoutPolicyReadModel) AppendEvents(events ...eventstore.EventReader) {
|
|
|
|
for _, event := range events {
|
|
|
|
switch e := event.(type) {
|
2021-08-11 08:36:32 +02:00
|
|
|
case *org.LockoutPolicyAddedEvent:
|
|
|
|
rm.LockoutPolicyReadModel.AppendEvents(&e.LockoutPolicyAddedEvent)
|
|
|
|
case *org.LockoutPolicyChangedEvent:
|
|
|
|
rm.LockoutPolicyReadModel.AppendEvents(&e.LockoutPolicyChangedEvent)
|
|
|
|
case *policy.LockoutPolicyAddedEvent, *policy.LockoutPolicyChangedEvent:
|
|
|
|
rm.LockoutPolicyReadModel.AppendEvents(e)
|
2021-01-04 14:52:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|