using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace Core.Entities;

public class Chat
{
    public string Id { get; private set; }
    public List<Message> Messages { get; private set; } = new();

    public void SetId(string id) { Id = id; }
    public void SetMessages(List<Message> messages) { Messages = messages; }
}

public class Message
{
    public Message(Guid userId, string content)
    {
        UserId = userId;
        Content = content;
    }
    
    [BsonRepresentation(BsonType.String)] 
    public Guid UserId { get; private set; }

    public string Content { get; private set; }

    public void SetUserId(Guid userId) { UserId = userId; }
    public void SetContent(string content) { Content = content; }
}