package de.accso.flexinale.application.services;

import de.accso.flexinale.domain.dao.AbstractDao;
import de.accso.flexinale.shared_kernel.Identifiable;
import org.apache.poi.ss.usermodel.Row;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;

@SuppressWarnings("unused")
public interface ExcelDataUploadService<E extends Identifiable> {
    Collection<E> loadDataFromExcelSheet(final String resourceName) throws IOException;
    Collection<E> loadDataFromExcelSheet(final InputStream stream)  throws IOException;

    int loadDataFromExcelSheetAndPersist(final String resourceName, PersistMode mode) throws IOException;
    int loadDataFromExcelSheetAndPersist(final InputStream stream, PersistMode mode)  throws IOException;
    Collection<E> loadDataFromExcelSheetAndPersistAndReturn(final InputStream stream,  PersistMode mode) throws IOException;

    AbstractDao<E> getDao();
    String getNameOfExcelDataType();

    void beforeLoad(Object... o);
    void afterLoad(Object... o);
    E createDataFromExcelRow(final Row row);
}