diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java index 0e472fde700..2a1d2ecd007 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java @@ -36,7 +36,8 @@ public Mono> getKodeverkByName(String kodeverk) { return tokenService.exchange(serverProperties) .flatMap(token -> new KodeverkGetCommand(webClient, kodeverk, token.getTokenValue()).call()) - .doOnNext(response -> log.info("Hentet kodeverk {}", response.getKodeverknavn())) + .doOnNext(response -> log.info("Hentet kodeverk {}, status {} melding {}", + response.getKodeverknavn(), response.getStatus(), response.getMessage())) .map(KodeverkDTO::getKodeverk); } } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java index 7dea08d54f0..91b2382e5cb 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java @@ -33,6 +33,9 @@ public Mono call() { .bodyToMono(KodeverkDTO.class) .doOnError(WebClientFilter::logErrorMessage) .onErrorResume(error -> Mono.just(KodeverkDTO.builder() + .kodeverknavn(kodeverk) + .status(WebClientFilter.getStatus(error)) + .message(WebClientFilter.getMessage(error)) .build())) .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) .filter(WebClientFilter::is5xxException)); diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeAdjusted.java b/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeAdjusted.java deleted file mode 100644 index 76375b3d4bd..00000000000 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeAdjusted.java +++ /dev/null @@ -1,21 +0,0 @@ -package no.nav.dolly.domain.resultset.kodeverk; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import java.time.LocalDate; - -@Getter -@Setter -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class KodeAdjusted { - private String label; - private String value; - private LocalDate gyldigFra; - private LocalDate gyldigTil; -} diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeverkAdjusted.java b/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeverkAdjusted.java deleted file mode 100644 index 60e9bf217b7..00000000000 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeverkAdjusted.java +++ /dev/null @@ -1,30 +0,0 @@ -package no.nav.dolly.domain.resultset.kodeverk; - -import static java.util.Objects.isNull; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import java.util.ArrayList; -import java.util.List; - -@Getter -@Setter -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class KodeverkAdjusted { - - private String name; - private List koder; - - public List getKoder() { - if (isNull(koder)) { - koder = new ArrayList<>(); - } - return koder; - } -} diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/kodeverkservice/v1/KodeverkDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/kodeverkservice/v1/KodeverkDTO.java index 86079c516cc..2cc3e653a16 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/kodeverkservice/v1/KodeverkDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/kodeverkservice/v1/KodeverkDTO.java @@ -4,6 +4,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.springframework.http.HttpStatus; import java.util.HashMap; import java.util.Map; @@ -19,6 +20,9 @@ public class KodeverkDTO { private String kodeverknavn; private Map kodeverk; + private HttpStatus status; + private String message; + public Map getKodeverk() { if (isNull(kodeverk)) {