-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added AnnouncementRecipient + Migration + Handler update
- Loading branch information
1 parent
25d9bc8
commit 095dd29
Showing
13 changed files
with
427 additions
and
33 deletions.
There are no files selected for viewing
29 changes: 0 additions & 29 deletions
29
Applications/ConsumerApi/src/http/Announcements/Create Announcements.bru
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
40 changes: 38 additions & 2 deletions
40
...ements/src/Announcements.Application/Announcements/Commands/CreateAnnouncement/Handler.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
9 changes: 9 additions & 0 deletions
9
...ts.Application/Infrastructure/Persistence/Repository/IAnnouncementRecipientsRepository.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,9 @@ | ||
using Backbone.Modules.Announcements.Domain.Entities; | ||
|
||
namespace Backbone.Modules.Announcements.Application.Infrastructure.Persistence.Repository; | ||
|
||
public interface IAnnouncementRecipientsRepository | ||
{ | ||
Task Add(AnnouncementRecipient announcementRecipient, CancellationToken cancellationToken); | ||
Task<List<AnnouncementRecipient>> FindAll(CancellationToken cancellationToken); | ||
} |
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
Modules/Announcements/src/Announcements.Domain/Entities/AnnouncementRecipient.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 Backbone.BuildingBlocks.Domain; | ||
using Backbone.Tooling; | ||
|
||
namespace Backbone.Modules.Announcements.Domain.Entities; | ||
|
||
public class AnnouncementRecipient : Entity | ||
{ | ||
// ReSharper disable once UnusedMember.Local | ||
public AnnouncementRecipient() | ||
{ | ||
// This constructor is for EF Core only; initializing the properties with null is therefore not a problem | ||
Id = null!; | ||
AnnouncementId = null!; | ||
Address = null!; | ||
} | ||
|
||
public AnnouncementRecipient(string address) | ||
{ | ||
Id = null!; // will be set by EF Core (primary key) | ||
AnnouncementId = null!; // will be set by EF Core (back navigation property) | ||
Address = address; | ||
CreatedAt = SystemTime.UtcNow; | ||
} | ||
|
||
public string Id { get; set; } | ||
public AnnouncementId AnnouncementId { get; } | ||
public string Address { get; set; } | ||
public DateTime CreatedAt { get; set; } | ||
} |
158 changes: 158 additions & 0 deletions
158
...cture.Database.Postgres/Migrations/20250110112331_AddingAnnouncementRecipient.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.