
package de.ivu.elect.business.konfiguration.boundary;

import javax.ejb.Stateless;
import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import de.ivu.elect.business.konfiguration.entity.Konfiguration;
import de.ivu.elect.business.konfiguration.entity.KonfigurationLoader;
import de.ivu.elect.business.konfiguration.entity.MandantKonfigurationWerte;
import de.ivu.elect.business.mandant.entity.Mandant;
import de.ivu.elect.business.personenregister.entity.PersonenregisterSource;

@Stateless
@Specializes
public class NlKonfigurationEdit extends KonfigurationEdit {

  @Inject
  private transient KonfigurationLoader konfigurationLoader;

  public NlKonfigurationEdit() {
    super();
  }

  public void setOfflineModus(Mandant mandant) {
    Konfiguration konfiguration = konfigurationLoader.getParameter(mandant, MandantKonfigurationWerte.PERSONENREGISTER_SOURCE);
    konfiguration.setWertEnumValue(PersonenregisterSource.GBAV_OFFLINE);

    sendKonfigurationChangeEvent(konfiguration);
  }
}
