using Microsoft.AspNetCore.Identity;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FoodShop.Models
{
    public class ApplicationUser : IdentityUser
    {
        //extended info
        [Required]
        [Display(Name = "Nome"), StringLength(256, MinimumLength = 0)]
        public string Name { get; set; }

        //[Required]
        [Display(Name = "Indirizzo"), StringLength(256, MinimumLength = 0)]
        public string Address { get; set; }

        //[Required]
        [Display(Name = "Codice Postale"), StringLength(16, MinimumLength = 0)]
        public string PostalCode { get; set; }

        //[Required]
        [Display(Name = "Città"), StringLength(256, MinimumLength = 0)]
        public string City { get; set; }

        //[Required]
        [Display(Name = "Stato/Regione"), StringLength(2, MinimumLength = 0)]
        public string State { get; set; }

        [Required]
        [Display(Name = "Nazione"), StringLength(256, MinimumLength = 0)]
        public string Country { get; set; }

        //[Required]
        [Display(Name = "C.Fiscale o P.IVA"), StringLength(16, MinimumLength = 0)]
        public string FiscalCode { get; set; }

        [Display(Name = "Visualizza Email negli Annunci e Blog"), DefaultValue(true)]
        public bool ConsensoViewEmail { get; set; }

        [Display(Name = "Consenso al caricamento dei Cookie del Sito"), DefaultValue(false)]
        public bool ConsensoCookie { get; set; }

        [Display(Name = "Spedisci Email"), DefaultValue(false)]
        public bool SendEmail { get; set; }

        [Display(Name = "Ha dei Ruoli assegnati"), DefaultValue(false)]
        public bool HasRoles { get; set; }

        [DisplayName("Data di Registrazione")]
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = false)]
        [Column(TypeName = "datetime2")]
        public DateTime EntryDate { get; set; }
    }
}
