package com.izouma.jmrh.domain;

import com.izouma.jmrh.enums.AuditStatus;
import com.izouma.jmrh.enums.ResSnDType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;

@Data
@Entity
@ApiModel("审核记录")
public class AuditHistory extends BaseEntity {

    @ApiModelProperty(name = "title")
    private String title;

    @ApiModelProperty("记录类型")
    @Enumerated(EnumType.STRING)
    private ResSnDType recordType;

    @OneToOne
    @JoinColumn(name = "userId")
    @ApiModelProperty(name = "审核人")
    private User user;

    @ApiModelProperty(name = "发布人")
    @OneToOne
    @JoinColumn(name = "toUserId")
    private User toUser;

    @ApiModelProperty(name = "企业认证")
    @Transient
    private OrgInfo orgInfo;

    @ApiModelProperty(name = "文章")
    @Transient
    private Article article;

    @ApiModelProperty(name = "话题")
    @Transient
    private Post post;

    @Transient
    @ApiModelProperty(name = "资源供需")
    private ResourceSupplyAndDemand resourceSupplyAndDemand;

    @ApiModelProperty(name = "拒绝描述")
    private String refuseDesc;

    @ApiModelProperty("审核状态")
    @Enumerated(EnumType.STRING)
    private AuditStatus status;
}
