package com.cool.store.enums;

/**
 * @Author suzhuhong
 * @Date 2024/3/19 17:00
 * @Version 1.0
 */
public enum WorkflowSubStageStatusEnum {

    //意向申请
    INTENT_0(0,"待提交"),
    INTENT_5(5,"待审核"),
    INTENT_7(7,"未通过"),

    //邀约面谈
    INVITING_INTERVIEWS_10(10,"待预约"),
    INVITING_INTERVIEWS_15(15,"待面谈"),
    INVITING_INTERVIEWS_20(20,"待审核"),

    //一审面试
    FIRST_INTERVIEWS_25(25,"待预约"),
    FIRST_INTERVIEWS_30(30,"待面试"),
    FIRST_INTERVIEWS_35(35,"待审核"),
    FIRST_INTERVIEWS_40(40,"一审未通过"),
    FIRST_INTERVIEWS_42(42,"一审重新预约"),

    //缴纳意向金，装修款
    PAY_DEPOSIT_45(45,"待缴费"),
    PAY_DEPOSIT_50(50,"已缴费"),
    PAY_FAIL_55(55,"审核未通过"),

    //签署意向协议
    SIGN_INTENT_AGREEMENT_60(60,"待补充"),
    SIGN_INTENT_AGREEMENT_63(63,"待审核"),
    SIGN_INTENT_AGREEMENT_65(65,"不通过"),
    SIGN_INTENT_AGREEMENT_70(70,"待提交"),
    SIGN_INTENT_AGREEMENT_75(75,"待OA审核"),
    SIGN_INTENT_AGREEMENT_80(80,"签约失败"),


    //门店体验
    STORE_EXPERIENCE_85(85,"待体验"),
    STORE_EXPERIENCE_90(90,"体验中"),
    STORE_EXPERIENCE_95(95,"放弃体验"),


    //二审面试
    SECOND_INTERVIEWS_100(100,"待预约"),
    SECOND_INTERVIEWS_105(105,"待面试"),
    SECOND_INTERVIEWS_110(110,"待审核"),
    SECOND_INTERVIEWS_115(115,"二审未通过"),
    SECOND_INTERVIEWS_120(120,"二审重新预约"),
    SECOND_INTERVIEWS_125(125,"二审通过"),

    ;

    private Integer code;

    private String message;

    WorkflowSubStageStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static boolean isReappointmentStatus(Integer workflowSubStageStatus){
        return FIRST_INTERVIEWS_42.getCode().equals(workflowSubStageStatus) || SECOND_INTERVIEWS_120.getCode().equals(workflowSubStageStatus);
    }

    public static boolean isModifyAppointmentTime(Integer workflowSubStageStatus){
        return INVITING_INTERVIEWS_15.getCode().equals(workflowSubStageStatus) || FIRST_INTERVIEWS_30.getCode().equals(workflowSubStageStatus) || SECOND_INTERVIEWS_105.getCode().equals(workflowSubStageStatus);
    }

    public WorkflowSubStageStatusEnum getNextStatus(WorkflowSubStageStatusEnum workflowSubStageStatusEnum) {
        switch (workflowSubStageStatusEnum) {
            case INTENT_0:
                return INTENT_5;
            default:
                return null;
        }
    }

    public static WorkflowSubStageStatusEnum getInterviewRejectStatus(InterviewTypeEnum interviewType){
        if(InterviewTypeEnum.INTERVIEW.equals(interviewType)){
            return FIRST_INTERVIEWS_40;
        }
        if(InterviewTypeEnum.SECOND_INTERVIEW.equals(interviewType)){
            return SECOND_INTERVIEWS_115;
        }
        return null;
    }

}
