fix: payload (de)serialization of some events (#6858)

This commit is contained in:
Livio Spring 2023-11-03 13:02:17 +02:00 committed by GitHub
parent 585c8af5f2
commit 9378e19090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 11 deletions

View File

@ -17,7 +17,7 @@ const (
) )
type AddedEvent struct { type AddedEvent struct {
*eventstore.BaseEvent *eventstore.BaseEvent `json:"-"`
ClientID string ClientID string
DeviceCode string DeviceCode string
@ -56,7 +56,7 @@ func NewAddedEvent(
} }
type ApprovedEvent struct { type ApprovedEvent struct {
*eventstore.BaseEvent *eventstore.BaseEvent `json:"-"`
Subject string Subject string
} }
@ -87,7 +87,8 @@ func NewApprovedEvent(
} }
type CanceledEvent struct { type CanceledEvent struct {
*eventstore.BaseEvent *eventstore.BaseEvent `json:"-"`
Reason domain.DeviceAuthCanceled Reason domain.DeviceAuthCanceled
} }
@ -108,7 +109,7 @@ func NewCanceledEvent(ctx context.Context, aggregate *eventstore.Aggregate, reas
} }
type RemovedEvent struct { type RemovedEvent struct {
*eventstore.BaseEvent *eventstore.BaseEvent `json:"-"`
ClientID string ClientID string
DeviceCode string DeviceCode string

View File

@ -17,7 +17,7 @@ func EventTypeFromFeature(feature domain.Feature) eventstore.EventType {
} }
type SetEvent[T SetEventType] struct { type SetEvent[T SetEventType] struct {
*eventstore.BaseEvent *eventstore.BaseEvent `json:"-"`
Value T Value T
} }

View File

@ -15,7 +15,7 @@ const (
) )
type TriggerActionsSetEvent struct { type TriggerActionsSetEvent struct {
eventstore.BaseEvent eventstore.BaseEvent `json:"-"`
FlowType domain.FlowType `json:"flowType"` FlowType domain.FlowType `json:"flowType"`
TriggerType domain.TriggerType `json:"triggerType"` TriggerType domain.TriggerType `json:"triggerType"`
@ -58,7 +58,7 @@ func TriggerActionsSetEventMapper(event eventstore.Event) (eventstore.Event, err
} }
type TriggerActionsCascadeRemovedEvent struct { type TriggerActionsCascadeRemovedEvent struct {
eventstore.BaseEvent eventstore.BaseEvent `json:"-"`
FlowType domain.FlowType `json:"flowType"` FlowType domain.FlowType `json:"flowType"`
TriggerType domain.TriggerType `json:"triggerType"` TriggerType domain.TriggerType `json:"triggerType"`
@ -99,7 +99,7 @@ func TriggerActionsCascadeRemovedEventMapper(event eventstore.Event) (eventstore
} }
type FlowClearedEvent struct { type FlowClearedEvent struct {
eventstore.BaseEvent eventstore.BaseEvent `json:"-"`
FlowType domain.FlowType `json:"flowType"` FlowType domain.FlowType `json:"flowType"`
} }

View File

@ -14,7 +14,7 @@ const (
) )
type IdentityProviderAddedEvent struct { type IdentityProviderAddedEvent struct {
eventstore.BaseEvent eventstore.BaseEvent `json:"-"`
IDPConfigID string `json:"idpConfigId,omitempty"` IDPConfigID string `json:"idpConfigId,omitempty"`
IDPProviderType domain.IdentityProviderType `json:"idpProviderType,omitempty"` IDPProviderType domain.IdentityProviderType `json:"idpProviderType,omitempty"`
@ -55,7 +55,7 @@ func IdentityProviderAddedEventMapper(event eventstore.Event) (eventstore.Event,
} }
type IdentityProviderRemovedEvent struct { type IdentityProviderRemovedEvent struct {
eventstore.BaseEvent eventstore.BaseEvent `json:"-"`
IDPConfigID string `json:"idpConfigId"` IDPConfigID string `json:"idpConfigId"`
} }
@ -92,7 +92,7 @@ func IdentityProviderRemovedEventMapper(event eventstore.Event) (eventstore.Even
} }
type IdentityProviderCascadeRemovedEvent struct { type IdentityProviderCascadeRemovedEvent struct {
eventstore.BaseEvent eventstore.BaseEvent `json:"-"`
IDPConfigID string `json:"idpConfigId"` IDPConfigID string `json:"idpConfigId"`
} }