namespace Modules.Library.Domain.Entities.MediaContent.CommonProperties;
public class Description : ValueObject
{
    [Required]
    public string Value { get; private set; } = string.Empty;
    public bool IsOriginal { get; init; }
    [Required]
    public Guid LanguageId { get; private set; } = default!;

    private Description() { }

    public Description(Guid languageId, bool isOriginal, string value)
    {
        LanguageId = languageId;
        IsOriginal = isOriginal;
        Value = value;
    }

    internal static Description New(Models.Description description) => new()
    {
        LanguageId = description.LanguageId,
        IsOriginal = description.IsOriginal,
        Value = description.Value
    };

    public void SetValue(string value)
    {
        Value = value;
    }

    public void SetLanguage(Guid languageId)
    {
        LanguageId = languageId;
    }

    protected override IEnumerable<object?> GetEqualityComponents()
    {
        yield return Value;
        yield return LanguageId;
        yield return IsOriginal;
    }
}