-
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
10 changed files
with
110 additions
and
107 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
43 changes: 43 additions & 0 deletions
43
Trumpee.MassTransit.Messages/Notifications/Template/Template.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,43 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Template; | ||
|
||
public static class Template | ||
{ | ||
public static Event<TemplateFilledPayload> Filled(string source, string notificationId, string templateId) | ||
{ | ||
var payload = new TemplateFilledPayload | ||
{ | ||
NotificationId = notificationId, | ||
TemplateId = templateId | ||
}; | ||
|
||
return Event<TemplateFilledPayload>.Create( | ||
notificationId, "TemplateFilled", source, payload); | ||
} | ||
|
||
public static Event<TemplateNotFilledPayload> NotFilled( | ||
string source, string notificationId, string templateId, IEnumerable<string>? errors) | ||
{ | ||
var payload = new TemplateNotFilledPayload | ||
{ | ||
NotificationId = notificationId, | ||
TemplateId = templateId, | ||
Errors = errors?.ToList().AsReadOnly() | ||
}; | ||
|
||
return Event<TemplateNotFilledPayload>.Create( | ||
notificationId, "TemplateNotFilled", source, payload); | ||
} | ||
|
||
public static Event<TemplateNotFoundPayload> NotFound( | ||
string source, string notificationId, string templateId, Dictionary<string, string>? props) | ||
{ | ||
var payload = new TemplateNotFoundPayload | ||
{ | ||
TemplateId = templateId, | ||
Properties = props | ||
}; | ||
|
||
return Event<TemplateNotFoundPayload>.Create( | ||
notificationId, "TemplateNotFound", source, payload); | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
Trumpee.MassTransit.Messages/Notifications/Template/TemplateFilledEvent.cs
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
Trumpee.MassTransit.Messages/Notifications/Template/TemplateNotFilledEvent.cs
This file was deleted.
Oops, something went wrong.
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
21 changes: 0 additions & 21 deletions
21
Trumpee.MassTransit.Messages/Notifications/Template/TemplateNotFoundEvent.cs
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
Trumpee.MassTransit.Messages/Notifications/Validation/Validation.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,29 @@ | ||
namespace Trumpee.MassTransit.Messages.Notifications.Validation; | ||
|
||
public static class Validation | ||
{ | ||
public static Event<ValidationFailedPayload> Failed(string source, string notificationId, string error) | ||
{ | ||
return Event<ValidationFailedPayload>.Create( | ||
notificationId, | ||
"ValidationFailed", | ||
source, | ||
new ValidationFailedPayload | ||
{ | ||
NotificationId = notificationId, | ||
ErrorMessage = error | ||
}); | ||
} | ||
|
||
public static Event<ValidationPassedPayload> Passed(string source, string notificationId) | ||
{ | ||
return Event<ValidationPassedPayload>.Create( | ||
notificationId, | ||
"ValidationPassed", | ||
source, | ||
new ValidationPassedPayload | ||
{ | ||
NotificationId = notificationId, | ||
}); | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
Trumpee.MassTransit.Messages/Notifications/Validation/ValidationFailedEvent.cs
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
Trumpee.MassTransit.Messages/Notifications/Validation/ValidationPassedEvent.cs
This file was deleted.
Oops, something went wrong.
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