
package de.avatic.taricdb.helper.workbook;

public enum ExcelTableType {
	ADDITIONAL_CODE(ExcelFileType.ADDITIONAL_CODES, "Sheet1", 0),	
	APPLIED_MEASURES(ExcelFileType.DUTIES, "Sheet 1", 0),
	APPLIED_MEASURE_CONDITION(ExcelFileType.MEASURE_CONDITIONS, "Sheet 1", 0),
	CERTIFICATE_TYPE(ExcelFileType.BUSINESS_CODE, "Certificate types", -1),
	CERTIFICATE(ExcelFileType.BOX_44, "Sheet 1 ", 0),
	CONDITION_TYPE(ExcelFileType.BUSINESS_CODE, "Condition types", -1),
	FOOTNOTES(ExcelFileType.FOOTNOTES, "Sheet1", 0),
	GEO_GROUP(ExcelFileType.GEO, "Sheet 1", 0),
	GEO_MEMBERSHIP(ExcelFileType.GEO_COMPOSITION, "Sheet 1", 0),
	LEGAL_BASE(ExcelFileType.LEGAL_BASES, "Sheet1 1", 0),
	MEASURE(ExcelFileType.BUSINESS_CODE, "Measure types", -1),
	MEASURE_FOOTNOTES(ExcelFileType.MEASURE_FOOTNOTES, "Sheet 1", 0),
	MEASURE_SERIES(ExcelFileType.BUSINESS_CODE, "Measure type series", -1),
	MEASURE_ACTION(ExcelFileType.BUSINESS_CODE, "Measure actions", -1),
	MEASURE_EXCLUSION(ExcelFileType.MEASURE_EXCLUSIONS, "Sheet 1", 0),
	MONETARY_UNIT(ExcelFileType.BUSINESS_CODE, "Monetary Units", -1),	
	NOMENCLATURE_DE(ExcelFileType.NOMENCLATURE_DE, "Sheet1", 0),
	NOMENCLATURE_EN(ExcelFileType.NOMENCLATURE_EN, "Sheet1", 0),
	NOMENCLATURE_FR(ExcelFileType.NOMENCLATURE_FR, "Sheet1", 0),
	NOMENCLATURE_DECLAREABLE(ExcelFileType.DECLARABLE_CODES, "Sheet 1", 0),
	NOMENCLATURE_FOOTNOTE(ExcelFileType.NOMENCLATURE_FOOTNOTES, "Sheet 1", 0),
	UNIT(ExcelFileType.BUSINESS_CODE, "Measurement Units & Qualifiers", -1);

	
	private String sheetName;
	private int sheetIndex;
	private ExcelFileType fileType;

	ExcelTableType(ExcelFileType fileType, String sheetName, int sheetIndex) {
		this.sheetName = sheetName;
		this.sheetIndex = sheetIndex;
		this.fileType = fileType;
	}

	static ExcelTableType fromFileName(String name) {
		ExcelFileType fileType = ExcelFileType.fromFileName(name);

		if (fileType == null) {
            return null;
        }
		
		for (ExcelTableType tableType : values()) {
            if (fileType.equals(tableType.getFileType())) {
                return tableType;
            }
        }
		
        return null;
    }

	int getSheetIndex() {
		return sheetIndex;
	}

	String getSheetName() {
		return sheetName;
	}

	public ExcelFileType getFileType() {
		return fileType;
	}

	

}
