Skip to content

Commit

Permalink
move id fields to zaakservice
Browse files Browse the repository at this point in the history
  • Loading branch information
alisihab committed Sep 16, 2024
1 parent 7663f6a commit 964b099
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package nl.haarlem.translations.zdstozgw.converter.impl.emulate;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.server.ResponseStatusException;
Expand All @@ -34,9 +33,6 @@

public class GenereerDocumentIdentificatieEmulator extends Converter {

@Value("${id.generatie.documentIdentificatiePrefix:1900}")
public String documentIdentificatiePrefix;

public GenereerDocumentIdentificatieEmulator(RequestResponseCycle session, Translation translation,
ZaakService zaakService) {
super(session, translation, zaakService);
Expand All @@ -52,7 +48,7 @@ public void load() throws ResponseStatusException {
public ResponseEntity<?> execute() throws ConverterException {
EmulateParameterRepository repository = SpringContext.getBean(EmulateParameterRepository.class);
var identificatie = repository.getDocumentId();
var did = documentIdentificatiePrefix + identificatie;
var did = zaakService.getDocumentIdentificatiePrefix() + identificatie;
this.getSession().setFunctie("GenereerDocumentIdentificatie");
this.getSession().setKenmerk("documentidentificatie:" + did);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package nl.haarlem.translations.zdstozgw.converter.impl.emulate;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.server.ResponseStatusException;
Expand All @@ -32,10 +31,8 @@
import nl.haarlem.translations.zdstozgw.translation.zds.services.ZaakService;
import nl.haarlem.translations.zdstozgw.utils.XmlUtils;

public class GenereerZaakIdentificatieEmulator extends Converter {

@Value("${id.generatie.zaakIdentificatiePrefix:1900}")
public String zaakIdentificatiePrefix;
public class GenereerZaakIdentificatieEmulator extends Converter {

public GenereerZaakIdentificatieEmulator(RequestResponseCycle session, Translation translation,
ZaakService zaakService) {
Expand All @@ -57,7 +54,7 @@ zaakidentificatie, hiervoor gelden de volgende regels (genomen uit RGBZ):

EmulateParameterRepository repository = SpringContext.getBean(EmulateParameterRepository.class);
var identificatie = repository.getZaakId();
var zid = zaakIdentificatiePrefix + identificatie;
var zid = zaakService.getZaakIdentificatiePrefix() + identificatie;
this.getSession().setFunctie("GenereerZaakIdentificatie");
this.getSession().setKenmerk("zaakidentificatie:" + zid);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import lombok.Getter;
import nl.haarlem.translations.zdstozgw.config.ConfigService;
import nl.haarlem.translations.zdstozgw.config.ModelMapperConfig;
import nl.haarlem.translations.zdstozgw.config.model.Organisatie;
Expand Down Expand Up @@ -82,6 +84,13 @@ public class ZaakService {
private final ModelMapper modelMapper;
public final ConfigService configService;

@Value("${id.generatie.documentIdentificatiePrefix:1900}")
private @Getter String documentIdentificatiePrefix;

@Value("${id.generatie.zaakIdentificatiePrefix:1900}")
private @Getter String zaakIdentificatiePrefix;


@Autowired
public ZaakService(ZGWClient zgwClient, ModelMapper modelMapper, ConfigService configService) {
this.zgwClient = zgwClient;
Expand Down

0 comments on commit 964b099

Please sign in to comment.