fix(sms): reject notification-list Type change on update (S6 review follow-up)

This commit is contained in:
Joseph Doherty
2026-06-19 10:51:58 -04:00
parent 58ac06a358
commit 538117d114
2 changed files with 65 additions and 2 deletions
@@ -1701,8 +1701,9 @@ public class ManagementActor : ReceiveActor
var repo = sp.GetRequiredService<INotificationRepository>();
var list = await repo.GetNotificationListByIdAsync(cmd.NotificationListId)
?? throw new ManagementCommandException($"NotificationList with ID {cmd.NotificationListId} not found.");
if (list.Type != cmd.Type)
throw new ManagementCommandException("A notification list's Type cannot be changed after creation.");
list.Name = cmd.Name;
list.Type = cmd.Type;
var existingRecipients = await repo.GetRecipientsByListIdAsync(cmd.NotificationListId);
foreach (var r in existingRecipients)