-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docstrings and move classes into separate model files (#553)
* minor changes in docstring * separate classes into dedicated files for ext models
- Loading branch information
1 parent
67a878a
commit a5d7f15
Showing
5 changed files
with
95 additions
and
45 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
44 changes: 10 additions & 34 deletions
44
src/Altinn.Correspondence.API/Models/InitializeCorrespondencesResponseExt.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 |
---|---|---|
@@ -1,45 +1,21 @@ | ||
using System.Text.Json.Serialization; | ||
using Altinn.Correspondence.API.Models.Enums; | ||
|
||
namespace Altinn.Correspondence.API.Models; | ||
|
||
/// <summary> | ||
/// Response object for initializing correspondences. Contains information about the created correspondences and their attachments. | ||
/// </summary> | ||
public class InitializeCorrespondencesResponseExt | ||
{ | ||
/// <summary> | ||
/// The initialized correspondences | ||
/// </summary> | ||
[JsonPropertyName("correspondences")] | ||
public List<InitializedCorrespondencesExt> Correspondences { get; set; } | ||
|
||
/// <summary> | ||
/// The IDs of the attachments that were included with the correspondences | ||
/// </summary> | ||
[JsonPropertyName("attachmentIds")] | ||
public List<Guid> AttachmentIds { get; set; } | ||
} | ||
|
||
|
||
public class InitializedCorrespondencesExt | ||
{ | ||
[JsonPropertyName("correspondenceId")] | ||
public Guid CorrespondenceId { get; set; } | ||
|
||
[JsonPropertyName("status")] | ||
public CorrespondenceStatusExt Status { get; set; } | ||
|
||
[JsonPropertyName("recipient")] | ||
public required string Recipient { get; set; } | ||
|
||
[JsonPropertyName("notifications")] | ||
public List<InitializedCorrespondencesNotificationsExt>? Notifications { get; set; } | ||
} | ||
public class InitializedCorrespondencesNotificationsExt | ||
{ | ||
[JsonPropertyName("orderId")] | ||
public Guid? OrderId { get; set; } | ||
|
||
[JsonPropertyName("isReminder")] | ||
public bool? IsReminder { get; set; } | ||
|
||
[JsonPropertyName("status")] | ||
public InitializedNotificationStatusExt Status { get; set; } | ||
} | ||
public enum InitializedNotificationStatusExt | ||
{ | ||
Success, | ||
MissingContact, | ||
Failure, | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Altinn.Correspondence.API/Models/InitializedCorrespondencesExt.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,34 @@ | ||
|
||
using System.Text.Json.Serialization; | ||
using Altinn.Correspondence.API.Models.Enums; | ||
|
||
namespace Altinn.Correspondence.API.Models; | ||
/// <summary> | ||
/// Represents a correspondence that has been initialized | ||
/// </summary> | ||
public class InitializedCorrespondencesExt | ||
{ | ||
/// <summary> | ||
/// The ID of the correspondence | ||
/// </summary> | ||
[JsonPropertyName("correspondenceId")] | ||
public Guid CorrespondenceId { get; set; } | ||
|
||
/// <summary> | ||
/// The status of the correspondence | ||
/// </summary> | ||
[JsonPropertyName("status")] | ||
public CorrespondenceStatusExt Status { get; set; } | ||
|
||
/// <summary> | ||
/// The recipient of the correspondence | ||
/// </summary> | ||
[JsonPropertyName("recipient")] | ||
public required string Recipient { get; set; } | ||
|
||
/// <summary> | ||
/// Information about the notifications that were created for the correspondence | ||
/// </summary> | ||
[JsonPropertyName("notifications")] | ||
public List<InitializedCorrespondencesNotificationsExt>? Notifications { get; set; } | ||
} |
42 changes: 42 additions & 0 deletions
42
src/Altinn.Correspondence.API/Models/InitializedCorrespondencesNotificationsExt.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,42 @@ | ||
|
||
using System.Text.Json.Serialization; | ||
|
||
namespace Altinn.Correspondence.API.Models; | ||
/// <summary> | ||
/// Information about the notifications that were created for the correspondence | ||
/// </summary> | ||
public class InitializedCorrespondencesNotificationsExt | ||
{ | ||
/// <summary> | ||
/// The order ID of the notification | ||
/// </summary> | ||
[JsonPropertyName("orderId")] | ||
public Guid? OrderId { get; set; } | ||
|
||
/// <summary> | ||
/// Boolean indicating if the notification is a reminder | ||
/// </summary> | ||
[JsonPropertyName("isReminder")] | ||
public bool? IsReminder { get; set; } | ||
|
||
/// <summary> | ||
/// The status of the notification | ||
/// </summary> | ||
[JsonPropertyName("status")] | ||
public InitializedNotificationStatusExt Status { get; set; } | ||
} | ||
public enum InitializedNotificationStatusExt | ||
{ | ||
/// <summary> | ||
/// The recipient lookup was successful for at least one recipient | ||
/// </summary> | ||
Success, | ||
/// <summary> | ||
/// The recipient lookup failed for all recipients | ||
/// </summary> | ||
MissingContact, | ||
/// <summary> | ||
/// The notification order failed to be created due to an error | ||
/// </summary> | ||
Failure, | ||
} |