using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using Newtonsoft.Json;

namespace TFC.Models
{
    public class User
    {
        [Key]
        public virtual Guid UserId { get; set; }

        [Required]
        public virtual String Username { get; set; }
        
        public virtual String Email { get; set; }
        [Display(Name="Contraseña")]
        [XmlIgnore, IgnoreDataMember]
        public virtual String Password { get; set; }
        public virtual String FirstName { get; set; }
        public virtual String LastName { get; set; }

        public virtual String NIF { get; set; }
        public virtual DateTime? Birth { get; set; }

        public string Adress { get; set; }
        public int? Weight { get; set; }

        [Display(Name = "Altura")]
        public int? Height { get; set; }

        [DataType(DataType.MultilineText)]
        [Display(Name = "Obsevaciones")]
        public virtual String Comment { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual Boolean IsApproved { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual int PasswordFailuresSinceLastSuccess { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual DateTime? LastPasswordFailureDate { get; set; }
        [Display(Name = "Última conexión")]
        public virtual DateTime? LastActivityDate { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual DateTime? LastLockoutDate { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual DateTime? LastLoginDate { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual String ConfirmationToken { get; set; }
        public virtual DateTime? CreateDate { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual Boolean IsLockedOut { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual DateTime? LastPasswordChangedDate { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual String PasswordVerificationToken { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public virtual DateTime? PasswordVerificationTokenExpirationDate { get; set; }
        [XmlIgnore, IgnoreDataMember]
        [Display(Name = "¿Recordar cuenta?")]
        public bool RememberMe { get; set; }
        [XmlIgnore, IgnoreDataMember]
        public User ParentUser { get; set; }
        [XmlIgnore, IgnoreDataMember, JsonIgnore]
        public virtual ICollection<Role> Roles { get; set; }
        [XmlIgnore, IgnoreDataMember, JsonIgnore]
        public virtual ICollection<Training> Trainings { get; set; }
    }
}