-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
155 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
[bB]in | ||
[oO]bj |
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,12 @@ | ||
namespace Trumpee.MassTransit.Messages; | ||
|
||
public class Event<TBody> | ||
{ | ||
public TBody? Payload { get; set; } | ||
|
||
public required string Id { get; set; } | ||
public required string Action { get; set; } | ||
public required string Source { get; set; } | ||
public DateTimeOffset Timestamp { get; set; } | ||
public Dictionary<string, string>? Metadata { get; set; } | ||
} |
22 changes: 22 additions & 0 deletions
22
Trumpee.MassTransit.Messages/Notifications/Template/TemplateFilledEvent.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,22 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Template; | ||
|
||
public class TemplateFilledEvent : Event<TemplateFilledPayload> | ||
{ | ||
public static TemplateFilledEvent GetEvent( | ||
string source, string templateId, string notificationId) | ||
{ | ||
return new TemplateFilledEvent | ||
{ | ||
Id = Guid.NewGuid().ToString("N"), | ||
Action = nameof(TemplateNotFilledEvent).ToLower(), | ||
Source = source, | ||
Timestamp = DateTimeOffset.UtcNow, | ||
Metadata = [], | ||
Payload = new TemplateFilledPayload | ||
{ | ||
TemplateId = templateId, | ||
NotificationId = notificationId | ||
} | ||
}; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Trumpee.MassTransit.Messages/Notifications/Template/TemplateFilledPayload.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,7 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Template; | ||
|
||
public class TemplateFilledPayload | ||
{ | ||
public required string TemplateId { get; set; } | ||
public required string NotificationId { get; set; } | ||
} |
22 changes: 22 additions & 0 deletions
22
Trumpee.MassTransit.Messages/Notifications/Template/TemplateNotFilledEvent.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,22 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Template; | ||
|
||
public class TemplateNotFilledEvent : Event<TemplateNotFilledPayload> | ||
{ | ||
public static TemplateNotFilledEvent GetEvent( | ||
string source, string templateId, string notificationId) | ||
{ | ||
return new TemplateNotFilledEvent | ||
{ | ||
Id = Guid.NewGuid().ToString("N"), | ||
Action = nameof(TemplateNotFilledEvent).ToLower(), | ||
Source = source, | ||
Timestamp = DateTimeOffset.UtcNow, | ||
Metadata = [], | ||
Payload = new TemplateNotFilledPayload | ||
{ | ||
TemplateId = templateId, | ||
NotificationId = notificationId | ||
} | ||
}; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Trumpee.MassTransit.Messages/Notifications/Template/TemplateNotFilledPayload.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,7 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Template; | ||
|
||
public class TemplateNotFilledPayload | ||
{ | ||
public required string TemplateId { get; set; } | ||
public required string NotificationId { get; set; } | ||
} |
21 changes: 21 additions & 0 deletions
21
Trumpee.MassTransit.Messages/Notifications/Template/TemplateNotFoundEvent.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,21 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Template; | ||
|
||
public class TemplateNotFoundEvent : Event<TemplateNotFoundPayload> | ||
{ | ||
public static TemplateNotFoundEvent GetEvent(string source, string templateId, Dictionary<string, string> props) | ||
{ | ||
return new TemplateNotFoundEvent | ||
{ | ||
Id = Guid.NewGuid().ToString("N"), | ||
Action = nameof(TemplateNotFoundEvent).ToLower(), | ||
Source = source, | ||
Timestamp = DateTimeOffset.UtcNow, | ||
Metadata = [], | ||
Payload = new TemplateNotFoundPayload | ||
{ | ||
TemplateId = templateId, | ||
Properties = props | ||
} | ||
}; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Trumpee.MassTransit.Messages/Notifications/Template/TemplateNotFoundPayload.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,7 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Template; | ||
|
||
public class TemplateNotFoundPayload | ||
{ | ||
public required string TemplateId { get; set; } | ||
public Dictionary<string, string>? Properties { get; set; } | ||
} |
21 changes: 21 additions & 0 deletions
21
Trumpee.MassTransit.Messages/Notifications/Validation/ValidationFailedEvent.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,21 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Validation; | ||
|
||
public class ValidationFailedEvent : Event<ValidationFailedPayload> | ||
{ | ||
public static ValidationFailedEvent GetEvent(string source, string notificationId, string error) | ||
{ | ||
return new ValidationFailedEvent | ||
{ | ||
Id = Guid.NewGuid().ToString("N"), | ||
Action = nameof(ValidationFailedEvent).ToLower(), | ||
Source = source, | ||
Timestamp = DateTimeOffset.UtcNow, | ||
Metadata = [], | ||
Payload = new ValidationFailedPayload | ||
{ | ||
NotificationId = notificationId, | ||
ErrorMessage = error | ||
} | ||
}; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Trumpee.MassTransit.Messages/Notifications/Validation/ValidationFailedPayload.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,7 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Validation; | ||
|
||
public class ValidationFailedPayload | ||
{ | ||
public string? NotificationId { get; set; } | ||
public string? ErrorMessage { get; set; } | ||
} |
20 changes: 20 additions & 0 deletions
20
Trumpee.MassTransit.Messages/Notifications/Validation/ValidationPassedEvent.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,20 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Validation; | ||
|
||
public class ValidationPassedEvent : Event<ValidationPassedPayload> | ||
{ | ||
public static ValidationPassedEvent GetEvent(string source, string notificationId) | ||
{ | ||
return new ValidationPassedEvent | ||
{ | ||
Id = Guid.NewGuid().ToString("N"), | ||
Action = nameof(ValidationFailedEvent).ToLower(), | ||
Source = source, | ||
Timestamp = DateTimeOffset.UtcNow, | ||
Metadata = [], | ||
Payload = new ValidationPassedPayload | ||
{ | ||
NotificationId = notificationId | ||
} | ||
}; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Trumpee.MassTransit.Messages/Notifications/Validation/ValidationPassedPayload.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,6 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Validation; | ||
|
||
public class ValidationPassedPayload | ||
{ | ||
public string? NotificationId { get; set; } | ||
} |