fix(command): reset phone on phone write model to empty if removed (#3543)

This commit is contained in:
Silvan 2022-05-02 11:06:30 +02:00 committed by GitHub
parent 8e7f73c6a6
commit a9f71ba08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,8 +67,12 @@ func (wm *HumanPhoneWriteModel) Reduce() error {
wm.CodeExpiry = e.Expiry
case *user.HumanPhoneRemovedEvent:
wm.State = domain.PhoneStateRemoved
wm.IsPhoneVerified = false
wm.Phone = ""
case *user.UserRemovedEvent:
wm.UserState = domain.UserStateDeleted
wm.IsPhoneVerified = false
wm.Phone = ""
}
}
return wm.WriteModel.Reduce()