package vn.azteam.tpf.Constants;

import java.util.HashMap;
import java.util.Map;

public class Constants {
    public Constants() {

    }

    public static boolean ENABLE_CASBIN = true;

    public static enum ENUM_MENU_NOT_SHOW {
        QUAN_LY_DON_VI,
        PHAN_QUYEN_NGUOI_DUNG
    }

    public static String ACTIVE_TYPE_UPDATE_ENV = "ACTIVE_TYPE_UPDATE_ENV";

    public static String ACTIVE_TYPE_NURSERY = "ACTIVE_TYPE_NURSERY";

    public static String ACTIVE_TYPE_PLANTING = "ACTIVE_TYPE_PLANTING";

    public static String ACTIVE_TYPE_HARVEST = "ACTIVE_TYPE_HARVEST";

    public static String ACTIVE_TYPE_PESTS_INVESTIGATION = "ACTIVE_TYPE_PESTS_INVESTIGATION";

    public static String ACTIVE_TYPE_PLANT_REMOVAL= "ACTIVE_TYPE_PLANT_REMOVAL";

    public static String ACTIVE_TYPE_END = "ACTIVE_TYPE_END";

    public static enum ENUM_MENU_ALWAYS_SHOW {
        DASHBOARD
    }
    public static enum ENUM_MENU_INDEX {
        QUAN_LY_NGUOI_DUNG(3),
        PHAN_QUYEN_NGUOI_DUNG(11),
        QUAN_LY_CANH_TAC(1),
        QUAN_LY_THU_HOACH(2),
        QUAN_LY_CODE(4),
        BAO_CAO_THONG_KE(5),
        QUAN_LY_TIEU_CHUAN(6),
        QUAN_LY_GIONG(7),
        QUAN_LY_VAT_TU(8),
        QUAN_LY_THIET_BI(9),
        QUAN_LY_DON_VI(10),
        DASHBOARD(0);

        private final int value;
        ENUM_MENU_INDEX(final int newValue) {
            value = newValue;
        }
        public int getValue() { return value; }
    }

    public static enum ENTITY_COLOR {
        RED(0),
        PURPLE(1),
        YELLOW(2),
        BLUE(3),
        GREEN(4);

        private final int value;
        ENTITY_COLOR(final int newValue) {
            value = newValue;
        }
        public int getValue() { return value; }
    }

    public static enum DATA_ENTITY_TYPE_ID {
        BLOCK(1),
        NET_HOUSE(2),
        WAREHOUSE(3);

        private final int value;
        DATA_ENTITY_TYPE_ID(final int newValue) {
            value = newValue;
        }
        public int getValue() { return value; }
    }


    public static enum ENUM_SUPPLIES_TYPE {
        GIONG,
        PHANBON,
        THUOCBVTV,
        GIATHE
    }

    public static enum STOCK_UPDATE_ACTION {
        IMPORT(0),
        EXPORT(1);
        private final int value;
        STOCK_UPDATE_ACTION(final int newValue) {
            value = newValue;
        }
        public int getValue() { return value; }
    }

    public static enum PRODUCT_STOCK_UPDATE_ACTION {
        IMPORT(0),
        EXPORT(1);
        private final int value;
        PRODUCT_STOCK_UPDATE_ACTION(final int newValue) {
            value = newValue;
        }
        public int getValue() { return value; }
    }

    public static enum ENUM_CROP_STATUS {
        STATUS_ARE_ACTIVE,
        STATUS_FINISHED
    }

    public static enum OBJECT_EXTEND_TYPE {
        TYPE_OBJECT(0),
        TYPE_LIST(1);
        private final int value;
        OBJECT_EXTEND_TYPE(final int newValue) {
            value = newValue;
        }
        public int getValue() { return value; }
    }

    public static final String COMMA_DOT = ";";
    public static final String EMPTY = "";
    public static final String SLASH = "";
    public static final Integer READY_STATUS_EQUIPMENT_HISTORY = 2;
    public static final String SUCCEED_MESSAGE_CONTROL_EQUIPMENT = "Điều khiển thiết bị thành công.";
    public static final String FAILED_MESSAGE_CONTROL_EQUIPMENT = "Điều khiển thiết bị thất bại.";
    public static final String FAILED_AUTO_MODE_MESSAGE_CONTROL_EQUIPMENT = "Mode của thiết bị là manual.";
    public static final String FAILED_ERROR_CONNECT_MESSAGE_CONTROL_EQUIPMENT = "Không kết nối được thiết bị.";
    public static final String FAILED_FAULTY_MESSAGE_CONTROL_EQUIPMENT = "Thiết bị đang vị lỗi.";
    public static final String FAILED_ERROR_ON_MESSAGE_CONTROL_EQUIPMENT = "Thiết bị đang bật. Không thể bật thiết bị";
    public static final String FAILED_ERROR_OFF_MESSAGE_CONTROL_EQUIPMENT = "Thiết bị đang tắt. Không thể tắt thiết bị";
    public static final int DEFAULT_TIMEOUT_RECONNECT = 60;

    public static final String NOTIFICATION_TITLE_ENV_UPDATE = "Cập nhật thông số môi trường";
    public static final String NOTIFICATION_TITLE_PERSON_IN_CHARGE_UPDATE = "Cập nhật người phụ trách";

    public static final String NOTIFICATION_REQUEST_TYPE_ENV_UPDATE = "ENV_UPDATE";
    public static final String NOTIFICATION_REQUEST_TYPE_PIC_UPDATE = "PIC_UPDATE"; //PIC-Person In Charge
    public static final String NOTIFICATION_REQUEST_TYPE_DEVICE = "DEVICE_LOST_CONNECTION";
    public static final String FLUTTER_NOTIFICATION_CLICK = "FLUTTER_NOTIFICATION_CLICK";

    public static String THOI_GIAN_NGAM_HAT = "THOI_GIAN_NGAM_HAT";

    public static String SO_LUONG_CAY_TRONG = "SO_LUONG_CAY_TRONG";

    public static String SO_LUONG_LOAI_BO = "SO_LUONG_LOAI_BO";

    public static String PHAN_TRAM_CAY = "PHAN_TRAM_CAY";

    public static String[] NON_TEXT_CONTROLS = {"radiobutton","dropdown"};

    public static Integer OBJECT_TYPE = 0;
    public static Integer LIST_TYPE = 1;

    public static enum UNITS {
        KG("kg"),
        G("g"),
        M("m"),
        MM("mm"),
        L("l"),
        ML("ml");
        private final String value;
        UNITS(final String newValue) {
            value = newValue;
        }
        public String getValue() { return value; }
    }

    public static enum UNIT_WEIGHT
    {
        kg("kilogam"),
        g ("gam");
        private String value;
        UNIT_WEIGHT(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    };
    public static enum UNIT_SIZE
    {
        m("meter"),
        mm ("milimeter");
        private String value;
        UNIT_SIZE(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    };
    public static enum UNIT_CAPACITY
    {
        l("liter"),
        ml ("milliliter");
        private String value;
        UNIT_CAPACITY(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    };

    public static enum UNIT_SEED
    {
        seed("hạt");
        private String value;
        UNIT_SEED(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    };

    public enum SEED_UNIT
    {
        kg("kilogram"),
        g ("gam");
        private String value;
        SEED_UNIT(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    public static enum LOCATION
    {
        ENTITY("entity"),
        WAREHOUSE("warehouse");
        private String value;
        LOCATION(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    };
    public static enum METHODS_DYNAMIC
    {
        GET_DETAIL("Chi tiết hoạt động "),
        POST_CREATE("Thêm hoạt động "),
        POST_UPDATE("Cập nhật hoạt động "),
        DELETE_DELETE("Xóa hoạt động ");
        private String value;
        METHODS_DYNAMIC(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    };

    public static enum METHODS_PATH_ACTIVITY_TYPE
    {
        GET_DETAIL("GET", "/api/get-detail-common-activity/"),
        POST_CREATE("POST", "/api/create-common-activity/"),
        POST_UPDATE("POST", "/api/update-common-activity/"),
        DELETE_DELETE("DELETE", "/api/delete-common-activity/");
        private static final Map<String, METHODS_PATH_ACTIVITY_TYPE> BY_NAME = new HashMap<>();
        static {
            for (METHODS_PATH_ACTIVITY_TYPE e : values()) {
                BY_NAME.put(e.name, e);
            }
        }

        private String name;
        private String value;

        METHODS_PATH_ACTIVITY_TYPE(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public static METHODS_PATH_ACTIVITY_TYPE nameOf(String name) {
            return BY_NAME.get(name);
        }
        public String getName() {
            return name;
        }
        public String getValue() {
            return value;
        }
    };
}
