package com.izouma.dingdong.domain.backstage;

import com.izouma.dingdong.domain.BaseEntity;
import com.izouma.dingdong.enums.CooperateType;
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;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "合作申请", description = "合作申请")
@Where(clause = "enabled = 1")
public class CooperateApply extends BaseEntity {
    @ApiModelProperty(value = "用户ID", name = "userId")
    private Long userId;

    /**
     * 商家/骑手/商务
     */
    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "类型", name = "type")
    private CooperateType type;

    @ApiModelProperty(value = "名称", name = "name")
    private String name;

    @ApiModelProperty(value = "联系电话", name = "phone")
    private String phone;

    /**
     * 商家合作/骑手合作 填写的地址
     */
    @ApiModelProperty(value = "地址", name = "address")
    private String address;

    /**
     * 商家合作时，填写商家名称
     */
    @ApiModelProperty(value = "商家名称", name = "merName")
    private String merName;

    /**
     * 商家合作时，填写商家经营类型
     */
    @ApiModelProperty(value = "商家类型", name = "category")
    private String category;

    /**
     * 商务合作时，填写期望合作内容
     */
    @ApiModelProperty(value = "合作内容",name = "remark")
    private String remark;

    @ApiModelProperty(value = "是否联系", name = "isPass")
    private Boolean isPass;

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