package me.zhengjie.modules.company.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;

@Entity
@Getter
@Setter
@Table(name = "sys_company")
public class Company extends BaseEntity {
    @Id
    @Column(name = "company_id")
    @NotNull(groups = Update.class)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "ID", hidden = true)
    private Long id;

    @NotNull
    @Column(unique = true)
    @ApiModelProperty(value = "公司编码")
    private String code;

    @NotBlank
    @Column(unique = true)
    @ApiModelProperty(value = "公司名称")
    private String name;

    @NotNull
    @ApiModelProperty(value = "公司类别", hidden = true)
    private String type;

    public @interface Update {
    }
}
