namespace Modules.Library.Domain.Entities.Genre;

public class Genre : Entity
{
    [Required]
    public string Name { get; private set; } = default!;
    private Genre() { }

    internal Genre(string name) { Name = name; }
    internal Genre(Guid id, string name) { Id = id; Name = name; }

    public void SetName(string name) => Name = name;
    internal void SetDeleted(bool value) => Deleted = value;

    public static Genre New(Models.Genre genre) => new()
    {
        Id = genre.Id,
        Name = genre.Name,
        Deleted = genre.Deleted,
    };

    public static Genre NewForComparison(Guid id) => new()
    {
        Id = id,
    };
}