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
-36
View File
@@ -26,10 +26,6 @@ type LockedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *LockedEvent) CheckPrevious() bool {
return true
}
func (e *LockedEvent) Data() interface{} {
return nil
}
@@ -53,10 +49,6 @@ type UnlockedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *UnlockedEvent) CheckPrevious() bool {
return true
}
func (e *UnlockedEvent) Data() interface{} {
return nil
}
@@ -80,10 +72,6 @@ type DeactivatedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *DeactivatedEvent) CheckPrevious() bool {
return true
}
func (e *DeactivatedEvent) Data() interface{} {
return nil
}
@@ -107,10 +95,6 @@ type ReactivatedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *ReactivatedEvent) CheckPrevious() bool {
return true
}
func (e *ReactivatedEvent) Data() interface{} {
return nil
}
@@ -134,10 +118,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}
@@ -169,10 +149,6 @@ type TokenAddedEvent struct {
PreferredLanguage string `json:"preferredLanguage"`
}
func (e *TokenAddedEvent) CheckPrevious() bool {
return false
}
func (e *TokenAddedEvent) Data() interface{} {
return e
}
@@ -219,10 +195,6 @@ type DomainClaimedEvent struct {
UserName string `json:"userName"`
}
func (e *DomainClaimedEvent) CheckPrevious() bool {
return false
}
func (e *DomainClaimedEvent) Data() interface{} {
return e
}
@@ -256,10 +228,6 @@ type DomainClaimedSentEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *DomainClaimedSentEvent) CheckPrevious() bool {
return false
}
func (e *DomainClaimedSentEvent) Data() interface{} {
return nil
}
@@ -287,10 +255,6 @@ type UsernameChangedEvent struct {
UserName string `json:"userName"`
}
func (e *UsernameChangedEvent) CheckPrevious() bool {
return false
}
func (e *UsernameChangedEvent) Data() interface{} {
return e
}
@@ -23,10 +23,6 @@ type ChangedEvent struct {
StreetAddress string `json:"streetAddress,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -25,10 +25,6 @@ type ChangedEvent struct {
EmailAddress string `json:"email,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -68,10 +64,6 @@ type VerifiedEvent struct {
IsEmailVerified bool `json:"-"`
}
func (e *VerifiedEvent) CheckPrevious() bool {
return true
}
func (e *VerifiedEvent) Data() interface{} {
return nil
}
@@ -97,10 +89,6 @@ type VerificationFailedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *VerificationFailedEvent) CheckPrevious() bool {
return false
}
func (e *VerificationFailedEvent) Data() interface{} {
return nil
}
@@ -127,10 +115,6 @@ type CodeAddedEvent struct {
Expiry time.Duration `json:"expiry,omitempty"`
}
func (e *CodeAddedEvent) CheckPrevious() bool {
return true
}
func (e *CodeAddedEvent) Data() interface{} {
return e
}
@@ -165,10 +149,6 @@ type CodeSentEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CodeSentEvent) CheckPrevious() bool {
return true
}
func (e *CodeSentEvent) Data() interface{} {
return nil
}
@@ -45,10 +45,6 @@ type AddedEvent struct {
StreetAddress string `json:"streetAddress,omitempty"`
}
func (e *AddedEvent) CheckPrevious() bool {
return false
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -127,10 +123,6 @@ type RegisteredEvent struct {
StreetAddress string `json:"streetAddress,omitempty"`
}
func (e *RegisteredEvent) CheckPrevious() bool {
return false
}
func (e *RegisteredEvent) Data() interface{} {
return e
}
@@ -192,10 +184,6 @@ type InitialCodeAddedEvent struct {
Expiry time.Duration `json:"expiry,omitempty"`
}
func (e *InitialCodeAddedEvent) CheckPrevious() bool {
return true
}
func (e *InitialCodeAddedEvent) Data() interface{} {
return e
}
@@ -231,10 +219,6 @@ type InitialCodeSentEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *InitialCodeSentEvent) CheckPrevious() bool {
return false
}
func (e *InitialCodeSentEvent) Data() interface{} {
return nil
}
@@ -258,10 +242,6 @@ type InitializedCheckSucceededEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *InitializedCheckSucceededEvent) CheckPrevious() bool {
return false
}
func (e *InitializedCheckSucceededEvent) Data() interface{} {
return nil
}
@@ -285,10 +265,6 @@ type InitializedCheckFailedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *InitializedCheckFailedEvent) CheckPrevious() bool {
return false
}
func (e *InitializedCheckFailedEvent) Data() interface{} {
return nil
}
@@ -312,10 +288,6 @@ type SignedOutEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *SignedOutEvent) CheckPrevious() bool {
return false
}
func (e *SignedOutEvent) Data() interface{} {
return nil
}
@@ -27,10 +27,6 @@ type ReservedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *ReservedEvent) CheckPrevious() bool {
return true
}
func (e *ReservedEvent) Data() interface{} {
return nil
}
@@ -48,10 +44,6 @@ type ReleasedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *ReleasedEvent) CheckPrevious() bool {
return true
}
func (e *ReleasedEvent) Data() interface{} {
return nil
}
@@ -72,10 +64,6 @@ type AddedEvent struct {
DisplayName string `json:"displayName,omitempty"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -110,10 +98,6 @@ type RemovedEvent struct {
IDPConfigID string `json:"idpConfigId"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return e
}
@@ -147,10 +131,6 @@ type CascadeRemovedEvent struct {
IDPConfigID string `json:"idpConfigId"`
}
func (e *CascadeRemovedEvent) CheckPrevious() bool {
return false
}
func (e *CascadeRemovedEvent) Data() interface{} {
return e
}
@@ -182,10 +162,6 @@ type CheckSucceededEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CheckSucceededEvent) CheckPrevious() bool {
return false
}
func (e *CheckSucceededEvent) Data() interface{} {
return nil
}
@@ -15,10 +15,6 @@ type InitSkippedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *InitSkippedEvent) CheckPrevious() bool {
return true
}
func (e *InitSkippedEvent) Data() interface{} {
return e
}
@@ -26,10 +26,6 @@ type AddedEvent struct {
State mfa.State `json:"-"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -62,10 +58,6 @@ type VerifiedEvent struct {
State mfa.State `json:"-"`
}
func (e *VerifiedEvent) CheckPrevious() bool {
return true
}
func (e *VerifiedEvent) Data() interface{} {
return nil
}
@@ -90,10 +82,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}
@@ -117,10 +105,6 @@ type CheckSucceededEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CheckSucceededEvent) CheckPrevious() bool {
return false
}
func (e *CheckSucceededEvent) Data() interface{} {
return nil
}
@@ -144,10 +128,6 @@ type CheckFailedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CheckFailedEvent) CheckPrevious() bool {
return false
}
func (e *CheckFailedEvent) Data() interface{} {
return nil
}
@@ -37,10 +37,6 @@ type AddedEvent struct {
State mfa.State `json:"-"`
}
func (e *AddedEvent) CheckPrevious() bool {
return true
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -100,10 +96,6 @@ type VerifiedEvent struct {
State mfa.State `json:"-"`
}
func (e *VerifiedEvent) CheckPrevious() bool {
return true
}
func (e *VerifiedEvent) Data() interface{} {
return e
}
@@ -178,10 +170,6 @@ type SignCountChangedEvent struct {
State mfa.State `json:"-"`
}
func (e *SignCountChangedEvent) CheckPrevious() bool {
return true
}
func (e *SignCountChangedEvent) Data() interface{} {
return e
}
@@ -234,10 +222,6 @@ type RemovedEvent struct {
State mfa.State `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return e
}
@@ -288,10 +272,6 @@ type BeginLoginEvent struct {
//*AuthRequest
}
func (e *BeginLoginEvent) CheckPrevious() bool {
return true
}
func (e *BeginLoginEvent) Data() interface{} {
return e
}
@@ -344,10 +324,6 @@ type CheckSucceededEvent struct {
//*AuthRequest
}
func (e *CheckSucceededEvent) CheckPrevious() bool {
return true
}
func (e *CheckSucceededEvent) Data() interface{} {
return e
}
@@ -388,10 +364,6 @@ type CheckFailedEvent struct {
//*AuthRequest
}
func (e *CheckFailedEvent) CheckPrevious() bool {
return true
}
func (e *CheckFailedEvent) Data() interface{} {
return e
}
@@ -27,10 +27,6 @@ type ChangedEvent struct {
ChangeRequired bool `json:"changeRequired,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return false
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -70,10 +66,6 @@ type CodeAddedEvent struct {
NotificationType human.NotificationType `json:"notificationType,omitempty"`
}
func (e *CodeAddedEvent) CheckPrevious() bool {
return false
}
func (e *CodeAddedEvent) Data() interface{} {
return e
}
@@ -111,10 +103,6 @@ type CodeSentEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CodeSentEvent) CheckPrevious() bool {
return false
}
func (e *CodeSentEvent) Data() interface{} {
return nil
}
@@ -138,10 +126,6 @@ type CheckSucceededEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CheckSucceededEvent) CheckPrevious() bool {
return false
}
func (e *CheckSucceededEvent) Data() interface{} {
return nil
}
@@ -165,10 +149,6 @@ type CheckFailedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CheckFailedEvent) CheckPrevious() bool {
return false
}
func (e *CheckFailedEvent) Data() interface{} {
return nil
}
@@ -26,10 +26,6 @@ type ChangedEvent struct {
PhoneNumber string `json:"phone,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -60,10 +56,6 @@ type RemovedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return true
}
func (e *RemovedEvent) Data() interface{} {
return nil
}
@@ -89,10 +81,6 @@ type VerifiedEvent struct {
IsPhoneVerified bool `json:"-"`
}
func (e *VerifiedEvent) CheckPrevious() bool {
return true
}
func (e *VerifiedEvent) Data() interface{} {
return nil
}
@@ -117,10 +105,6 @@ type VerificationFailedEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *VerificationFailedEvent) CheckPrevious() bool {
return true
}
func (e *VerificationFailedEvent) Data() interface{} {
return nil
}
@@ -147,10 +131,6 @@ type CodeAddedEvent struct {
Expiry time.Duration `json:"expiry,omitempty"`
}
func (e *CodeAddedEvent) CheckPrevious() bool {
return true
}
func (e *CodeAddedEvent) Data() interface{} {
return e
}
@@ -186,10 +166,6 @@ type CodeSentEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *CodeSentEvent) CheckPrevious() bool {
return false
}
func (e *CodeSentEvent) Data() interface{} {
return e
}
@@ -26,10 +26,6 @@ type ChangedEvent struct {
Gender human.Gender `json:"gender,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return true
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -23,10 +23,6 @@ type AddedEvent struct {
Description string `json:"description,omitempty"`
}
func (e *AddedEvent) CheckPrevious() bool {
return false
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -69,10 +65,6 @@ type ChangedEvent struct {
Description string `json:"description,omitempty"`
}
func (e *ChangedEvent) CheckPrevious() bool {
return false
}
func (e *ChangedEvent) Data() interface{} {
return e
}
@@ -24,10 +24,6 @@ type AddedEvent struct {
PublicKey []byte `json:"publicKey,omitempty"`
}
func (e *AddedEvent) CheckPrevious() bool {
return false
}
func (e *AddedEvent) Data() interface{} {
return e
}
@@ -69,10 +65,6 @@ type RemovedEvent struct {
KeyID string `json:"keyId,omitempty"`
}
func (e *RemovedEvent) CheckPrevious() bool {
return false
}
func (e *RemovedEvent) Data() interface{} {
return e
}