Skip to content

Commit

Permalink
adding configuration for #284
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardWitteveen committed Dec 14, 2021
1 parent bf83eae commit 51e1c13
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.google.gson.Gson;

import lombok.Data;
import nl.haarlem.translations.zdstozgw.config.model.BeeindigZaakWanneerEinddatum;
import nl.haarlem.translations.zdstozgw.config.model.ZaaktypeMetCoalesceResultaat;
import nl.haarlem.translations.zdstozgw.config.model.Configuration;
import nl.haarlem.translations.zdstozgw.config.model.Organisatie;
import nl.haarlem.translations.zdstozgw.config.model.Translation;
Expand Down Expand Up @@ -85,11 +85,18 @@ private void validateConfiguration() throws Exception {

section = "beeindigZaakWanneerEinddatum";
log.debug("=== " + section + " #" + this.configuration.getBeeindigZaakWanneerEinddatum().size() + " ===");
for (BeeindigZaakWanneerEinddatum beeindigZaakWanneerEinddatum : this.configuration.getBeeindigZaakWanneerEinddatum()) {
for (ZaaktypeMetCoalesceResultaat beeindigZaakWanneerEinddatum : this.configuration.getBeeindigZaakWanneerEinddatum()) {
log.debug("\t===>\tzaakType:" + beeindigZaakWanneerEinddatum.getZaakType());
log.debug("\t\tcoalesceResultaat:" + beeindigZaakWanneerEinddatum.getCoalesceResultaat());
}

section = "einddatumEnResultaatWanneerLastStatus";
log.debug("=== " + section + " #" + this.configuration.getEinddatumEnResultaatWanneerLastStatus().size() + " ===");
for (ZaaktypeMetCoalesceResultaat beeindigZaakWanneerEinddatum : this.configuration.getEinddatumEnResultaatWanneerLastStatus()) {
log.debug("\t===>\tzaakType:" + beeindigZaakWanneerEinddatum.getZaakType());
log.debug("\t\tcoalesceResultaat:" + beeindigZaakWanneerEinddatum.getCoalesceResultaat());
}

section = "replicatie";
log.debug("=== " + section + " ===");
var replicatie = this.configuration.getReplication();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public class Configuration {
@Expose
public ZgwRolOmschrijving zgwRolOmschrijving = null;
@Expose
public List<BeeindigZaakWanneerEinddatum> beeindigZaakWanneerEinddatum = null;
public List<ZaaktypeMetCoalesceResultaat> beeindigZaakWanneerEinddatum = null;
@Expose
public List<ZaaktypeMetCoalesceResultaat> einddatumEnResultaatWanneerLastStatus = null;
@Expose
public Replication replication = null;
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import lombok.Data;

@Data
public class BeeindigZaakWanneerEinddatum {
public class ZaaktypeMetCoalesceResultaat {
@Expose
public String zaakType;
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,42 @@ public boolean setResultaatAndStatus(ZdsZaak zdsZaak, ZgwZaak zgwZaak, ZgwZaakTy
}
}
}

// einddatumEnResultaatWanneerLastStatus logica
/*
if(zdsZaak.einddatum != null && zdsZaak.einddatum.length() > 0 && !beeindigd) {
for(var beeindig : this.configService.getConfiguration().getBeeindigZaakWanneerEinddatum() ) {
if(beeindig.zaakType.equals(zgwZaakType.getIdentificatie())) {
// is the result also missing?
var resultaten = this.zgwClient.getResultatenByZaakUrl(zgwZaak.url);
if(resultaten.size() == 0) {
var zgwResultaatType = this.zgwClient.getResultaatTypeByZaakTypeAndOmschrijving(zgwZaakType, beeindig.coalesceResultaat);
if(zgwResultaatType == null) {
throw new ConverterException("Resultaattype: '" + beeindig.coalesceResultaat + "' niet gevonden bij Zaaktype:'" + zgwZaakType.identificatie + "'");
}
ZgwResultaat zgwResultaat = new ZgwResultaat();
zgwResultaat.zaak = zgwZaak.url;
zgwResultaat.resultaattype = zgwResultaatType.url;
zgwResultaat.toelichting = zgwResultaatType.omschrijving;
debugWarning("BeeindigZaakWanneerEinddatum was defined for zaaktype:'" + zgwZaakType.identificatie + "' and an einddatum was provided, no resultaat, zaak will get resultaat:'" + zgwResultaatType.getOmschrijving() + "'");
this.zgwClient.addZaakResultaat(zgwResultaat);
}
var zgwStatusType = this.zgwClient.getLastStatusTypeByZaakType(zgwZaakType);
ZgwStatus zgwStatus = new ZgwStatus();
zgwStatus.zaak = zgwZaak.url;
zgwStatus.statustype = zgwStatusType.url;
zgwStatus.statustoelichting = zgwStatusType.omschrijving;
zgwStatus.setDatumStatusGezet(convertZdsStatusDatumtoZgwDateTime(zgwZaak, zdsZaak.einddatum));
debugWarning("BeeindigZaakWanneerEinddatum was defined for zaaktype:'" + zgwZaakType.identificatie + "' and an einddatum was provided, no eindstatus, zaak will get status:'" + zgwStatusType.getOmschrijving() + "' with time:" + zgwStatus.getDatumStatusGezet());
this.zgwClient.addZaakStatus(zgwStatus);
beeindigd = true;
changed = true;
}
}
}
*/

return changed;
}

Expand Down

0 comments on commit 51e1c13

Please sign in to comment.