package cn.lihongjie.coal.resetPwd.entity;

import cn.lihongjie.coal.base.entity.OrgCommonEntity;
import cn.lihongjie.coal.user.entity.UserEntity;

import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;

import lombok.Data;

import org.hibernate.annotations.Comment;

import java.time.LocalDateTime;

@Data
@Entity

@jakarta.persistence.Table(indexes = @jakarta.persistence.Index(name ="idx_reset_pwd_org_id", columnList = "organization_id"))

public class ResetPwdEntity extends OrgCommonEntity {


    @ManyToOne
    private UserEntity user;


    @Comment("手机号")
    private String phone;


    @Comment("邮箱")
    private String email;


    @Comment("验证码")
    private String code;

    @Comment("最大失败次数, 超过之后需要重新获取验证码")
    private Integer maxFailCount;


    @Comment("失败次数")
    private Integer failCount;


    @Comment("过期时间")
    private LocalDateTime expireTime;

    @Comment("确认重置时间")
    private LocalDateTime confirmTime;
}