package com.izouma.dingdong.domain.backstage;

import com.izouma.dingdong.domain.BaseEntity;
import com.izouma.dingdong.enums.Identity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.time.LocalDateTime;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Where(clause = "enabled = 1")
@ApiModel(value = "黑名单表", description = "黑名单")
public class BlackList extends BaseEntity {
    @ApiModelProperty(value = "用户ID", name = "userId")
    private Long userId;

    //骑手ID或商户ID
    @ApiModelProperty(value = "其他ID", name = "otherId")
    private Long otherId;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "身份", name = "identity")
    private Identity identity;

    @ApiModelProperty(value = "移入时间", name = "moveTime")
    private LocalDateTime moveTime;

    @ApiModelProperty(value = "缘由", name = "reason")
    private String reason;

    @ApiModelProperty(value = "移除", name = "remove")
    private Boolean remove;

    @ApiModelProperty(value = "移出时间", name = "removeTime")
    private LocalDateTime removeTime;

    @Column(nullable = false)
    private Boolean enabled = true;
}
