using System;
using System.Collections.Generic;

namespace MyHN.Domain
{
  /// <summary>
  /// Représente l'entité lien.
  /// </summary>
  public class Link : Votable
  {
    /// public
    /// private
    /// protected
    /// internal

    public Guid Id { get; }
    public string Url { get; }
    public DateTime CreatedAt { get; }
    public string CreatedBy { get; }

    public Link(string url, string createdBy)
    {
      Id = Guid.NewGuid();
      CreatedAt = DateTime.UtcNow;
      CreatedBy = createdBy;
      Url = url;
    }

    public Comment AddComment(string content)
    {
      return new Comment(Id, content);
    }
  }
}
