namespace Wishlist.Data.Entities;

public struct VisibilityStatus
{
    public VisibilityStatus() { }

    public List<User> VisibleTo { get; set; } = [];
    public bool Published { get; set; }
    public bool Public { get; set; }

    public bool IsVisibleForUSer(User user)
    {
        return Public || Published && VisibleTo.Contains(user);
    }
    
    public void AddUser(User user)
    {
        VisibleTo.Add(user);
    }

    public void RemoveUser(User user)
    {
        VisibleTo.Remove(user);
    }

    public bool IsEmpty()
    {
        return VisibleTo.Count == 0;
    }
    
}