mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-20 03:48:47 +00:00
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:
@@ -32,10 +32,6 @@ func NewHumanProfileWriteModel(userID, resourceOwner string) *HumanProfileWriteM
|
||||
}
|
||||
}
|
||||
|
||||
func (wm *HumanProfileWriteModel) AppendEvents(events ...eventstore.EventReader) {
|
||||
wm.WriteModel.AppendEvents(events...)
|
||||
}
|
||||
|
||||
func (wm *HumanProfileWriteModel) Reduce() error {
|
||||
for _, event := range wm.Events {
|
||||
switch e := event.(type) {
|
||||
@@ -84,7 +80,11 @@ func (wm *HumanProfileWriteModel) Reduce() error {
|
||||
func (wm *HumanProfileWriteModel) Query() *eventstore.SearchQueryBuilder {
|
||||
return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent, user.AggregateType).
|
||||
AggregateIDs(wm.AggregateID).
|
||||
ResourceOwner(wm.ResourceOwner)
|
||||
ResourceOwner(wm.ResourceOwner).
|
||||
EventTypes(user.HumanAddedType,
|
||||
user.HumanRegisteredType,
|
||||
user.HumanProfileChangedType,
|
||||
user.UserRemovedType)
|
||||
}
|
||||
|
||||
func (wm *HumanProfileWriteModel) NewChangedEvent(
|
||||
@@ -97,7 +97,7 @@ func (wm *HumanProfileWriteModel) NewChangedEvent(
|
||||
gender domain.Gender,
|
||||
) (*user.HumanProfileChangedEvent, bool) {
|
||||
hasChanged := false
|
||||
changedEvent := user.NewHumanProfileChangedEvent(ctx)
|
||||
changedEvent := user.NewHumanProfileChangedEvent(ctx, UserAggregateFromWriteModel(&wm.WriteModel))
|
||||
if wm.FirstName != firstName {
|
||||
hasChanged = true
|
||||
changedEvent.FirstName = firstName
|
||||
|
||||
Reference in New Issue
Block a user