using System;

namespace Knot.Modules.Messaging.Domain;

public class PollOption
{
    public Guid Id { get; private set; }
    public Guid PollId { get; private set; }
    public string Text { get; private set; } = string.Empty;
    
    // Денормализованные данные для быстрой отдачи
    public int VotesCount { get; private set; }
    public int Percentage { get; private set; }

    private PollOption() { } // EF

    public PollOption(Guid id, Guid pollId, string text)
    {
        Id = id;
        PollId = pollId;
        Text = text;
    }

    public void UpdateResults(int count, int percentage)
    {
        VotesCount = count;
        Percentage = percentage;
    }
}
