Skip to content

Commit e45111b

Browse files
committed
Merge branch 'refs/heads/master' into feature/tenor-organisasjon-soek
# Conflicts: # apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/mapper/TenorOrganisasjonResultMapperService.java # apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/service/TenorSearchService.java
2 parents 078d97a + 0b9cff0 commit e45111b

File tree

174 files changed

+1543
-897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+1543
-897
lines changed

Diff for: .github/workflows/proxy.pdl-proxy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
cluster: "dev-fss"
1818
working-directory: "proxies/pdl-proxy"
19-
deploy-tag: "#deploy-proxy"
19+
deploy-tag: "#deploy-pdl-proxy"
2020
permissions:
2121
contents: read
2222
id-token: write

Diff for: apps/adresse-service/src/main/resources/logback-spring.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/amelding-service/src/main/resources/logback-spring.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/app-tilgang-analyse-service/src/main/resources/logback-spring.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/arbeidsforhold-service/src/main/resources/logback-spring.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/batch-bestilling-service/src/main/resources/logback-spring.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/brreg-stub/src/main/resources/logback-spring.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/bruker-service/src/main/resources/logback-spring.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>
@@ -25,8 +24,7 @@
2524

2625
<springProfile name="dev">
2726
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
28-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
29-
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
27+
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
3028
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
3129
<rootCauseFirst>true</rootCauseFirst>
3230
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/budpro-service/src/main/resources/logback-spring.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<configuration>
33
<springProfile name="prod,dev">
44
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
5-
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
6-
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
5+
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
76
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
87
<rootCauseFirst>true</rootCauseFirst>
98
<maxDepthPerThrowable>256</maxDepthPerThrowable>

Diff for: apps/dolly-backend/config.test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ spec:
2323
- application: testnav-batch-bestilling-service
2424
- application: testnav-dollystatus
2525
- application: testnav-oversikt-frontend
26+
- application: testnav-tenor-search-service
2627
outbound:
2728
rules:
2829
- application: generer-navn-service

Diff for: apps/dolly-backend/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ spec:
2121
- application: testnav-dollystatus
2222
- application: testnav-helsepersonell-service
2323
- application: testnav-oversikt-frontend
24+
- application: testnav-tenor-search-service
2425
- application: etterlatte-testdata
2526
namespace: etterlatte
2627
outbound:

Diff for: apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/PdlDataConsumer.java

-16
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import no.nav.dolly.bestilling.pdldata.command.PdlDataOpprettingCommand;
1010
import no.nav.dolly.bestilling.pdldata.command.PdlDataOrdreCommand;
1111
import no.nav.dolly.bestilling.pdldata.command.PdlDataSlettCommand;
12-
import no.nav.dolly.bestilling.pdldata.command.PdlDataSlettUtenomCommand;
1312
import no.nav.dolly.bestilling.pdldata.command.PdlDataStanaloneCommand;
1413
import no.nav.dolly.bestilling.pdldata.dto.PdlResponse;
1514
import no.nav.dolly.config.Consumers;
@@ -33,8 +32,6 @@
3332
@Service
3433
public class PdlDataConsumer implements ConsumerStatus {
3534

36-
private static final int BLOCK_SIZE = 10;
37-
3835
private final TokenExchange tokenService;
3936
private final WebClient webClient;
4037
private final ServerProperties serverProperties;
@@ -72,19 +69,6 @@ public Mono<List<Void>> slettPdl(List<String> identer) {
7269
.collectList();
7370
}
7471

75-
@Timed(name = "providers", tags = {"operation", "pdl_delete_utenom"})
76-
public Mono<List<Void>> slettPdlUtenom(List<String> identer) {
77-
78-
return tokenService.exchange(serverProperties)
79-
.flatMapMany(token -> Flux.range(0, (identer.size() / BLOCK_SIZE) + 1)
80-
.delayElements(Duration.ofMillis(1000))
81-
.map(count -> new PdlDataSlettUtenomCommand(webClient,
82-
identer.subList(count * BLOCK_SIZE, Math.min((count + 1) * BLOCK_SIZE, identer.size())),
83-
token.getTokenValue()).call())
84-
.flatMap(Flux::from))
85-
.collectList();
86-
}
87-
8872
@Timed(name = "providers", tags = {"operation", "pdl_opprett"})
8973
public Flux<PdlResponse> opprettPdl(BestillingRequestDTO request) {
9074

Diff for: apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataSlettUtenomCommand.java

-51
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
package no.nav.dolly.bestilling.pdldata.dto;
22

3+
import com.fasterxml.jackson.annotation.JsonIgnore;
34
import com.fasterxml.jackson.annotation.JsonInclude;
45
import lombok.AllArgsConstructor;
56
import lombok.Builder;
67
import lombok.Data;
78
import lombok.NoArgsConstructor;
89
import org.springframework.http.HttpStatus;
910

11+
import static org.apache.commons.lang3.StringUtils.isNotBlank;
12+
1013
@Data
1114
@Builder
1215
@NoArgsConstructor
1316
@AllArgsConstructor
1417
@JsonInclude(JsonInclude.Include.NON_EMPTY)
1518
public class PdlResponse {
1619

20+
private static final String FINNES_IKKE = "finnes ikke";
21+
1722
private String ident;
1823
private String jsonNode;
1924
private HttpStatus status;
2025
private String feilmelding;
26+
27+
@JsonIgnore
28+
public boolean isFinnesIkke() {
29+
30+
return isNotBlank(feilmelding) && feilmelding.contains(FINNES_IKKE);
31+
}
2132
}

Diff for: apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/service/DollyBestillingService.java

+43-11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import no.nav.dolly.service.BestillingService;
3131
import no.nav.dolly.service.IdentService;
3232
import no.nav.dolly.util.TransactionHelperService;
33+
import no.nav.testnav.libs.data.pdlforvalter.v1.PersonUpdateRequestDTO;
3334
import org.apache.commons.lang3.StringUtils;
3435
import org.slf4j.MDC;
3536
import org.springframework.stereotype.Service;
@@ -145,16 +146,26 @@ protected Flux<BestillingProgress> gjenopprettKlienter(DollyPerson dollyPerson,
145146
.map(ClientFuture::get);
146147
}
147148

149+
protected void leggIdentTilGruppe(BestillingProgress progress, String beskrivelse) {
150+
151+
leggIdentTilGruppe(null, progress, beskrivelse);
152+
}
153+
148154
protected void leggIdentTilGruppe(String ident, BestillingProgress progress, String beskrivelse) {
149155

150-
identService.saveIdentTilGruppe(ident, progress.getBestilling().getGruppe(), progress.getMaster(), beskrivelse);
151-
log.info("Ident {} lagt til gruppe {}", ident, progress.getBestilling().getGruppe().getId());
156+
identService.saveIdentTilGruppe(isNotBlank(ident) ? ident : progress.getIdent(), progress.getBestilling().getGruppe(), progress.getMaster(), beskrivelse);
157+
log.info("Ident {} lagt til gruppe {}", progress.getIdent(), progress.getBestilling().getGruppe().getId());
158+
}
159+
160+
protected Flux<DollyPerson> opprettDollyPerson(BestillingProgress progress, Bruker bruker) {
161+
162+
return opprettDollyPerson(null, progress, bruker);
152163
}
153164

154165
protected Flux<DollyPerson> opprettDollyPerson(String ident, BestillingProgress progress, Bruker bruker) {
155166

156167
return Flux.just(DollyPerson.builder()
157-
.ident(ident)
168+
.ident(isNotBlank(ident) ? ident : progress.getIdent())
158169
.master(progress.getMaster())
159170
.tags(Stream.concat(progress.getBestilling().getGruppe().getTags().stream(),
160171
Stream.of(Tags.DOLLY)
@@ -224,6 +235,11 @@ protected Flux<PdlResponse> opprettPerson(OriginatorUtility.Originator originato
224235

225236
protected Flux<String> sendOrdrePerson(BestillingProgress progress, PdlResponse forvalterStatus) {
226237

238+
if (progress.getMaster() == PDL) {
239+
240+
transactionHelperService.persister(progress, BestillingProgress::setPdlImportStatus, "OK");
241+
}
242+
227243
if (nonNull(forvalterStatus.getStatus())) {
228244

229245
transactionHelperService.persister(progress, BestillingProgress::setPdlForvalterStatus,
@@ -234,12 +250,7 @@ protected Flux<String> sendOrdrePerson(BestillingProgress progress, PdlResponse
234250
forvalterStatus.getIdent() : "?");
235251
}
236252

237-
if (progress.getMaster() == PDL) {
238-
239-
transactionHelperService.persister(progress, BestillingProgress::setPdlImportStatus, "OK");
240-
return Flux.just(progress.getIdent());
241-
242-
} else if (isNull(forvalterStatus.getStatus()) || forvalterStatus.getStatus().is2xxSuccessful()) {
253+
if (isNull(forvalterStatus.getStatus()) || forvalterStatus.getStatus().is2xxSuccessful()) {
243254

244255
transactionHelperService.persister(progress, BestillingProgress::setPdlOrdreStatus,
245256
"Info: Ordre til PDL startet ...");
@@ -248,10 +259,12 @@ protected Flux<String> sendOrdrePerson(BestillingProgress progress, PdlResponse
248259
var status = resultat.getStatus().is2xxSuccessful() ?
249260
resultat.getJsonNode() :
250261
errorStatusDecoder.getErrorText(resultat.getStatus(), resultat.getFeilmelding());
251-
transactionHelperService.persister(progress, BestillingProgress::setPdlOrdreStatus, status);
262+
transactionHelperService.persister(progress, BestillingProgress::setPdlOrdreStatus,
263+
!resultat.isFinnesIkke() ? status : null);
252264
log.info("Sendt ordre til PDL for ident {} ", forvalterStatus.getIdent());
253265
})
254-
.map(resultat -> resultat.getStatus().is2xxSuccessful() ? forvalterStatus.getIdent() : "");
266+
.map(resultat -> resultat.getStatus().is2xxSuccessful() || resultat.isFinnesIkke()
267+
? forvalterStatus.getIdent() : "");
255268

256269
} else {
257270

@@ -282,4 +295,23 @@ protected Flux<RsDollyBestillingRequest> createBestilling(Bestilling bestilling,
282295
coBestilling.getMiljoer())
283296
.build()));
284297
}
298+
299+
protected Flux<PdlResponse> oppdaterPdlPerson(OriginatorUtility.Originator originator, BestillingProgress progress) {
300+
301+
if (nonNull(originator.getPdlBestilling()) && nonNull(originator.getPdlBestilling().getPerson())) {
302+
303+
transactionHelperService.persister(progress, BestillingProgress::setPdlForvalterStatus,
304+
"Info: Oppdatering av person startet ...");
305+
return pdlDataConsumer.oppdaterPdl(originator.getIdent(),
306+
PersonUpdateRequestDTO.builder()
307+
.person(originator.getPdlBestilling().getPerson())
308+
.build())
309+
.doOnNext(response -> log.info("Oppdatert person til PDL-forvalter med response {}", response));
310+
311+
} else {
312+
return Flux.just(PdlResponse.builder()
313+
.ident(originator.getIdent())
314+
.build());
315+
}
316+
}
285317
}

0 commit comments

Comments
 (0)