Skip to content

Commit a4134c1

Browse files
committed
(#411) posts: udpate post created event to add shoudl notify flag
1 parent 689b3ec commit a4134c1

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Application/Commands/Handlers/CreatePostHandler.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ await _messageBroker.PublishAsync(new PostCreated(
121121
command.EventId,
122122
command.TextContent,
123123
command.MediaFiles,
124-
command.Context.ToString(),
125-
command.Visibility
124+
command.Context.ToString(),
125+
command.Visibility,
126+
shouldNotify: true
126127
));
127128
}
128129
}

MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Application/Events/PostCreated.cs

+10-8
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ namespace MiniSpace.Services.Posts.Application.Events
77
public class PostCreated : IEvent
88
{
99
public Guid PostId { get; }
10-
public Guid? UserId { get; }
11-
public Guid? OrganizationId { get; }
12-
public Guid? EventId { get; }
13-
public string TextContent { get; }
14-
public IEnumerable<string> MediaFilesUrls { get; }
15-
public string Context { get; }
16-
public string Visibility { get; }
10+
public Guid? UserId { get; }
11+
public Guid? OrganizationId { get; }
12+
public Guid? EventId { get; }
13+
public string TextContent { get; }
14+
public IEnumerable<string> MediaFilesUrls { get; }
15+
public string Context { get; }
16+
public string Visibility { get; }
17+
public bool ShouldNotify { get; }
1718

1819
public PostCreated(Guid postId, Guid? userId, Guid? organizationId, Guid? eventId, string textContent,
19-
IEnumerable<string> mediaFilesUrls, string context, string visibility)
20+
IEnumerable<string> mediaFilesUrls, string context, string visibility, bool shouldNotify)
2021
{
2122
PostId = postId;
2223
UserId = userId;
@@ -26,6 +27,7 @@ public PostCreated(Guid postId, Guid? userId, Guid? organizationId, Guid? eventI
2627
MediaFilesUrls = mediaFilesUrls;
2728
Context = context;
2829
Visibility = visibility;
30+
ShouldNotify = shouldNotify;
2931
}
3032
}
3133
}

0 commit comments

Comments
 (0)