Add calendar integrations and collaboration updates
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Socialize.Api.Data;
|
||||
using Socialize.Api.Modules.ContentItems.Contracts;
|
||||
using Socialize.Api.Modules.ContentItems.Data;
|
||||
|
||||
namespace Socialize.Api.Modules.ContentItems.Services;
|
||||
|
||||
public class ContentItemActivityWriter(
|
||||
AppDbContext dbContext)
|
||||
: IContentItemActivityWriter
|
||||
{
|
||||
public async Task WriteAsync(ContentItemActivityWriteModel model, CancellationToken cancellationToken = default)
|
||||
{
|
||||
ContentItemActivityEntry entry = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
WorkspaceId = model.WorkspaceId,
|
||||
ContentItemId = model.ContentItemId,
|
||||
EventType = model.EventType,
|
||||
EntityType = model.EntityType,
|
||||
EntityId = model.EntityId,
|
||||
Summary = model.Summary,
|
||||
ActorUserId = model.ActorUserId,
|
||||
ActorEmail = model.ActorEmail,
|
||||
MetadataJson = model.MetadataJson,
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
};
|
||||
|
||||
dbContext.ContentItemActivityEntries.Add(entry);
|
||||
await dbContext.SaveChangesAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user