using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hotline.Orders;
using Hotline.Quality;
using Hotline.Share.Enums.Order;
using Hotline.Share.Enums.Snapshot;
using Hotline.Snapshot;
using SqlSugar;
using XF.Domain.Repository;

namespace Hotline.Orders
{
	[Description("市民")]
	public class Citizen : FullStateEntity
	{
		/// <summary>
		/// 电话
		/// </summary>
		[SugarColumn(ColumnDescription = "电话")]
		public string PhoneNumber { get; set; }

		/// <summary>
		/// 姓名
		/// </summary>
		[SugarColumn(ColumnDescription = "姓名")]
		public string? Name { get; set; }

		/// <summary>
		/// 性别
		/// </summary>
		[SugarColumn(ColumnDescription = "性别")]
		public EGender? Gender { get; set; }

		/// <summary>
		/// 市民身份
		/// </summary>
		[SugarColumn(ColumnDescription = "市民身份")]
		public EIdentityType? IdentityType { get; set; }

        /// <summary>
        /// 证件类型
        /// </summary>
        [SugarColumn(ColumnDescription = "证件类型")]
        public string? LicenceType { get; set; }

		/// <summary>
		/// 证件号码
		/// </summary>
		[SugarColumn(ColumnDescription = "证件号码")]
		public string? LicenceNo { get; set; }

		/// <summary>
		/// 年龄段
		/// </summary>
		[SugarColumn(ColumnDescription = "年龄段")]
		public string? AgeRange { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(ColumnDescription = "联系电话")]
        public string? Contact { get; set; }

        [SugarColumn(ColumnDescription = "联系电话脱敏")]
        public string? ContactMask { get; set; }

        /// <summary>
        /// 市民标签
        /// </summary>
        [SugarColumn(ColumnDescription = "市民标签", ColumnDataType = "text")]
        public string? Label { get; set; }

		/// <summary>
		/// 更新人
		/// </summary>
		[SugarColumn(ColumnDescription = "更新人")]
		public string? LastModificationName { get; set; }

		/// <summary>
		/// 首次来电时间
		/// </summary>
		[SugarColumn(ColumnDescription = "首次来电时间")]
		public DateTime? FirstCallTime { get; set; }

		/// <summary>
		/// 标签记录
		/// </summary>
		[Navigate(NavigateType.OneToMany, nameof(CitizenLabelDetail.CitizenId))]
		public List<CitizenLabelDetail> labelDetails { get; set; }

        #region 随手拍
        /// <summary>
        /// 用户自己填的邀请码
        /// </summary>
        [SugarColumn(ColumnDescription = "用户自己填的邀请码")]
        public string? InvitationCode { get; set; }

        /// <summary>
        /// 历史已经领取金额总和(单位:元)
        /// </summary>
        [SugarColumn(ColumnDescription = "历史已经领取金额总和(单位:元)")]
        public double? TotalAmount { get; set; }

        /// <summary>
        /// 用户类型
        /// 注册时根据手机号码判断是否是 网格员
        /// </summary>
        [SugarColumn(ColumnDescription = "用户类型")]
        public EReadPackUserType? CitizenType { get; set; }

		/// <summary>
		/// 是否安全卫士
		/// </summary>
		[SugarColumn(ColumnDescription = "是否安全卫士")]
        public bool? IsSecurityMax { get; set; }
        #endregion

		[Navigate(typeof(CitizenRelationSafetyType), nameof(CitizenRelationSafetyType.CitizenId), nameof(CitizenRelationSafetyType.SafetyTypeId))]
        public List<SafetyType> SafetyTypes { get; set; }
    }
}
