using Hotline.Share.Enums.Order;
using Hotline.Share.Requests;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hotline.Share.Dtos.Order
{
	public class CitizenAddDto
	{
		/// <summary>
		/// 电话
		/// </summary>
		public string PhoneNumber { get; set; }

		/// <summary>
		/// 姓名
		/// </summary>
		public string? Name { get; set; }

		/// <summary>
		/// 性别
		/// </summary>
		public EGender? Gender { get; set; }

		/// <summary>
		/// 市民身份
		/// </summary>
		public EIdentityType? IdentityType { get; set; }

		/// <summary>
		/// 证件类型
		/// </summary>
		public string? LicenceType { get; set; }

		/// <summary>
		/// 证件号码
		/// </summary>
		public string? LicenceNo { get; set; }

		/// <summary>
		/// 年龄段
		/// </summary>
		public string? AgeRange { get; set; }

		/// <summary>
		/// 联系电话
		/// </summary>
		public string? Contact { get; set; }

		/// <summary>
		/// 联系电话脱敏
		/// </summary>
		public string? ContactMask { get; set; }

		/// <summary>
		/// 市民标签
		/// </summary>
		public string? Label { get; set; }

		/// <summary>
		/// 更新人
		/// </summary>
		public string? LastModificationName { get; set; }

		/// <summary>
		/// 首次来电时间
		/// </summary>
		public DateTime? FirstCallTime { get; set; }

		/// <summary>
		/// 标签记录明细
		/// </summary>
		List<LabelDetailAddDto> labelDetails { get; set; }
	}
	public class CitizenDeleteDto
	{
		public string Id { get; set; }
	}
	public class CitizenUpdateDto : CitizenAddDto
	{
		public string Id { get; set; }
	}
	public record CitizenListDto : PagedKeywordRequest
	{
		/// <summary>
		/// 电话
		/// </summary>
		public string? PhoneNumber { get; set; }

		/// <summary>
		/// 市民标签
		/// </summary>
		public string? Label { get; set; }
	}
	public class CitizenBaseDto
	{
		public DateTime? LastModificationTime { get; set; }

		public bool IsDeleted { get; set; }

		/// <summary>
		/// 删除时间
		/// </summary>
		public DateTime? DeletionTime { get; set; }


		/// <summary>
		/// 创建时间
		/// </summary>
		public DateTime CreationTime { get; set; }

		public string Id { get; set; }

		/// <summary>
		/// 组织Id
		/// </summary>
		public string? CreatorOrgId { get; set; }


		public string? CreatorOrgName { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		public string? CreatorId { get; set; }

		public string? CreatorName { get; set; }
	}

	public class CitizenDto : CitizenBaseDto
	{
		/// <summary>
		/// 电话
		/// </summary>
		public string PhoneNumber { get; set; }

		/// <summary>
		/// 姓名
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// 性别
		/// </summary>
		public EGender Gender { get; set; }

		/// <summary>
		/// 市民身份
		/// </summary>
		public EIdentityType IdentityType { get; set; }

		/// <summary>
		/// 证件类型
		/// </summary>
		public string? LicenceType { get; set; }

		/// <summary>
		/// 证件号码
		/// </summary>
		public string? LicenceNo { get; set; }

		/// <summary>
		/// 年龄段
		/// </summary>
		public string? AgeRange { get; set; }

		/// <summary>
		/// 联系电话
		/// </summary>
		public string? Contact { get; set; }

		/// <summary>
		/// 联系电话脱敏
		/// </summary>
		public string? ContactMask { get; set; }

		/// <summary>
		/// 市民标签
		/// </summary>
		public string? Label { get; set; }

		/// <summary>
		/// 更新人
		/// </summary>
		public string? LastModificationName { get; set; }

		/// <summary>
		/// 首次来电时间
		/// </summary>
		public DateTime? FirstCallTime { get; set; }

		List<LabelDetailDto> labelDetails { get; set; }

	}

	public class LabelDetailAddDto
	{

		/// <summary>
		/// 市民id
		/// </summary>
		public string CitizenId { get; set; }

		/// <summary>
		/// 市民标签
		/// </summary>
		public string? Label { get; set; }
	}

	public class LabelDetailDeleteDto
	{
		public string Id { get; set; }
	}

	public class LabelDetailDto : CitizenBaseDto
	{

		/// <summary>
		/// 市民id
		/// </summary>
		public string CitizenId { get; set; }

		/// <summary>
		/// 市民标签
		/// </summary>
		public string? Label { get; set; }

		public CitizenDto Citizen { get; set; }

		public string Phone => Citizen.PhoneNumber;
	}
	public record CitizenQueryDto : PagedKeywordRequest
	{
		/// <summary>
		/// 市民id
		/// </summary>
		public string? CitizenId { get; set; }

		/// <summary>
		/// 市民标签
		/// </summary>
		public string? Label { get; set; }

		public string? CreatorName { get; set; }
	}
}
