This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
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.
Merge pull request #269 from habralab/fix/268-notification-fix
#268 Правка уведомлений
- Loading branch information
Showing
45 changed files
with
452 additions
and
56 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
8 changes: 8 additions & 0 deletions
8
features/notification/server/Garnet.Notifications.Application/QuotedEntity.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,8 @@ | ||
namespace Garnet.Notifications.Application | ||
{ | ||
public record QuotedEntity( | ||
string Id, | ||
string AvatarUrl, | ||
string Quote | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
features/notification/server/Garnet.Notifications.Events/NotificationQuotedEntity.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,8 @@ | ||
namespace Garnet.Notifications.Events | ||
{ | ||
public record NotificationQuotedEntity( | ||
string Id, | ||
string AvatarUrl, | ||
string Quote | ||
); | ||
} |
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
8 changes: 8 additions & 0 deletions
8
...ion/server/Garnet.Notifications.Infrastructure/Api/NotificationGet/QuotedEntityPayload.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,8 @@ | ||
namespace Garnet.Notifications.Infrastructure.Api.NotificationGet | ||
{ | ||
public record QuotedEntityPayload( | ||
string Id, | ||
string AvatarUrl, | ||
string Quote | ||
); | ||
} |
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
29 changes: 29 additions & 0 deletions
29
...ification/server/Garnet.Notifications.Infrastructure/MongoDB/NotificationQuoteDocument.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 @@ | ||
using Garnet.Notifications.Application; | ||
|
||
namespace Garnet.Notifications.Infrastructure.MongoDB | ||
{ | ||
public class NotificationQuoteDocument | ||
{ | ||
public string Id { get; init; } = null!; | ||
public string AvatarUrl { get; init; } = null!; | ||
public string Quote { get; init; } = null!; | ||
|
||
public static QuotedEntity ToDomain(NotificationQuoteDocument doc) | ||
{ | ||
return new QuotedEntity( | ||
doc.Id, | ||
doc.AvatarUrl, | ||
doc.Quote | ||
); | ||
} | ||
|
||
public static NotificationQuoteDocument Create(QuotedEntity entity) | ||
{ | ||
return new NotificationQuoteDocument() { | ||
Id = entity.Id, | ||
AvatarUrl = entity.AvatarUrl, | ||
Quote = entity.Quote | ||
}; | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ptanceTests/FakeServices/NotificationFake/DeleteNotificationCommandMessageFakeConsumer.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,15 @@ | ||
using Garnet.Common.Application.MessageBus; | ||
using Garnet.Notifications.Events; | ||
|
||
namespace Garnet.Projects.AcceptanceTests.FakeServices.NotificationFake | ||
{ | ||
public class DeleteNotificationCommandMessageFakeConsumer : IMessageBusConsumer<DeleteNotificationCommandMessage> | ||
{ | ||
public List<DeleteNotificationCommandMessage> DeletedNotifications = new(); | ||
public Task Consume(DeleteNotificationCommandMessage message) | ||
{ | ||
DeletedNotifications.Add(message); | ||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
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
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.