Add calendar integrations and collaboration updates
Some checks failed
Backend CI/CD / build_and_deploy (push) Has been cancelled
Frontend CI/CD / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-05-05 15:25:53 -04:00
parent c49f03ec06
commit b66c10b681
82 changed files with 8420 additions and 2048 deletions

View File

@@ -2,9 +2,11 @@ using FastEndpoints;
using Microsoft.EntityFrameworkCore;
using Socialize.Api.Data;
using Socialize.Api.Infrastructure.Security;
using Socialize.Api.Modules.ContentItems.Contracts;
using Socialize.Api.Modules.ContentItems.Data;
using Socialize.Api.Modules.Comments.Data;
using Socialize.Api.Modules.Notifications.Contracts;
using System.Text.Json;
namespace Socialize.Api.Modules.Comments.Handlers;
@@ -28,6 +30,7 @@ public class CreateCommentRequestValidator
public class CreateCommentHandler(
AppDbContext dbContext,
AccessScopeService accessScopeService,
IContentItemActivityWriter activityWriter,
INotificationEventWriter notificationEventWriter)
: Endpoint<CreateCommentRequest, CommentDto>
{
@@ -93,6 +96,22 @@ public class CreateCommentHandler(
.Select(candidate => candidate.PortraitUrl)
.SingleOrDefaultAsync(ct);
await activityWriter.WriteAsync(
new ContentItemActivityWriteModel(
comment.WorkspaceId,
comment.ContentItemId,
"comment.created",
"Comment",
comment.Id,
$"{comment.AuthorDisplayName} commented on {contentItem.Title}.",
comment.AuthorUserId,
comment.AuthorEmail,
JsonSerializer.Serialize(new
{
parentCommentId = comment.ParentCommentId,
})),
ct);
await notificationEventWriter.WriteAsync(
new NotificationEventWriteModel(
comment.WorkspaceId,
@@ -116,9 +135,7 @@ public class CreateCommentHandler(
comment.AuthorEmail,
authorPortraitUrl,
comment.Body,
comment.IsResolved,
comment.CreatedAt,
comment.ResolvedAt);
comment.CreatedAt);
await SendAsync(dto, StatusCodes.Status201Created, ct);
}