fix: Previous sequence (#1086)

* feat: remove previous sequence check

* feat: object creation date

* feat: simplify member write model

* feat: simplify write model

* feat: simplify write model
This commit is contained in:
Fabi
2020-12-14 17:24:01 +01:00
committed by GitHub
parent 5b433dcaa3
commit 7f26f1815b
60 changed files with 229 additions and 693 deletions

View File

@@ -20,10 +20,6 @@ type AddedEvent struct {
SecondaryColor string `json:"secondaryColor,omitempty"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -61,10 +57,6 @@ type ChangedEvent struct {
SecondaryColor string `json:"secondaryColor,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -106,10 +98,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}

View File

@@ -27,10 +27,6 @@ type AddedEvent struct {
PasswordlessType PasswordlessType `json:"passwordlessType"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -76,10 +72,6 @@ type ChangedEvent struct {
PasswordlessType PasswordlessType `json:"passwordlessType"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -134,10 +126,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}

View File

@@ -46,10 +46,6 @@ func SecondFactorAddedEventMapper(event *repository.Event) (eventstore.EventRead
return e, nil
}
func (e *SecondFactorAddedEvent) CheckPrevious() bool {
return true
}
func (e *SecondFactorAddedEvent) Data() interface{} {
return e
}
@@ -82,10 +78,6 @@ func SecondFactorRemovedEventMapper(event *repository.Event) (eventstore.EventRe
return e, nil
}
func (e *SecondFactorRemovedEvent) CheckPrevious() bool {
return true
}
func (e *SecondFactorRemovedEvent) Data() interface{} {
return e
}
@@ -119,10 +111,6 @@ func MultiFactorAddedEventMapper(event *repository.Event) (eventstore.EventReade
return e, nil
}
func (e *MultiFactorAddedEvent) CheckPrevious() bool {
return true
}
func (e *MultiFactorAddedEvent) Data() interface{} {
return e
}
@@ -155,10 +143,6 @@ func MultiFactorRemovedEventMapper(event *repository.Event) (eventstore.EventRea
return e, nil
}
func (e *MultiFactorRemovedEvent) CheckPrevious() bool {
return true
}
func (e *MultiFactorRemovedEvent) Data() interface{} {
return e
}

View File

@@ -2,12 +2,12 @@ package factors
import "github.com/caos/zitadel/internal/eventstore/v2"
type SecondFactoryWriteModel struct {
type SecondFactorWriteModel struct {
eventstore.WriteModel
MFAType SecondFactorType
}
func (wm *SecondFactoryWriteModel) Reduce() error {
func (wm *SecondFactorWriteModel) Reduce() error {
for _, event := range wm.Events {
switch e := event.(type) {
case *SecondFactorAddedEvent:

View File

@@ -18,10 +18,6 @@ type AddedEvent struct {
UserLoginMustBeDomain bool `json:"userLoginMustBeDomain"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -56,10 +52,6 @@ type ChangedEvent struct {
UserLoginMustBeDomain bool `json:"userLoginMustBeDomain"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}

View File

@@ -20,10 +20,6 @@ type AddedEvent struct {
MaxAgeDays uint64 `json:"maxAgeDays"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -61,10 +57,6 @@ type ChangedEvent struct {
MaxAgeDays uint64 `json:"maxAgeDays,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -107,10 +99,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}

View File

@@ -23,10 +23,6 @@ type AddedEvent struct {
HasSymbol bool `json:"hasSymbol"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -72,10 +68,6 @@ type ChangedEvent struct {
HasSymbol bool `json:"hasSymbol"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -130,10 +122,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}

View File

@@ -20,10 +20,6 @@ type AddedEvent struct {
ShowLockOutFailures bool `json:"showLockOutFailures"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -61,10 +57,6 @@ type ChangedEvent struct {
ShowLockOutFailures bool `json:"showLockOutFailures,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -107,10 +99,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}