package it.integry.integrywmsnative.core.class_router.configs;

import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
import it.integry.integrywmsnative.gest.inventario.ElencoInventariFragment;
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneFragment;
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteFragment;
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreFragment;
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceFragment;

public class MenuConfiguration extends BaseMenuConfiguration {


    public MenuConfiguration() {

        this
                .addGroup(
                        new MenuGroup()
                                .setGroupText(R.string.purchase)
                                .setGroupId(R.id.nav_group_acquisto)
                                .setCodMenu("MM008")

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_accettazione)
                                        .setCodMenu("MG044")
                                        .setTitleText(R.string.accettazione_title_fragment)
                                        .setTitleIcon(R.drawable.ic_dashboard_accettazione)
                                        .setDrawerIcon(R.drawable.ic_black_download)
                                        .setFragmentFactory(MainAccettazioneFragment::newInstance))

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_resi_fornitore)
                                        .setCodMenu("MG045")
                                        .setTitleText(R.string.fragment_ultime_arrivi_fornitore_title)
                                        .setTitleIcon(R.drawable.ic_latest_delivery)
                                        .setDrawerIcon(R.drawable.ic_black_latest_delivery)
                                        .setFragmentFactory(UltimiArriviFornitoreFragment::newInstance))
                ).addGroup(
                        new MenuGroup()
                                .setGroupText(R.string.checkout)
                                .setGroupId(R.id.nav_group_spedizione)
                                .setCodMenu("MM010")

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_spedizione)
                                        .setCodMenu("MG046")
                                        .setTitleText(R.string.vendita_title_fragment)
                                        .setTitleIcon(R.drawable.ic_dashboard_spedizione)
                                        .setDrawerIcon(R.drawable.ic_black_upload)
                                        .setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, null)))

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_free_picking)
                                        .setCodMenu("MG047")
                                        .setTitleText(R.string.free_picking)
                                        .setTitleIcon(R.drawable.ic_dashboard_picking_libero)
                                        .setDrawerIcon(R.drawable.ic_black_barcode_scanner)
                                        .setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_resi_cliente)
                                        .setCodMenu("MG048")
                                        .setTitleText(R.string.fragment_ultime_consegne_cliente_title)
                                        .setTitleIcon(R.drawable.ic_latest_delivery_customer)
                                        .setDrawerIcon(R.drawable.ic_black_latest_delivery)
                                        .setFragmentFactory(UltimeConsegneClienteFragment::newInstance))
                ).addGroup(new MenuGroup()
                        .setGroupText(R.string.manufacture)
                        .setGroupId(R.id.nav_group_produzione)
                        .setCodMenu("MM009")

                        .addItem(new MenuItem()
                                .setID(R.id.nav_prod_ordine_produzione)
                                .setCodMenu("MG049")
                                .setTitleText(R.string.prod_ordine_produzione_title_fragment)
                                .setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
                                .setDrawerIcon(R.drawable.ic_black_external)
                                .setFragmentFactory(ProdOrdineProduzioneElencoFragment::newInstance))

                        .addItem(new MenuItem()
                                .setID(R.id.nav_prod_ordine_lavorazione)
                                .setCodMenu("MG050")
                                .setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
                                .setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
                                .setDrawerIcon(R.drawable.ic_black_external)
                                .setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))

                        .addItem(new MenuItem()
                                .setID(R.id.nav_free_lav_picking)
                                .setCodMenu("MG051")
                                .setTitleText(it.integry.integrywmsnative.R.string.free_lav_picking)
                                .setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
                                .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
                                .setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))

                        .addItem(new MenuItem()
                                .setID(R.id.nav_prod_posizionamento_da_ord)
                                .setCodMenu("MG052")
                                .setTitleText(R.string.prod_fabbisogno_linee_prod_title)
                                .setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
                                .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
                                .setFragmentFactory(ProdFabbisognoLineeProdFragment::newInstance))

                        .addItem(new MenuItem()
                                .setID(R.id.nav_prod_versamento_materiale)
                                .setCodMenu("MG053")
                                .setTitleText(R.string.prod_versamento_materiale_title_fragment)
                                .setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
                                .setDrawerIcon(R.drawable.ic_black_external)
                                .setFragmentFactory(ProdVersamentoMaterialeFragment::newInstance))

                        .addItem(new MenuItem()
                                .setID(R.id.nav_prod_recupero_materiale)
                                .setCodMenu("MG054")
                                .setTitleText(R.string.prod_recupero_materiale_title_fragment)
                                .setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
                                .setDrawerIcon(R.drawable.ic_black_external)
                                .setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))

                        .addItem(new MenuItem()
                                .setID(it.integry.integrywmsnative.R.id.nav_prod_rientro_merce)
                                .setCodMenu("MG059")
                                .setTitleText(it.integry.integrywmsnative.R.string.rientro_merce_fragment_title)
                                .setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
                                .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
                                .setFragmentFactory(ProdRientroMerceFragment::newInstance))

                        .addItem(new MenuItem()
                                .setID(it.integry.integrywmsnative.R.id.nav_prod_linee)
                                .setCodMenu("MG061")
                                .setTitleText(it.integry.integrywmsnative.R.string.nav_prod_linee_title)
                                .setTitleIcon(R.drawable.ic_production_line)
                                .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_production_line)
                                .setFragmentFactory(ProdLineeProduzioneFragment::newInstance))
                ).addGroup(
                        new MenuGroup()
                                .setGroupText(R.string.internal_handling)
                                .setGroupId(R.id.nav_group_movimentazione_interna)
                                .setCodMenu("MM011")

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_versamento_merce)
                                        .setCodMenu("MG055")
                                        .setTitleText(R.string.versamento_merce_fragment_title)
                                        .setTitleIcon(R.drawable.ic_dashboard_versamento_merce)
                                        .setDrawerIcon(R.drawable.ic_black_load_shelf)
                                        .setFragmentFactory(VersamentoMerceFragment::newInstance))

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_rettifica_giacenze)
                                        .setCodMenu("MG056")
                                        .setTitleText(R.string.rettifica_giacenze_fragment_title)
                                        .setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
                                        .setDrawerIcon(R.drawable.ic_black_empty_box)
                                        .setFragmentFactory(RettificaGiacenzeFragment::newInstance))

                                .addItem(new MenuItem()
                                        .setID(R.id.nav_inventario)
                                        .setCodMenu("MG062")
                                        .setTitleText(R.string.inventario_fragment_title)
                                        .setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
                                        .setDrawerIcon(R.drawable.ic_black_empty_box)
                                        .setFragmentFactory(ElencoInventariFragment::newInstance))


                ).addGroup(
                        new MenuGroup()
                                .setCodMenu("MM012")
                                .setGroupText(it.integry.integrywmsnative.R.string.punto_vendita)
                                .setGroupId(it.integry.integrywmsnative.R.id.nav_group_puntivendita)

                                .addItem(new MenuItem()
                                        .setCodMenu("MG057")
                                        .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto)
                                        .setTitleText(it.integry.integrywmsnative.R.string.generate_orders)
                                        .setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
                                        .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
                                        .setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
                                .addItem(new MenuItem()
                                        .setCodMenu("MG058")
                                        .setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
                                        .setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
                                        .setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
                                        .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
                                        .setFragmentFactory(DocInterniFragment::newInstance))

//                                .addItem(new MenuItem()
//                                        .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
//                                        .setTitleText(it.integry.integrywmsnative.R.string.transmitted_orders)
//                                        .setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
//                                        .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
//                                        .setFragmentClass(PVOrdiniAcquistoTransmittedListFragment.newInstance()))
                );

    }


}
