using System.ComponentModel.DataAnnotations;

namespace planli.backend.planli.db.Model
{
    public class User
    {
        [Key]
        public int Id { get; set; }
        
        [Required]
        public required string Name { get; set; }

        [Required]
        public required string Email { get; set; }

        [Required]
        public required string Password { get; set; }

        public ICollection<BoardMember> BoardMemberships { get; set; } = new List<BoardMember>();

        // Refresh token (rotated on every use)
        public string?   RefreshToken       { get; set; }
        public DateTime? RefreshTokenExpiry  { get; set; }
    }
}
