package com.izouma.jmrh.domain;

import com.izouma.jmrh.annotations.Searchable;
import com.izouma.jmrh.converter.FileObjectListConverter;
import com.izouma.jmrh.converter.LongArrayConverter;
import com.izouma.jmrh.enums.ApprovalStatus;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.List;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("审批")
public class Approval extends BaseEntity {

    @Searchable
    private String name;

    @Convert(converter = FileObjectListConverter.class)
    @Column(columnDefinition = "TEXT")
    private List<FileObject> attach;

    @Searchable
    private String creator;

    @Enumerated(EnumType.STRING)
    private ApprovalStatus status;

    private String currentApprover;

    @Convert(converter = LongArrayConverter.class)
    private List<Long> approver1;

    @Convert(converter = LongArrayConverter.class)
    private List<Long> approver2;

    @Convert(converter = LongArrayConverter.class)
    private List<Long> approver3;

    @Convert(converter = LongArrayConverter.class)
    private List<Long> approver4;

    @Convert(converter = LongArrayConverter.class)
    private List<Long> approver5;
}
