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

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;

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

@javax.ejb.Stateless
@Specializes
public class NlKonfigurationEdit extends KonfigurationEdit {

  @Inject
  private transient KonfigurationLoader konfigurationLoader;

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

    sendKonfigurationChangeEvent(parameter);
  }

}
