using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Atomx.Common.Entities
{
    [Table("CorporationStaffs")]
    public class CorporationStaff
    {
        /// <summary>
        /// 数据ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 公司ID
        /// </summary>
        public long CorporationId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Username { get; set; } = string.Empty;

        /// <summary>
        /// 登录密码
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Password { get; set; } = string.Empty;

        /// <summary>
        /// 邮箱
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Email { get; set; } = string.Empty;

        /// <summary>
        /// 手机号
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Mobile { get; set; } = string.Empty;

        /// <summary>
        /// 头像
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Avatar { get; set; } = string.Empty;

        /// <summary>
        /// 角色ID
        /// </summary>
        public int RoleId { get; set; }

        /// <summary>
        /// 时区校对
        /// </summary>
        [Column(TypeName = "varchar(4)")]
        public string TimeOffset { get; set; } = "0";

        /// <summary>
        /// 账号数据状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 登录次数
        /// </summary>
        public int LoginCount { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime? LastLogin { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [Column(TypeName = "varchar(50)")]
        public string LastIp { get; set; } = string.Empty;

        /// <summary>
        /// 数据创建时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime CreateTime { get; set; } = DateTime.UtcNow;

        /// <summary>
        /// 数据更新时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime UpdateTime { get; set; }
    }
}
