Skip to content

Commit

Permalink
Fix the properties on UserMergedMessage - they were backwards (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Mar 7, 2024
1 parent eaab6df commit f3709f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ public record UserMergedMessage : INotificationMessage
public const string MessageTypeName = "UserMerged";

public required Guid MergedUserId { get; init; }
public required User MasterUser { get; init; }
public required Guid MasterUserId { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ private static IEnumerable<NotificationEnvelope> GetNotificationsForEvent(EventB
NotificationId = Guid.NewGuid(),
Message = new UserMergedMessage()
{
MasterUser = userMerged.User,
MergedUserId = userMerged.MergedWithUserId
MasterUserId = userMerged.MergedWithUserId,
MergedUserId = userMerged.User.UserId
},
MessageType = UserMergedMessage.MessageTypeName,
TimeUtc = userMerged.CreatedUtc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public async Task UserMerged_WhenPublished_IsOnlySentToWebHookEndpointsWhichSubs
NotificationId = Guid.NewGuid(),
Message = new UserMergedMessage()
{
MasterUser = user,
MasterUserId = user.UserId,
MergedUserId = mergedUserId
},
MessageType = UserMergedMessage.MessageTypeName,
Expand All @@ -408,19 +408,7 @@ public async Task UserMerged_WhenPublished_IsOnlySentToWebHookEndpointsWhichSubs
notificationId = userCreatedNotification.NotificationId,
message = new
{
masterUser = new
{
userId = user.UserId,
dateOfBirth = user.DateOfBirth,
emailAddress = user.EmailAddress,
firstName = user.FirstName,
middleName = user.MiddleName,
lastName = user.LastName,
preferredName = user.PreferredName,
mobileNumber = user.MobileNumber,
trn = user.Trn,
trnLookupStatus = user.TrnLookupStatus.ToString()
},
masterUserId = user.UserId,
mergedUserId = mergedUserId
},
messageType = UserMergedMessage.MessageTypeName,
Expand Down

0 comments on commit f3709f8

Please sign in to comment.