yavsc/Yavsc/Models/Identity/ApplicationUser.cs

98 lines
2.9 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using Microsoft.AspNet.Identity.EntityFramework;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models
{
2017-01-19 12:59:49 +01:00
using Models.Relationship;
using Models.Identity;
using Models.Chat;
using Models.Bank;
using Models.Access;
2017-02-21 20:49:07 +01:00
using Newtonsoft.Json;
public class ApplicationUser : IdentityUser
{
2016-09-23 12:29:50 +02:00
/// <summary>
/// Another me, as a byte array.
/// This value points a picture that may be used
/// to sign documents.
/// </summary>
/// <returns>the path to an user's image, relative to it's dir<summary>
/// <see>Startup.UserFilesOptions</see>
/// </summary>
/// <returns></returns>
2017-02-01 19:53:10 +01:00
[MaxLength(512),Required]
2016-09-23 12:29:50 +02:00
public string Avatar { get; set; }
2016-10-23 01:31:09 +02:00
[MaxLength(512)]
public string FullName { get; set; }
2016-09-23 12:29:50 +02:00
/// <summary>
/// WIP Paypal
/// </summary>
/// <returns></returns>
[Display(Name="Account balance")]
public virtual AccountBalance AccountBalance { get; set; }
2016-09-23 12:29:50 +02:00
/// <summary>
/// User's posts
/// </summary>
/// <returns></returns>
2017-02-21 20:49:07 +01:00
[InverseProperty("Author"),JsonIgnore]
public virtual List<Blog> Posts { get; set; }
2016-09-23 12:29:50 +02:00
/// <summary>
/// User's contact list
/// </summary>
/// <returns></returns>
2017-02-21 20:49:07 +01:00
[InverseProperty("Owner"),JsonIgnore]
public virtual List<Contact> Book { get; set; }
2016-09-23 12:29:50 +02:00
/// <summary>
/// External devices using the API
/// </summary>
/// <returns></returns>
2017-02-21 20:49:07 +01:00
[InverseProperty("DeviceOwner"),JsonIgnore]
public virtual List<GoogleCloudMobileDeclaration> Devices { get; set; }
2017-02-21 20:49:07 +01:00
[InverseProperty("Owner"),JsonIgnore]
2016-11-03 14:52:17 +01:00
public virtual List<Connection> Connections { get; set; }
2016-11-01 23:22:46 +01:00
2016-09-23 12:29:50 +02:00
/// <summary>
/// User's circles
/// </summary>
/// <returns></returns>
2017-02-21 20:49:07 +01:00
[InverseProperty("Owner"),JsonIgnore]
public virtual List<Circle> Circles { get; set; }
2016-09-23 12:29:50 +02:00
/// <summary>
/// Billing postal address
/// </summary>
/// <returns></returns>
public virtual Location PostalAddress { get; set; }
2016-09-23 12:29:50 +02:00
/// <summary>
/// User's Google calendar
/// </summary>
/// <returns></returns>
public string DedicatedGoogleCalendar { get; set; }
public override string ToString() {
return this.Id+" "+this.AccountBalance?.Credits.ToString()+this.Email+" "+this.UserName+" $"+this.AccountBalance?.Credits.ToString();
}
2016-11-04 13:55:48 +01:00
public BankIdentity BankInfo { get; set; }
2016-11-30 11:05:10 +01:00
public long DiskQuota { get; set; } = 512*1024*1024;
public long DiskUsage { get; set; } = 0;
2017-02-21 20:49:07 +01:00
[JsonIgnore]
public virtual List<BlackListed> BlackList { get; set; }
}
}