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
+3 -4
View File
@@ -15,9 +15,8 @@ type WriteModel struct {
//AppendEvents adds all the events to the read model.
// The function doesn't compute the new state of the read model
func (rm *WriteModel) AppendEvents(events ...EventReader) *WriteModel {
func (rm *WriteModel) AppendEvents(events ...EventReader) {
rm.Events = append(rm.Events, events...)
return rm
}
//Reduce is the basic implementaion of reducer
@@ -28,10 +27,10 @@ func (wm *WriteModel) Reduce() error {
}
if wm.AggregateID == "" {
wm.AggregateID = wm.Events[0].AggregateID()
wm.AggregateID = wm.Events[0].Aggregate().ID
}
if wm.ResourceOwner == "" {
wm.ResourceOwner = wm.Events[0].ResourceOwner()
wm.ResourceOwner = wm.Events[0].Aggregate().ResourceOwner
}
wm.ProcessedSequence = wm.Events[len(wm.Events)-1].Sequence()