Skip to content

Commit 3180552

Browse files
Merge pull request #10 from Worth-NL/feature/NotifyNL_CallbackEndpoint
Feature/NotifyNL callback endpoint
2 parents e0bfb52 + 0d8caf8 commit 3180552

File tree

25 files changed

+586
-166
lines changed

25 files changed

+586
-166
lines changed

Documentation/OMC - Documentation.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NotifyNL OMC
1+
# OMC Documentation
22

33
v.1.6.2
44

@@ -7,7 +7,7 @@ v.1.6.2
77
---
88
# 1. Introduction
99

10-
NotifyNL OMC (Output Management Component) is a central point and the common hub of the communication workflow between third parties software such as:
10+
OMC (Output Management Component) is a central point and the common hub of the communication workflow between third parties software such as:
1111

1212
- **Open Notificatie** (API web service)
1313

@@ -54,12 +54,12 @@ NotifyNL OMC (Output Management Component) is a central point and the common hub
5454
| USER_DOMAIN_OBJECTEN | string | false | Cannot be missing and have null or empty value + only domain should be used: without protocol (http / https) or endpoints (.../api/create) | You have to use the domain part from URLs where you are hosting the dedicated Open services |
5555
| USER_DOMAIN_OBJECTTYPEN | string | false | Cannot be missing and have null or empty value + only domain should be used: without protocol (http / https) or endpoints (.../api/create) | You have to use the domain part from URLs where you are hosting the dedicated Open services |
5656
| --- | --- | --- | --- | --- |
57-
| USER_TEMPLATEIDS_SMS_ZAAKCREATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from NotifyNL Admin Portal |
58-
| USER_TEMPLATEIDS_SMS_ZAAKUPDATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from NotifyNL Admin Portal |
59-
| USER_TEMPLATEIDS_SMS_ZAAKCLOSE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from NotifyNL Admin Portal |
60-
| USER_TEMPLATEIDS_EMAIL_ZAAKCREATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from NotifyNL Admin Portal |
61-
| USER_TEMPLATEIDS_EMAIL_ZAAKUPDATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from NotifyNL Admin Portal |
62-
| USER_TEMPLATEIDS_EMAIL_ZAAKCLOSE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from NotifyNL Admin Portal |
57+
| USER_TEMPLATEIDS_SMS_ZAAKCREATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from "NotifyNL" Admin Portal |
58+
| USER_TEMPLATEIDS_SMS_ZAAKUPDATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from "NotifyNL" Admin Portal |
59+
| USER_TEMPLATEIDS_SMS_ZAAKCLOSE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from "NotifyNL" Admin Portal |
60+
| USER_TEMPLATEIDS_EMAIL_ZAAKCREATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from "NotifyNL" Admin Portal |
61+
| USER_TEMPLATEIDS_EMAIL_ZAAKUPDATE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from "NotifyNL" Admin Portal |
62+
| USER_TEMPLATEIDS_EMAIL_ZAAKCLOSE | string | false | Cannot be missing and have null or empty value + must be in UUID format | Should be generated per specific business use case from "NotifyNL" Admin Portal |
6363

6464
---
6565
# 4. Authorization and authentication
@@ -70,7 +70,7 @@ NotifyNL OMC (Output Management Component) is a central point and the common hub
7070
---
7171
# 6. Errors
7272

73-
List of **validation** (format, requirements), **connectivity** or business logic **processing** errors that you might encounter during accessing `NotifyNL OMC` API endpoints.
73+
List of **validation** (format, requirements), **connectivity** or business logic **processing** errors that you might encounter during accessing `OMC` API endpoints.
7474

7575
## 6.1. Events Controller
7676

@@ -90,13 +90,13 @@ Endpoints:
9090

9191
#### 6.2.1.1. Possible errors
9292

93-
- Invalid base URL (NotifyNL API service):
93+
- Invalid base URL ("NotifyNL" API service):
9494
![Invalid base URL - Error](../images/test_notify_baseUrl.png)
9595

96-
- Invalid format of API key or it is missing (NotifyNL API service):
96+
- Invalid format of API key or it is missing ("NotifyNL" API service):
9797
![Invalid format of API key - Error](../images/test_notify_apiKeyMissing.png)
9898

99-
- Invalid API key – it was not registered for this NotifyNL API service:
99+
- Invalid API key – it was not registered for this "NotifyNL" API service:
100100
![Invalid API key - Error](../images/test_notify_apiKeyInvalid.png)
101101

102102
- Missing required parameters:

EventsHandler/Api/EventsHandler/Behaviors/Communication/Enums/NotifyMethods.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ internal enum NotifyMethods
1212
/// <inheritdoc cref="DistributionChannels.None"/>
1313
None = DistributionChannels.None, // 1
1414

15-
/// <inheritdoc cref="DistributionChannels.Sms"/>
16-
Sms = DistributionChannels.Sms, // 2
17-
1815
/// <inheritdoc cref="DistributionChannels.Email"/>
19-
Email = DistributionChannels.Email, // 3
16+
Email = DistributionChannels.Email, // 2
17+
18+
/// <inheritdoc cref="DistributionChannels.Sms"/>
19+
Sms = DistributionChannels.Sms, // 3
2020

2121
/// <inheritdoc cref="DistributionChannels.Both"/>
2222
Both = DistributionChannels.Both // 4

EventsHandler/Api/EventsHandler/Behaviors/Mapping/Enums/NotificatieApi/Channels.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace EventsHandler.Behaviors.Mapping.Enums.NotificatieApi
1313
public enum Channels
1414
{
1515
/// <summary>
16-
/// Default option.
16+
/// Default value.
1717
/// </summary>
1818
[JsonPropertyName(DefaultValues.Models.DefaultEnumValueName)]
1919
Unknown = 0,
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// © 2024, Worth Systems.
2+
3+
using System.Text.Json.Serialization;
4+
using EventsHandler.Behaviors.Mapping.Enums.OpenKlant;
5+
6+
namespace EventsHandler.Behaviors.Mapping.Enums.NotifyNL
7+
{
8+
/// <summary>
9+
/// Notification types returned by "NotifyNL" API web service.
10+
/// </summary>
11+
internal enum NotificationTypes
12+
{
13+
/// <inheritdoc cref="DistributionChannels.Email"/>
14+
[JsonPropertyName("email")]
15+
Email = DistributionChannels.Email, // 2
16+
17+
/// <inheritdoc cref="DistributionChannels.Sms"/>
18+
[JsonPropertyName("sms")]
19+
Sms = DistributionChannels.Sms // 3
20+
}
21+
}

EventsHandler/Api/EventsHandler/Behaviors/Mapping/Enums/OpenKlant/DistributionChannels.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public enum DistributionChannels
2525
None = 1,
2626

2727
/// <summary>
28-
/// Communication method: SMS.
28+
/// Communication method: e-mail.
2929
/// </summary>
30-
[JsonPropertyName("sms")]
31-
Sms = 2,
30+
[JsonPropertyName("email")]
31+
Email = 2,
3232

3333
/// <summary>
34-
/// Communication method: e-mail.
34+
/// Communication method: SMS.
3535
/// </summary>
36-
[JsonPropertyName("email")]
37-
Email = 3,
36+
[JsonPropertyName("sms")]
37+
Sms = 3,
3838

3939
/// <summary>
4040
/// Communication method: SMS and e-mail.

0 commit comments

Comments
 (0)