-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new notification features * current progress * app building after merge * appsettings from main * currently running ok. Add missing functionality for lookup * notification to org and person with resource working * Update EmailNotificationOrdersController.cs
- Loading branch information
Showing
98 changed files
with
1,682 additions
and
697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Altinn.Notifications.Extensions; | ||
|
||
/// <summary> | ||
/// Extensions for HTTP Context | ||
/// </summary> | ||
public static class HttpContextExtensions | ||
{ | ||
/// <summary> | ||
/// Get the org string from the context items or null if it is not defined | ||
/// </summary> | ||
public static string? GetOrg(this HttpContext context) | ||
{ | ||
return context.Items["Org"] as string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Notifications/API/Mappers/NotificationOrderRequestResponseMapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Altinn.Notifications.Core.Models.Orders; | ||
using Altinn.Notifications.Models; | ||
|
||
namespace Altinn.Notifications.Mappers; | ||
|
||
/// <summary> | ||
/// Mapper class | ||
/// </summary> | ||
public static class NotificationOrderRequestResponseMapper | ||
{ | ||
/// <summary> | ||
/// Maps a <see cref="NotificationOrderRequestResponse"/> to a <see cref="NotificationOrderRequestResponseExt"/> | ||
/// </summary> | ||
public static NotificationOrderRequestResponseExt MapToExternal(this NotificationOrderRequestResponse requestResponse) | ||
{ | ||
NotificationOrderRequestResponseExt ext = new() | ||
{ | ||
OrderId = requestResponse.OrderId | ||
}; | ||
|
||
if (requestResponse.RecipientLookup != null) | ||
{ | ||
ext.RecipientLookup = new RecipientLookupResultExt | ||
{ | ||
Status = Enum.Parse<RecipientLookupStatusExt>(requestResponse.RecipientLookup.Status.ToString(), true), | ||
IsReserved = requestResponse.RecipientLookup?.IsReserved, | ||
MissingContact = requestResponse.RecipientLookup?.MissingContact, | ||
}; | ||
} | ||
|
||
return ext; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Altinn.Notifications.Models; | ||
|
||
/// <summary> | ||
/// A class representing the base properties of a registered notification order. | ||
/// </summary> | ||
/// <remarks> | ||
/// External representaion to be used in the API. | ||
/// </remarks> | ||
public class BaseNotificationOrderExt | ||
{ | ||
/// <summary> | ||
/// Gets or sets the id of the notification order | ||
/// </summary> | ||
[JsonPropertyName("id")] | ||
public string Id { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// Gets or sets the senders reference of the notification | ||
/// </summary> | ||
[JsonPropertyName("sendersReference")] | ||
public string? SendersReference { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the requested send time of the notification | ||
/// </summary> | ||
[JsonPropertyName("requestedSendTime")] | ||
public DateTime RequestedSendTime { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the short name of the creator of the notification order | ||
/// </summary> | ||
[JsonPropertyName("creator")] | ||
public string Creator { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// Gets or sets the date and time of when the notification order was created | ||
/// </summary> | ||
[JsonPropertyName("created")] | ||
public DateTime Created { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the preferred notification channel of the notification order | ||
/// </summary> | ||
[JsonPropertyName("notificationChannel")] | ||
[JsonConverter(typeof(JsonStringEnumConverter))] | ||
public NotificationChannelExt NotificationChannel { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets whether notifications generated by this order should ignore KRR reservations | ||
/// </summary> | ||
[JsonPropertyName("ignoreReservation")] | ||
public bool? IgnoreReservation { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the id of the resource that the notification is related to | ||
/// </summary> | ||
[JsonPropertyName("resourceId")] | ||
public string? ResourceId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.