|
| 1 | +// © 2024, Worth Systems. |
| 2 | + |
| 3 | +using EventsHandler.Behaviors.Mapping.Converters; |
| 4 | +using System.Text.Json.Serialization; |
| 5 | + |
| 6 | +namespace EventsHandler.Behaviors.Mapping.Enums.NotifyNL |
| 7 | +{ |
| 8 | + /// <summary> |
| 9 | + /// Delivery statuses of notifications (e-mail, SMS) returned by "NotifyNL" API web service. |
| 10 | + /// <para> |
| 11 | + /// Source: |
| 12 | + /// |
| 13 | + /// <code> |
| 14 | + /// https://[DOMAIN*]/using-notify/message-status/email |
| 15 | + /// </code> |
| 16 | + /// |
| 17 | + /// * Domain where "NotifyNL" Admin portal is deployed (e.g., "admin.notify.nl"). |
| 18 | + /// </para> |
| 19 | + /// </summary> |
| 20 | + [JsonConverter(typeof(SafeJsonStringEnumMemberConverter<DeliveryStatus>))] |
| 21 | + internal enum DeliveryStatus |
| 22 | + { |
| 23 | + /// <summary> |
| 24 | + /// Default value. |
| 25 | + /// <para> |
| 26 | + /// It might occur in case of problems with receiving notification delivery statuses from "NotifyNL" |
| 27 | + /// (for example if the API was recently changed). |
| 28 | + /// </para> |
| 29 | + /// </summary> |
| 30 | + Unknown = 0, |
| 31 | + |
| 32 | + #region Email statuses (common with SMS as well) |
| 33 | + /// <summary> |
| 34 | + /// Notify has placed the message in a queue, ready to be sent to the provider. |
| 35 | + /// It should only remain in this state for a few seconds. |
| 36 | + /// </summary> |
| 37 | + [JsonPropertyName("created")] |
| 38 | + Created = 1, |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Notify has sent the message to the provider. The provider will try to deliver the |
| 42 | + /// message to the recipient for up to 72 hours. Notify is waiting for delivery information. |
| 43 | + /// </summary> |
| 44 | + [JsonPropertyName("sending")] |
| 45 | + Sending = 2, |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Email: The message was successfully delivered. Notify will not tell you if a user has opened or read a message. |
| 49 | + /// |
| 50 | + /// <para> |
| 51 | + /// SMS: The message was successfully delivered. If a recipient blocks your sender name or mobile number, your |
| 52 | + /// message will still show as delivered. |
| 53 | + /// </para> |
| 54 | + /// </summary> |
| 55 | + [JsonPropertyName("delivered")] |
| 56 | + Delivered = 3, |
| 57 | + #endregion |
| 58 | + |
| 59 | + #region SMS statuses (exclusive) |
| 60 | + /// <summary> |
| 61 | + /// SMS: Notify is waiting for more delivery information. Notify received a callback from the provider but the |
| 62 | + /// recipient’s device has not yet responded. Another callback from the provider determines the final status of |
| 63 | + /// the text message. |
| 64 | + /// </summary> |
| 65 | + [JsonPropertyName("pending")] |
| 66 | + Pending = 4, |
| 67 | + |
| 68 | + /// <summary> |
| 69 | + /// SMS: The message was sent to an international number. The mobile networks in some countries do not provide |
| 70 | + /// any more delivery information. The Notify website displays this status as ‘Sent to an international number’. |
| 71 | + /// </summary> |
| 72 | + [JsonPropertyName("sent")] |
| 73 | + Sent = 5, |
| 74 | + #endregion |
| 75 | + |
| 76 | + #region Mail statuses (exclusive) |
| 77 | + /// <summary> |
| 78 | + /// Mail: Notify has sent the letter to the provider to be printed. |
| 79 | + /// </summary> |
| 80 | + [JsonPropertyName("accepted")] |
| 81 | + Accepted = 6, |
| 82 | + |
| 83 | + /// <summary> |
| 84 | + /// Mail: The provider has printed and dispatched the letter. |
| 85 | + /// </summary> |
| 86 | + [JsonPropertyName("received")] |
| 87 | + Received = 7, |
| 88 | + |
| 89 | + /// <summary> |
| 90 | + /// Mail: Sending cancelled. The letter will not be printed or dispatched. |
| 91 | + /// </summary> |
| 92 | + [JsonPropertyName("cancelled")] |
| 93 | + Cancelled = 8, |
| 94 | + #endregion |
| 95 | + |
| 96 | + #region Failures (common for Email, SMS, and Mail) |
| 97 | + /// <summary> |
| 98 | + /// Email: The provider could not deliver the message because the email address was wrong. |
| 99 | + /// You should remove these email addresses from your database. |
| 100 | + /// |
| 101 | + /// <para> |
| 102 | + /// SMS: The provider could not deliver the message. This can happen if the phone number was wrong or if the network |
| 103 | + /// operator rejects the message. If you’re sure that these phone numbers are correct, you should contact Notify support. |
| 104 | + /// If not, you should remove them from your database. You’ll still be charged for text messages that cannot be delivered. |
| 105 | + /// </para> |
| 106 | + /// |
| 107 | + /// <para> |
| 108 | + /// Mail: The provider cannot print the letter. Your letter will not be dispatched. |
| 109 | + /// </para> |
| 110 | + /// </summary> |
| 111 | + [JsonPropertyName("permanent-failure")] |
| 112 | + PermanentFailure = 9, |
| 113 | + |
| 114 | + /// <summary> |
| 115 | + /// Email: The provider could not deliver the message. This can happen when the recipient’s inbox |
| 116 | + /// is full or their anti-spam filter rejects your email. Check your content does not look like spam |
| 117 | + /// before you try to send the message again. |
| 118 | + /// <para> |
| 119 | + /// Source: |
| 120 | + /// <code> |
| 121 | + /// https://www.gov.uk/service-manual/design/sending-emails-and-text-messages#protect-your-users-from-spam-and-phishing |
| 122 | + /// </code> |
| 123 | + /// </para> |
| 124 | + /// |
| 125 | + /// <para> |
| 126 | + /// SMS: The provider could not deliver the message. This can happen when the recipient’s phone is off, has no signal, |
| 127 | + /// or their text message inbox is full. You can try to send the message again. You’ll still be charged for text messages |
| 128 | + /// to phones that are not accepting messages. |
| 129 | + /// </para> |
| 130 | + /// </summary> |
| 131 | + [JsonPropertyName("temporary-failure")] |
| 132 | + TemporaryFailure = 10, |
| 133 | + |
| 134 | + /// <summary> |
| 135 | + /// Email: Your message was not sent because there was a problem between Notify and the provider. |
| 136 | + /// You’ll have to try sending your messages again. |
| 137 | + /// |
| 138 | + /// <para> |
| 139 | + /// SMS: Your message was not sent because there was a problem between Notify and the provider. |
| 140 | + /// You’ll have to try sending your messages again. You will not be charged for text messages that |
| 141 | + /// are affected by a technical failure. |
| 142 | + /// </para> |
| 143 | + /// |
| 144 | + /// <para> |
| 145 | + /// Mail: Notify had an unexpected error while sending the letter to our printing provider. |
| 146 | + /// </para> |
| 147 | + /// </summary> |
| 148 | + [JsonPropertyName("technical-failure")] |
| 149 | + TechnicalFailure = 11 |
| 150 | + #endregion |
| 151 | + } |
| 152 | +} |
0 commit comments