From a9f71ba08e9e46ee40f3ca6bb90e80e0f1b680f3 Mon Sep 17 00:00:00 2001 From: Silvan Date: Mon, 2 May 2022 11:06:30 +0200 Subject: [PATCH] fix(command): reset phone on phone write model to empty if removed (#3543) --- internal/command/user_human_phone_model.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/command/user_human_phone_model.go b/internal/command/user_human_phone_model.go index 5d4b52841f..17b0ae3757 100644 --- a/internal/command/user_human_phone_model.go +++ b/internal/command/user_human_phone_model.go @@ -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()