using Hotline.Share.Enums.Snapshot;
using SqlSugar;
using System.ComponentModel;
using XF.Domain.Repository;
using Hotline.Orders;
using Hotline.Share.Enums.User;

namespace Hotline.Snapshot;

/// <summary>
/// 随手拍用户微信小程序登录信息
/// </summary>
[Description("小程序账号信息")]
public class ThirdAccount : CreationSoftDeleteEntity
{
    /// <summary>
    /// 关联用户信息
    /// 如果是市民: 关联 <inheritdoc cref="Citizen"/>
    /// 如果是网格员: 关联 <inheritdoc cref="GuiderInfo"/>
    /// </summary>
    [SugarColumn(ColumnDescription = "关联用户信息")]
    public string? UserId { get; set; }

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

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

    /// <summary>
    /// 第三方平台的Id
    /// 例如: 微信的OpenId
    /// </summary>
    [SugarColumn(ColumnDescription = "第三方平台的Id")]
    public string OpenId { get; set; }

    /// <summary>
    /// 第三方平台的SessionKey
    /// 例如: 微信SessionKey
    /// </summary>
    [SugarColumn(ColumnDescription = "第三方平台的SessionKey")]
    public string? SessionKey { get; set; }

    /// <summary>
    /// 账号类型
    /// </summary>
    public EThirdType AccountType { get; set; }

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

    /// <summary>
    /// 用户头像Url
    /// </summary>
    [SugarColumn(ColumnDescription = "用户头像Url")]
    public string? HeadImgUrl { get; set; }

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

    /// <summary>
    /// 用户昵称
    /// </summary>
    [SugarColumn(ColumnDescription = "用户昵称")]
    public string? UserName { get; set; }
}
