fix: handle org de-/reactivate correctly (#3924)

This commit is contained in:
Livio Spring 2022-07-07 15:13:17 +02:00 committed by GitHub
parent 9271623ec9
commit 6463b716ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,8 @@ func (wm *OrgWriteModel) Reduce() error {
wm.State = domain.OrgStateInactive
case *org.OrgReactivatedEvent:
wm.State = domain.OrgStateActive
case *org.OrgRemovedEvent:
wm.State = domain.OrgStateRemoved
case *org.OrgChangedEvent:
wm.Name = e.Name
case *org.DomainPrimarySetEvent:
@ -51,6 +53,9 @@ func (wm *OrgWriteModel) Query() *eventstore.SearchQueryBuilder {
EventTypes(
org.OrgAddedEventType,
org.OrgChangedEventType,
org.OrgDeactivatedEventType,
org.OrgReactivatedEventType,
org.OrgRemovedEventType,
org.OrgDomainPrimarySetEventType).
Builder()
}