Skip to content

Commit

Permalink
added new sms status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
acn-sbuad committed Feb 14, 2024
1 parent 95daba1 commit bfc2836
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
36 changes: 33 additions & 3 deletions src/Altinn.Notifications.Core/Enums/SmsNotificationResultType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,47 @@ public enum SmsNotificationResultType
Accepted,

/// <summary>
/// Failed, unknown reason
/// Sms notification was successfully delivered to destination.
/// </summary>
Delivered,

/// <summary>
/// Sms notification send operation failed
/// </summary>
Failed,

/// <summary>
/// Failed, invalid mobilenumber
/// Sms notification send operation failed because the receiver number is barred/blocked/not in use.
/// </summary>
Failed_BarredReceiver,

/// <summary>
/// Sms notification send operation failed because the message has been deleted.
/// </summary>
Failed_Deleted,

/// <summary>
/// Sms notification send operation failed because the message validity period has expired.
/// </summary>
Failed_Expired,

/// <summary>
/// Sms notification send operation failed due to invalid recipient
/// </summary>
Failed_InvalidRecipient,

/// <summary>
/// Sms notification send operation failed due to the SMS being undeliverable.
/// </summary>
Failed_Undelivered,

/// <summary>
/// Recipient mobile number was not identified
/// </summary>
Failed_RecipientNotIdentified
Failed_RecipientNotIdentified,

/// <summary>
/// Message was rejected.
/// </summary>
Failed_Rejected
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ public class SmsNotificationSummaryService : ISmsNotificationSummaryService
{ SmsNotificationResultType.New, "The SMS has been created, but has not been picked up for processing yet." },
{ SmsNotificationResultType.Sending, "The SMS is being processed and will be attempted sent shortly." },
{ SmsNotificationResultType.Accepted, "The SMS has been accepted by the gateway service and will be sent shortly." },
{ SmsNotificationResultType.Failed, "The SMS was not sent due to an unspecified failure." },
{ SmsNotificationResultType.Failed_RecipientNotIdentified, "The SMS was not sent because the recipient's SMS address was not found." },
{ SmsNotificationResultType.Failed_InvalidRecipient, "The SMS was not sent because the recipient number was invalid." }
{ SmsNotificationResultType.Delivered, "The SMS was successfully delivered to its destination." },
{ SmsNotificationResultType.Failed, "The SMS was not delivered due to an unspecified failure." },
{ SmsNotificationResultType.Failed_BarredReceiver, "The SMS was not delivered because the recipient's number is barred, blocked or not in use." },
{ SmsNotificationResultType.Failed_Deleted, "The SMS was not delivered because the message has been deleted." },
{ SmsNotificationResultType.Failed_Expired, "The SMS was not delivered because it has expired." },
{ SmsNotificationResultType.Failed_InvalidRecipient, "The SMS was not delivered because the recipient's mobile number was invalid." },
{ SmsNotificationResultType.Failed_Undelivered, "The SMS was not delivered due to invalid number or no available route to destination." },
{ SmsNotificationResultType.Failed_RecipientNotIdentified, "The SMS was not delivered because the recipient's mobile number was not found." },
{ SmsNotificationResultType.Failed_Rejected, "The SMS was not delivered because it was rejected." },
};

private readonly static List<SmsNotificationResultType> _successResults = new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ public void IsSuccessResult_CheckResultForAllEnums(SmsNotificationResultType res
[InlineData(SmsNotificationResultType.New, "The SMS has been created, but has not been picked up for processing yet.")]
[InlineData(SmsNotificationResultType.Sending, "The SMS is being processed and will be attempted sent shortly.")]
[InlineData(SmsNotificationResultType.Accepted, "The SMS has been accepted by the gateway service and will be sent shortly.")]
[InlineData(SmsNotificationResultType.Failed, "The SMS was not sent due to an unspecified failure.")]
[InlineData(SmsNotificationResultType.Failed_RecipientNotIdentified, "The SMS was not sent because the recipient's SMS address was not found.")]
[InlineData(SmsNotificationResultType.Failed_InvalidRecipient, "The SMS was not sent because the recipient number was invalid.")]
[InlineData(SmsNotificationResultType.Delivered, "The SMS was successfully delivered to its destination.")]
[InlineData(SmsNotificationResultType.Failed, "The SMS was not delivered due to an unspecified failure.")]
[InlineData(SmsNotificationResultType.Failed_BarredReceiver, "The SMS was not delivered because the recipient's number is barred, blocked or not in use.")]
[InlineData(SmsNotificationResultType.Failed_Deleted, "The SMS was not delivered because the message has been deleted.")]
[InlineData(SmsNotificationResultType.Failed_Expired, "The SMS was not delivered because it has expired.")]
[InlineData(SmsNotificationResultType.Failed_InvalidRecipient, "The SMS was not delivered because the recipient's mobile number was invalid.")]
[InlineData(SmsNotificationResultType.Failed_Undelivered, "The SMS was not delivered due to invalid number or no available route to destination.")]
[InlineData(SmsNotificationResultType.Failed_RecipientNotIdentified, "The SMS was not delivered because the recipient's mobile number was not found.")]
[InlineData(SmsNotificationResultType.Failed_Rejected, "The SMS was not delivered because it was rejected.")]
public void GetResultDescription_ExpectedDescription(SmsNotificationResultType result, string expected)
{
string actual = SmsNotificationSummaryService.GetResultDescription(result);
Expand Down

0 comments on commit bfc2836

Please sign in to comment.