Skip to content

Commit

Permalink
Add Recipient to user in GetCorrespondenceHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
CelineTrammi committed Oct 30, 2024
1 parent 9fa181f commit 0313740
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,19 @@ public async Task<OneOf<LegacyGetCorrespondenceHistoryResponse, Error>> Process(

if (notificationDetails.NotificationsStatusDetails.Sms is not null)
{
notificationHistory.Add(GetNotificationStatus(notificationDetails.NotificationsStatusDetails.Sms.SendStatus, notification.IsReminder, senderParty.PartyId.ToString()));
notificationHistory.Add(GetNotificationStatus(
notificationDetails.NotificationsStatusDetails.Sms.SendStatus,
notificationDetails.NotificationsStatusDetails.Sms.Recipient,
notification.IsReminder,
senderParty.PartyId.ToString()));
}
if (notificationDetails.NotificationsStatusDetails.Email is not null)
{
notificationHistory.Add(GetNotificationStatus(notificationDetails.NotificationsStatusDetails.Email.SendStatus, notification.IsReminder, senderParty.PartyId.ToString()));
notificationHistory.Add(GetNotificationStatus(
notificationDetails.NotificationsStatusDetails.Email.SendStatus,
notificationDetails.NotificationsStatusDetails.Email.Recipient,
notification.IsReminder,
senderParty.PartyId.ToString()));
}
}

Expand All @@ -82,7 +90,7 @@ public async Task<OneOf<LegacyGetCorrespondenceHistoryResponse, Error>> Process(
return legacyHistory;
}

private static LegacyCorrespondenceStatus GetNotificationStatus(StatusExt sendStatus, bool isReminder, string partyId)
private static LegacyCorrespondenceStatus GetNotificationStatus(StatusExt sendStatus, Recipient recipient, bool isReminder, string partyId)
{
return new LegacyCorrespondenceStatus
{
Expand All @@ -93,6 +101,7 @@ private static LegacyCorrespondenceStatus GetNotificationStatus(StatusExt sendSt
{
PartyId = partyId,
AuthenticationLevel = 0, // TODO: Get authentication level
Recipient = recipient
},
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Altinn.Correspondence.Core.Models.Notifications;

namespace Altinn.Correspondence.Application.GetCorrespondenceHistory;

public class LegacyGetCorrespondenceHistoryResponse
Expand All @@ -11,11 +13,11 @@ public class LegacyCorrespondenceStatus
public string Status { get; set; }
public DateTimeOffset? StatusChanged { get; set; }
public string StatusText { get; set; }

public LegacyUser User { get; set; }
}
public class LegacyUser
{
public string PartyId { get; set; }
public int AuthenticationLevel { get; set; }
public Recipient Recipient { get; set; }
}

0 comments on commit 0313740

Please sign in to comment.