feat: pivot to social media workflow app
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-04-24 12:58:35 -04:00
parent 0f4acc1b6d
commit df3e602015
349 changed files with 18685 additions and 16010 deletions

View File

@@ -0,0 +1,30 @@
using Socialize.Modules.Notifications.Contracts;
using Socialize.Modules.Notifications.Data;
namespace Socialize.Modules.Notifications.Services;
public class NotificationEventWriter(
AppDbContext dbContext)
: INotificationEventWriter
{
public async Task WriteAsync(NotificationEventWriteModel model, CancellationToken cancellationToken = default)
{
NotificationEvent notificationEvent = new()
{
Id = Guid.NewGuid(),
WorkspaceId = model.WorkspaceId,
ContentItemId = model.ContentItemId,
EventType = model.EventType,
EntityType = model.EntityType,
EntityId = model.EntityId,
Message = model.Message,
RecipientUserId = model.RecipientUserId,
RecipientEmail = model.RecipientEmail,
MetadataJson = model.MetadataJson,
CreatedAt = DateTimeOffset.UtcNow,
};
dbContext.NotificationEvents.Add(notificationEvent);
await dbContext.SaveChangesAsync(cancellationToken);
}
}