using System.ComponentModel.DataAnnotations;

namespace GameList.Domain;

public class Player
{
    public Guid Id { get; set; } = Guid.NewGuid();

    [MaxLength(16)]
    public string? DisplayName { get; set; }

    [MaxLength(24)]
    public string Username { get; set; } = string.Empty;

    [MaxLength(24)]
    public string NormalizedUsername { get; set; } = string.Empty;

    public byte[] PasswordHash { get; set; } = Array.Empty<byte>();
    public byte[] PasswordSalt { get; set; } = Array.Empty<byte>();

    public DateTimeOffset? LastLoginAt { get; set; }
    public bool IsAdmin { get; set; }

    public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;

    public ICollection<Suggestion> Suggestions { get; set; } = new List<Suggestion>();
    public ICollection<Vote> Votes { get; set; } = new List<Vote>();
}
