Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure property order for NotificationOrderExt models #537

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Altinn.Notifications/Models/BaseNotificationOrderExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,56 @@ public class BaseNotificationOrderExt
/// Gets or sets the id of the notification order
/// </summary>
[JsonPropertyName("id")]
[JsonPropertyOrder(1)]
public string Id { get; set; } = string.Empty;

/// <summary>
/// Gets or sets the senders reference of the notification
/// </summary>
[JsonPropertyName("sendersReference")]
[JsonPropertyOrder(2)]
public string? SendersReference { get; set; }

/// <summary>
/// Gets or sets the requested send time of the notification
/// </summary>
[JsonPropertyName("requestedSendTime")]
[JsonPropertyOrder(3)]
public DateTime RequestedSendTime { get; set; }

/// <summary>
/// Gets or sets the short name of the creator of the notification order
/// </summary>
[JsonPropertyName("creator")]
[JsonPropertyOrder(4)]
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")]
[JsonPropertyOrder(5)]
public DateTime Created { get; set; }

/// <summary>
/// Gets or sets the preferred notification channel of the notification order
/// </summary>
[JsonPropertyName("notificationChannel")]
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonPropertyOrder(6)]
public NotificationChannelExt NotificationChannel { get; set; }

/// <summary>
/// Gets or sets whether notifications generated by this order should ignore KRR reservations
/// </summary>
[JsonPropertyName("ignoreReservation")]
[JsonPropertyOrder(7)]
public bool? IgnoreReservation { get; set; }

/// <summary>
/// Gets or sets the id of the resource that the notification is related to
/// </summary>
[JsonPropertyName("resourceId")]
[JsonPropertyOrder(8)]
public string? ResourceId { get; set; }
}
4 changes: 4 additions & 0 deletions src/Altinn.Notifications/Models/NotificationOrderExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,27 @@ public class NotificationOrderExt : BaseNotificationOrderExt
/// Gets or sets the list of recipients
/// </summary>
[JsonPropertyName("recipients")]
[JsonPropertyOrder(9)]
public List<RecipientExt> Recipients { get; set; } = new List<RecipientExt>();

/// <summary>
/// Gets or sets the emailTemplate
/// </summary>
[JsonPropertyName("emailTemplate")]
[JsonPropertyOrder(10)]
public EmailTemplateExt? EmailTemplate { get; set; }

/// <summary>
/// Gets or sets the smsTemplate
/// </summary>
[JsonPropertyName("smsTemplate")]
[JsonPropertyOrder(11)]
public SmsTemplateExt? SmsTemplate { get; set; }

/// <summary>
/// Gets or sets the link of the order
/// </summary>
[JsonPropertyName("links")]
[JsonPropertyOrder(12)]
public OrderResourceLinksExt Links { get; set; } = new OrderResourceLinksExt();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ public class NotificationOrderWithStatusExt : BaseNotificationOrderExt
/// Gets or sets the processing status of the notication order
/// </summary>
[JsonPropertyName("processingStatus")]
[JsonPropertyOrder(9)]
public StatusExt ProcessingStatus { get; set; } = new();

/// <summary>
/// Gets or sets the summary of the notifiications statuses
/// </summary>
[JsonPropertyName("notificationsStatusSummary")]
[JsonPropertyOrder(10)]
public NotificationsStatusSummaryExt? NotificationsStatusSummary { get; set; }
}
Loading