package com.zhongshu.card.server.core.domain.org;

import com.zhongshu.card.client.type.*;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 用户账号信息
 *
 * @author TRX
 * @date 2024/5/30
 */
@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Builder
public class UserAccount extends SuperMain {

    // ----------------------------用户基本信息
    @Schema(description = "用户ID（由鉴权中心颁发）")
    @Indexed
    private String userId;

    @Schema(description = "登录名")
    @Indexed(unique = true)
    private String loginName;

    @Schema(description = "用户手机号")
    private String phone;

    @Schema(description = "昵称")
    @Indexed
    private String name;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "用户名  用户真实姓名的拼音")
    @Indexed
    private String spellCode;

    @Schema(description = "头像")
    private String profilePic;

    @Schema(description = "性别")
    private Sex sex;

    @Schema(description = "地址")
    private String address;

    @Schema(description = "证件类型")
    private CertificateType certificateType = CertificateType.IDCard;

    @Schema(description = "证件号码")
    private String cardNumber;

    @Schema(description = "用户状态")
    private UserState state = UserState.Normal;

    @Schema(description = "是否已修改了密码 (登录时提示)")
    private Boolean isUpdatedPsw = Boolean.FALSE;

    @Schema(description = "是否登录过")
    private Boolean isLogined = Boolean.FALSE;

    @Schema(description = "可登录端类型")
    private UserLoginType loginType = UserLoginType.All;

    @Schema(description = "用户类型")
    private UserType userType;
}
