package com.zhongshu.card.client.model.attendance;

import com.zhongshu.card.client.model.org.UserCountModel;
import com.zhongshu.card.client.type.LeaveStatus;
import com.zhongshu.card.client.type.visitor.VisitorState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.stereotype.Indexed;

import java.util.List;

@Data
public class LeaveApprovalModel {

    private String leaveName;

    private String id;

    private Long createTime;

    private Long updateTime;

    private String projectId;

    //场景id
    private String sceneId;

    //请假类型
    private String leaveType;

    private Long startTime;

    private Long endTime;

    //请假原因
    private String leaveReason;

    //图片
    private List<String> pic;

    //审批人
    private UserCountModel approvalUser;

    //审核状态
    private LeaveStatus leaveStatus;

    //审核状态信息
    private String leaveStatusStr;

    @Schema(description = "是否显示警告红点")
    private Boolean isWarning = Boolean.FALSE;

    public Boolean getIsWarning() {
        if (leaveStatus != null) {
            if (leaveStatus != LeaveStatus.Pass) {
                return Boolean.TRUE;
            }
        }
        return Boolean.FALSE;
    }

    public String getLeaveStatusStr() {
        if (leaveStatus != null) {
            return leaveStatus.getRemark();
        }
        return null;
    }

    private Long approvalTime;

    //审核意见
    private String approvalRemark;

    //请假人
    private UserCountModel leaveUser;
}
