Skip to content

Commit

Permalink
chore: move reminder created and updated events into building blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
HunorTotBagi committed Jan 30, 2025
1 parent d1b6f2f commit 770f5a5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using BuildingBlocks.Domain.Abstractions;
using BuildingBlocks.Domain.Reminders.Reminder.ValueObjects;

namespace BuildingBlocks.Domain.Reminders.Reminder.Events;

public record ReminderCreatedEvent(ReminderId ReminderId) : IDomainEvent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using BuildingBlocks.Domain.Abstractions;
using BuildingBlocks.Domain.Reminders.Reminder.ValueObjects;

namespace BuildingBlocks.Domain.Reminders.Reminder.Events;

public record ReminderUpdatedEvent(ReminderId ReminderId) : IDomainEvent;

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using BuildingBlocks.Domain.Nodes.Node.ValueObjects;
using BuildingBlocks.Domain.Reminders.Reminder.Events;
using BuildingBlocks.Domain.Reminders.Reminder.ValueObjects;
using Reminders.Domain.Events;

namespace Reminders.Domain.Models;

Expand Down Expand Up @@ -30,7 +30,7 @@ public static Reminder Create(ReminderId id, string title, string description, D
NodeId = nodeId
};

reminder.AddDomainEvent(new ReminderCreatedEvent(reminder));
reminder.AddDomainEvent(new ReminderCreatedEvent(reminder.Id));

return reminder;
}
Expand All @@ -44,7 +44,7 @@ public void Update(string title, string description, DateTime dueDateTime, int p
NotificationTime = notificationTime;
Status = status;

AddDomainEvent(new ReminderUpdatedEvent(this));
AddDomainEvent(new ReminderUpdatedEvent(Id));
}

#endregion
Expand Down

0 comments on commit 770f5a5

Please sign in to comment.