package com.cool.store.enums;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.cool.store.enums.OperateLogFieldValueEnum.*;

/**
 * @author zhangchenbiao
 * @FileName: OperateTypeEnum
 * @Description:
 * @date 2023-06-27 10:41
 */
public enum OperateTypeEnum {

    EC_SYNC_ADD_LINE("ec_sync_add_line", "ec同步新增线索", Arrays.asList(MOBILE,OPERATE_TIME, OPERATE_USER_ID, OPERATE_USER_NAME)),
    ADD_LINE("add_line", "新增线索", Arrays.asList(MOBILE,OPERATE_TIME, OPERATE_USER_ID, OPERATE_USER_NAME)),
    ALLOCATION_INVESTMENT_MANAGER("allocation_investment_manager", "分配招商经理", Arrays.asList(ALLOCATION_USERID,ALLOCATION_USERNAME, MOBILE, OPERATE_TIME)),
    ADD_BLACKLIST("add_blacklist", "加入黑名单", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REASON)),
    REMOVE_BLACKLIST("remove_blacklist", "移除黑名单", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REASON)),
    CLOSE_FOLLOW("close_follow", "结束跟进", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REJECT_PUBLIC_REASON, REJECT_REAL_REASON, CERTIFY_FILE)),
    TRANSFER_INVESTMENT_MANAGER("transfer_investment_manager", "转让招商经理", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INVESTMENT_MANAGER_USERNAME, BEFORE_INVESTMENT_MANAGER_MOBILE, AFTER_INVESTMENT_MANAGER_USERNAME, AFTER_INVESTMENT_MANAGER_MOBILE)),
    INTERVIEW_APPOINTMENT("interview_appointment", "预约面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
    INTERVIEW_APPOINTMENT_AGREEMENT("interview_appointment_agreement", "同意面试预约申请", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, INTERVIEW_AGREEMENT_RAW_DATETIME, INTERVIEW_PLAN_ID)),
    AUTO_OPEN_INTERVIEW("auto_open_interview", "自动打开面试房间", Arrays.asList(OPERATE_TIME)),
    INTERVIEWER_BOOK_INTERVIEW("interviewer_book_interview", "招商经理主动预约面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
    MODIFY_INTERVIEW_TIME("modify_interview_time", "修改面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INTERVIEW_TIME, AFTER_INTERVIEW_TIME)),
    ENTRUST_OTHERS("entrust_others", "委托他人", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, BEFORE_INTERVIEWR_NAME, AFTER_INTERVIEWR_NAME, BEFORE_INTERVIEWR_MOBILE, AFTER_INTERVIEWR_MOBILE)),

    FINISH_INTERVIEW("finish_interview", "合作资格面试-结束面试", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),

    REINTERVIEW("reinterview", "合作资格面试-重新预约面试", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,REJECT_REAL_REASON, CERTIFY_FILE)),

    REJECT_INTERVIEW("reject_interview", "合作资格面试-拒绝并结束跟进", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REJECT_PUBLIC_REASON,REJECT_REAL_REASON, CERTIFY_FILE)),
    CREATE_QUALIFYVERIFY("create_qualifyverify", "合作资格面试-创建资格审核", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
    EXHIBITION_CREATE_QUALIFYVERIFY("exhibition_create_qualifyverify", "会销资格面试-创建资格审核", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
    QUALIFYVERIFY_PASS("qualifyverify_pass", "合作资格面试-审核通过", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
    QUALIFYVERIFY_REJECT("qualifyverify_reject", "合作资格面试-审核拒绝", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),

    USERINFO_UPDATE("userinfo_update", "修改（修改意向信息）", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_USERINFO_UPDATE, AFTER_USERINFO_UPDATE)),
    INTENT_INFO_SUBMIT("intent_info_submit", "提交意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, AFTER_BASE_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)),
    INTENT_INFO_UPDATE("intent_info_update", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_BASE_INFO_UPDATE, AFTER_BASE_INFO_UPDATE, BEFORE_INTENT_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, BEFORE_CLERK_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)),
    ADD_TAGS("add_tags", "修改用户画像", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, ADD_LABELS, REMOVE_LABELS)),
    ADD_FOLLOW_LOG("add_follow_log", "新增根据日志", Arrays.asList(FOLLOW_LOG)),
    ADD_FOLLOW_TASK("add_follow_task", "新增跟进任务", Arrays.asList(FOLLOW_TASK_ID)),

    CALL_UP("call_up", "拨打电话", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, OPERATE_TIME, CALL_TRANS_NO,INCOMING_USER_ID,INCOMING_USER_NAME)),

    ;

    private String code;

    private String name;

    private List<OperateLogFieldValueEnum> filedList;

    private static Map<String, OperateTypeEnum> operateTypeEnumMap;

    static {
        operateTypeEnumMap = new HashMap<>();
        for (OperateTypeEnum operateTypeEnum : OperateTypeEnum.values()) {
            operateTypeEnumMap.put(operateTypeEnum.getCode(), operateTypeEnum);
        }
    }

    OperateTypeEnum(String code, String name, List<OperateLogFieldValueEnum> filedList) {
        this.code = code;
        this.name = name;
        this.filedList = filedList;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public List<OperateLogFieldValueEnum> getFiledList() {
        return filedList;
    }

    public static OperateTypeEnum getOperateTypeEnum(String code) {
        return operateTypeEnumMap.get(code);
    }
}
