package it.integry.integrywmsnative.core.report;

import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.generated.callback.Runnable;

public class ReportManager {


    public static void getRightReportNameByMtbColt(MtbColt mtbColt, RunnableArgs<String> onComplete, RunnableArgs<Exception> onFailed) throws Exception{

        if(mtbColt != null){

            GestioneEnum gestione = GestioneEnum.fromString(mtbColt.getGestione());

            switch (gestione) {
                case ACQUISTO:
                    onComplete.run("EtichettaBancale");
                    break;

                case LAVORAZIONE:
                    onComplete.run("EtichettaInventario");
                    break;

                case VENDITA:
                    onComplete.run("EtichettaSpedizione");
                    break;
            }

        } else {
            throw new Exception("mtbColt cannot be NULL");
        }

    }

}
