95 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AspNetCore.Security.Jwt;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MyCore.Models.MyControlPanel;
namespace MyCore.Models
{
/// <summary>
/// User Information
/// </summary>
public class UserInfo : IAuthenticationUser
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
[BsonElement("Role")]
public string Role { get; set; }
[BsonElement("Email")]
[BsonRequired]
public string Email { get; set; } // UNIQUE !..
[BsonElement("Password")]
[BsonRequired]
public string Password { get; set; }
[BsonElement("FirstName")]
[BsonRequired]
public string FirstName { get; set; }
[BsonElement("LastName")]
[BsonRequired]
public string LastName { get; set; }
[BsonElement("Token")]
[BsonRequired]
public string Token { get; set; }
[BsonElement("Birthday")]
public DateTime Birthday { get; set; }
[BsonElement("DateCreation")]
public DateTime DateCreation { get; set; }
[BsonElement("Address")]
public string Address { get; set; }
[BsonElement("City")]
public string City { get; set; }
[BsonElement("State")]
public string State { get; set; }
[BsonElement("Country")]
public string Country { get; set; }
[BsonElement("Language")]
[BsonRequired]
public string Language { get; set; }
[BsonElement("TimeZone")]
public string TimeZone { get; set; }
[BsonElement("PostalCode")]
public int PostalCode { get; set; }
[BsonElement("Automations")]
public Automation[] Automations { get; set; }
[BsonElement("Devices")]
public Device[] Devices { get; set; }
[BsonElement("Providers")]
public Provider[] Providers { get; set; }
[BsonElement("Groups")]
public Group[] Groups { get; set; }
// TODO
/*[BsonElement("ScreenConfigurationIds")]
public ScreenConfiguration[] ScreenConfigurationIds { get; set; }
[BsonElement("DeviceIds")]
public ScreenDevice[] DeviceIds { get; set; }*/
}
}