using System.Collections.Generic; using Microsoft.AspNet.Identity.EntityFramework; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Yavsc.Models { using Models.Relationship; using Models.Identity; using Models.Chat; using Models.Bank; using Models.Access; using Newtonsoft.Json; public class ApplicationUser : IdentityUser { /// /// Another me, as a byte array. /// This value points a picture that may be used /// to present the user /// /// the path to an user's image, relative to it's user dir /// Startup.UserFilesOptions /// /// [MaxLength(512)] public string Avatar { get; set; } [MaxLength(512)] public string FullName { get; set; } /// /// WIP Paypal /// /// [Display(Name="Account balance")] public virtual AccountBalance AccountBalance { get; set; } /// /// User's posts /// /// [InverseProperty("Author"),JsonIgnore] public virtual List Posts { get; set; } /// /// User's contact list /// /// [InverseProperty("Owner"),JsonIgnore] public virtual List Book { get; set; } /// /// External devices using the API /// /// [InverseProperty("DeviceOwner"),JsonIgnore] public virtual List Devices { get; set; } [InverseProperty("Owner"),JsonIgnore] public virtual List Connections { get; set; } /// /// User's circles /// /// [InverseProperty("Owner"),JsonIgnore] public virtual List Circles { get; set; } /// /// Billing postal address /// /// [ForeignKeyAttribute("PostalAddressId")] public virtual Location PostalAddress { get; set; } public long? PostalAddressId { get; set; } /// /// User's Google calendar /// /// [MaxLength(512)] public string DedicatedGoogleCalendar { get; set; } public override string ToString() { return this.Id+" "+this.AccountBalance?.Credits.ToString()+this.Email+" "+this.UserName+" $"+this.AccountBalance?.Credits.ToString(); } public BankIdentity BankInfo { get; set; } public long DiskQuota { get; set; } = 512*1024*1024; public long DiskUsage { get; set; } = 0; public long MaxFileSize { get; set; } = 512*1024*1024; [JsonIgnore][InverseProperty("Owner")] public virtual List BlackList { get; set; } public bool AllowMonthlyEmail { get; set; } = false; } }