fix: push events (#1262)

* fix: push events instead of aggregates

* fix: tests

* try without aggregate methods and with aggregate methods

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: change push aggregate to push events

* fix: client secret

* fix: query eventtypes

* fix: query eventtypes

* fix: eventstore index

* fix: index

* fix: merge new eventstore

* fix: remove unnecessary todos

* fix: remove unnecessary todos

Co-authored-by: Fabiennne <[email protected]>
This commit is contained in:
Silvan
2021-02-18 14:48:27 +01:00
committed by GitHub
co-authored by Fabiennne
parent 027a6386c0
commit 00fec8830a
187 changed files with 2998 additions and 2159 deletions
+37 -5
View File
@@ -49,10 +49,17 @@ func (e *ApplicationAddedEvent) UniqueConstraints() []*eventstore.EventUniqueCon
return []*eventstore.EventUniqueConstraint{NewAddApplicationUniqueConstraint(e.Name, e.projectID)}
}
func NewApplicationAddedEvent(ctx context.Context, appID, name, projectID string) *ApplicationAddedEvent {
func NewApplicationAddedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
appID,
name,
projectID string,
) *ApplicationAddedEvent {
return &ApplicationAddedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
ApplicationAddedType,
),
AppID: appID,
@@ -94,10 +101,18 @@ func (e *ApplicationChangedEvent) UniqueConstraints() []*eventstore.EventUniqueC
}
}
func NewApplicationChangedEvent(ctx context.Context, appID, oldName, newName, projectID string) *ApplicationChangedEvent {
func NewApplicationChangedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
appID,
oldName,
newName,
projectID string,
) *ApplicationChangedEvent {
return &ApplicationChangedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
ApplicationChangedType,
),
AppID: appID,
@@ -134,10 +149,15 @@ func (e *ApplicationDeactivatedEvent) UniqueConstraints() []*eventstore.EventUni
return nil
}
func NewApplicationDeactivatedEvent(ctx context.Context, appID string) *ApplicationDeactivatedEvent {
func NewApplicationDeactivatedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
appID string,
) *ApplicationDeactivatedEvent {
return &ApplicationDeactivatedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
ApplicationDeactivatedType,
),
AppID: appID,
@@ -171,10 +191,15 @@ func (e *ApplicationReactivatedEvent) UniqueConstraints() []*eventstore.EventUni
return nil
}
func NewApplicationReactivatedEvent(ctx context.Context, appID string) *ApplicationReactivatedEvent {
func NewApplicationReactivatedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
appID string,
) *ApplicationReactivatedEvent {
return &ApplicationReactivatedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
ApplicationReactivatedType,
),
AppID: appID,
@@ -210,10 +235,17 @@ func (e *ApplicationRemovedEvent) UniqueConstraints() []*eventstore.EventUniqueC
return []*eventstore.EventUniqueConstraint{NewRemoveApplicationUniqueConstraint(e.name, e.projectID)}
}
func NewApplicationRemovedEvent(ctx context.Context, appID, name, projectID string) *ApplicationRemovedEvent {
func NewApplicationRemovedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
appID,
name,
projectID string,
) *ApplicationRemovedEvent {
return &ApplicationRemovedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
ApplicationRemovedType,
),
AppID: appID,