using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Knot.Contracts.Messaging.Infrastructure.Persistence;

public interface IMongoMessageCollection
{
    Task<List<Message>> GetAllAsync(CancellationToken cancellationToken);
    Task<List<Message>> GetOrphanedMessagesAsync(HashSet<Guid> activeChatIds, CancellationToken cancellationToken);
    Task DeleteManyAsync(List<Guid> messageIds, CancellationToken cancellationToken);
}

public class Message
{
    public Guid Id { get; set; }
    public Guid ChatId { get; set; }
    public bool IsDeleted { get; set; }
    public string? MediaUrl { get; set; }
    public List<Media>? Media { get; set; }
}

public class Media
{
    public string Url { get; set; } = string.Empty;
}