-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from digipost/document_events
Document events
- Loading branch information
Showing
15 changed files
with
385 additions
and
52 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
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,65 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using Digipost.Api.Client.Common.Enums; | ||
|
||
namespace Digipost.Api.Client.Common | ||
{ | ||
public class DocumentEvents : IEnumerable<DocumentEvent> | ||
{ | ||
private readonly IEnumerable<DocumentEvent> _events; | ||
|
||
public DocumentEvents(IEnumerable<DocumentEvent> events) | ||
{ | ||
_events = events; | ||
} | ||
|
||
public IEnumerator<DocumentEvent> GetEnumerator() | ||
{ | ||
return _events.GetEnumerator(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return GetEnumerator(); | ||
} | ||
} | ||
|
||
public class DocumentEvent | ||
{ | ||
public Guid Guid { get; } | ||
|
||
public DocumentEventType EventType { get; } | ||
|
||
public DateTime Created { get; } | ||
|
||
public DateTime DocumentCreated { get; } | ||
|
||
public EventMetadata EventMetadata { get; set; } | ||
|
||
public DocumentEvent(Guid guid, DocumentEventType eventType, DateTime created, DateTime documentCreated) | ||
{ | ||
Guid = guid; | ||
EventType = eventType; | ||
Created = created; | ||
DocumentCreated = documentCreated; | ||
} | ||
} | ||
|
||
public abstract class EventMetadata | ||
{ | ||
} | ||
|
||
public class RequestForRegistrationExpiredMetadata : EventMetadata | ||
{ | ||
/// <summary> | ||
/// Values of FallbackChannel might be 'none' or 'print'. | ||
/// </summary> | ||
public string FallbackChannel { get; } | ||
|
||
public RequestForRegistrationExpiredMetadata(string fallbackChannel) | ||
{ | ||
FallbackChannel = fallbackChannel; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace Digipost.Api.Client.Common.Enums | ||
{ | ||
public enum DocumentEventType | ||
{ | ||
EmailNotificationFailed, | ||
EmailMessageSent, | ||
EmailMessageFailed, | ||
SmsNotificationFailed, | ||
Opened, | ||
MoveFilesFromPublicSector, | ||
Postmarked, | ||
PrintFailed, | ||
Shredded, | ||
PeppolDelivered, | ||
PeppolFailed, | ||
RequestForRegistrationExpired, | ||
RequestForRegistrationDeliveredDigipost, | ||
RequestForRegistrationFailed, | ||
} | ||
} |
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
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
Oops, something went wrong.