
package de.ivu.elect.presentation.admin.menu;

import de.ivu.elect.jee.presentation.menu.MenuEntry;
import de.ivu.elect.presentation.geodata.menu.GeodataOrtMenuItemEntry;
import de.ivu.elect.presentation.person.menu.BerufMenuItemEntry;
import de.ivu.elect.presentation.personenregister.menu.PersonenregisterZertifikatUploadMenuItemEntry;

import javax.enterprise.inject.Specializes;
import javax.inject.Inject;
import java.util.List;

@Specializes
public class CommonAdminMainMenuEntry extends AdminMainMenuEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  protected transient GeodataOrtMenuItemEntry geodataOrtMenuItemEntry;

  @Inject
  protected transient BerufMenuItemEntry berufMenuItemEntry;

  @Inject
  protected transient PersonenregisterZertifikatUploadMenuItemEntry personenregisterZertifikatUploadMenuItemEntry;


  public CommonAdminMainMenuEntry() {
    super();
  }

  @Override
  protected List<MenuEntry> getSubMenuEntriesSorted() {
    List<MenuEntry> subMenuEntriesSorted = super.getSubMenuEntriesSorted();
    subMenuEntriesSorted.add(subMenuEntriesSorted.indexOf(interfacesStatusMenuItemEntry) + 1, personenregisterZertifikatUploadMenuItemEntry);
    return subMenuEntriesSorted;
  }

  @Override
  protected void addDataEntries(List<MenuEntry> result) {
    super.addDataEntries(result);

    result.add(geodataOrtMenuItemEntry);
    result.add(berufMenuItemEntry);
  }
}
