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

import com.zhongshu.card.client.type.Sex;
import com.zhongshu.card.client.type.common.AuditState;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import com.zhongshu.card.server.core.domain.org.Department;
import com.zhongshu.card.server.core.domain.org.OrganizationUser;
import com.zhongshu.card.server.core.domain.org.UserAccount;
import com.zhongshu.card.server.core.domain.school.DictInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 项目人脸信息
 *
 * @author TRX
 * @date 2024/10/12
 */
@Data
@Builder
@Document
@AllArgsConstructor
@NoArgsConstructor
public class OrgUserFace extends SuperMain {

    @Schema(description = "审核状态")
    private AuditState auditState = AuditState.WaitAudit;

    //-----------------用户信息 start -----------------
    @Schema(description = "用户ID")
    private String userId;

    @Schema(description = "用户名称")
    private String userName;

    @Schema(description = "用户电话")
    private String phone;

    @Schema(description = "用户信息")
    @DBRef(lazy = true)
    private UserAccount userAccount;

    @Schema(description = "项目机构用户信息")
    @DBRef(lazy = true)
    private OrganizationUser organizationUser;

    @Schema(description = "图片名称")
    private String name;

    @Schema(description = "人脸图片地址")
    private String img;

    @Schema(description = "是否可使用")
    private Boolean isCanUsed = Boolean.FALSE;

    private BigDecimal confidence = BigDecimal.ZERO;

    //------------------------人脸冗余信息 start-------------

    @Schema(description = "用户所属机构")
    private String userOrgOid;

    @Schema(description = "所属部门")
    @DBRef(lazy = true)
    private Department department;

    @Schema(description = "角色")
    private List<String> roleIds = new ArrayList<>();

    @Schema(description = "职位")
    @DBRef(lazy = true)
    private DictInfo position;

    @Schema(description = "人员编码")
    private String code;

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

    //------------------------审核信息 start ---------------

    @Schema(description = "审核用户userId")
    private String auditUserId;

    @Schema(description = "审核备注")
    private String auditRemark;

    @Schema(description = "审核时间")
    private Long auditTime;

    @Schema(description = "权限中心的人脸id")
    private String updateFaceFileId;

}
