using Hotline.Share.Tools;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XF.Domain.Repository;

namespace Hotline.Snapshot;

/// <summary>
/// 社区信息
/// 定期从网格员系统获取
/// </summary>
[Description("社区信息")]
public class CommunityInfo : CreationSoftDeleteEntity
{
    /// <summary>
    /// 社区名称
    /// </summary>
    [SugarColumn(ColumnDescription = "社区名称")]
    public string Name { get; set; }

    /// <summary>
    /// 社区全称
    /// </summary>
    [SugarColumn(ColumnDescription = "社区全称")]
    public string FullName { get; set; }

    /// <summary>
    /// 部门编号
    /// </summary>
    [SugarColumn(ColumnDescription = "部门编号")]
    public string? DepartmentNo { get; set; }

    /// <summary>
    /// 父社区Code
    /// </summary>
    [SugarColumn(ColumnDescription = "父社区Code")]
    public string? ParentCode { get; set; }

    /// <summary>
    /// 社区唯一
    /// </summary>
    [SugarColumn(ColumnDescription = "社区唯一")]
    public string UniqueKey { get; set; }

    public string GetUniqueKey()
    {
        return $"{Id}{Name}{FullName}{ParentCode}".GetMD5();
    }
}
