diff --git a/.github/workflows/app.ereg-batch-status-service.yml b/.github/workflows/app.ereg-batch-status-service.yml index f9f8e2ac8fd..3547091010a 100644 --- a/.github/workflows/app.ereg-batch-status-service.yml +++ b/.github/workflows/app.ereg-batch-status-service.yml @@ -14,7 +14,7 @@ jobs: workflow: uses: ./.github/workflows/common.workflow.backend.yml with: - cluster: "dev-fss" + cluster: "dev-gcp" working-directory: "apps/ereg-batch-status-service" deploy-tag: "#deploy-ereg-batch-status-service" permissions: diff --git a/.github/workflows/app.team-dolly-lokal-app.yml b/.github/workflows/app.team-dolly-lokal-app.yml new file mode 100644 index 00000000000..0d7e273dd1f --- /dev/null +++ b/.github/workflows/app.team-dolly-lokal-app.yml @@ -0,0 +1,21 @@ +name: team-dolly-lokal-app + +on: + push: + paths: + - .nais/team-dolly-lokal-app.yml + - .github/workflows/app.team-dolly-lokal-app.yml + +jobs: + deploy: + name: Deploy team-dolly-lokal-app + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: nais/deploy/actions/deploy@v2 + env: + CLUSTER: dev-gcp + RESOURCE: .nais/team-dolly-lokal-app.yml \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index b0da88e14e6..00000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build -on: - push: - branches: - - master - paths-ignore: - - 'navikt/**' - - '.github/**' - - '.nais/alerting-dolly.yml' - pull_request: - types: [ assigned, opened, synchronize, reopened ] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: "Checkout" - uses: actions/checkout@v4 - - name: "Git" - run: git fetch --unshallow - - name: "Java" - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 21 - - name: "Gradle" - env: - NAV_TOKEN: ${{ secrets.NAV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_USERNAME: token - uses: gradle/gradle-build-action@v2 - with: - arguments: build --scan - cache-read-only: false \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/integration-tests.yml similarity index 96% rename from .github/workflows/tests.yml rename to .github/workflows/integration-tests.yml index 0a27c9e4c1e..cecb9bed8d1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,4 +1,4 @@ -name: Tests +name: Integration Tests on: push: branches: diff --git a/.github/workflows/proxy.modapp-ereg-proxy.yml b/.github/workflows/proxy.modapp-ereg-proxy.yml new file mode 100644 index 00000000000..ec4b0b6bdb9 --- /dev/null +++ b/.github/workflows/proxy.modapp-ereg-proxy.yml @@ -0,0 +1,23 @@ +name: modapp-ereg-proxy + +on: + push: + paths: + - libs/reactive-core + - libs/reactive-proxy + - libs/reactive-security + - libs/security-core + - proxies/modapp-ereg-proxy/** + - .github/workflows/proxy.modapp-ereg-proxy.yml + +jobs: + workflow: + uses: ./.github/workflows/common.workflow.backend.yml + with: + cluster: "dev-fss" + working-directory: "proxies/modapp-ereg-proxy" + deploy-tag: "#deploy-proxy" + permissions: + contents: read + id-token: write + secrets: inherit diff --git a/.gitignore b/.gitignore index 88695f9e761..82bf724a9e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.idea/ *target/ *.iml +*.http # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. diff --git a/.nais/team-dolly-lokal-app.yml b/.nais/team-dolly-lokal-app.yml new file mode 100644 index 00000000000..d553d559dca --- /dev/null +++ b/.nais/team-dolly-lokal-app.yml @@ -0,0 +1,18 @@ +apiVersion: nais.io/v1 +kind: AzureAdApplication +metadata: + labels: + team: dolly + name: team-dolly-lokal-app + namespace: dolly +spec: + allowAllUsers: true + logoutUrl: https://localhost:8080/oauth2/logout + preAuthorizedApplications: + - application: testnorge-oversikt-frontend + cluster: dev-gcp + namespace: dolly + replyUrls: + - url: http://localhost:8080/login/oauth2/code/aad + secretName: azuread-team-dolly-lokal-app + tenant: nav.no \ No newline at end of file diff --git a/apps/adresse-service/config.yml b/apps/adresse-service/config.yml index 018505cf6f3..9afa0b9e9c5 100644 --- a/apps/adresse-service/config.yml +++ b/apps/adresse-service/config.yml @@ -62,6 +62,8 @@ spec: - application: app-1 namespace: plattformsikkerhet cluster: dev-gcp + - application: testnav-endringsmelding-service + cluster: dev-gcp outbound: external: - host: testnav-pdl-proxy.dev-fss-pub.nais.io diff --git a/apps/adresse-service/src/main/resources/application.yaml b/apps/adresse-service/src/main/resources/application.yaml index 248874c9951..e899f831d91 100644 --- a/apps/adresse-service/src/main/resources/application.yaml +++ b/apps/adresse-service/src/main/resources/application.yaml @@ -50,4 +50,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/amelding-service/src/main/resources/application.yml b/apps/amelding-service/src/main/resources/application.yml index bb95d741739..1698ea6a87f 100644 --- a/apps/amelding-service/src/main/resources/application.yml +++ b/apps/amelding-service/src/main/resources/application.yml @@ -43,4 +43,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/app-tilgang-analyse-service/src/main/resources/application.yml b/apps/app-tilgang-analyse-service/src/main/resources/application.yml index 822047d0729..3ec1b0c00ee 100644 --- a/apps/app-tilgang-analyse-service/src/main/resources/application.yml +++ b/apps/app-tilgang-analyse-service/src/main/resources/application.yml @@ -48,4 +48,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/arbeidsforhold-service/src/main/resources/application.yml b/apps/arbeidsforhold-service/src/main/resources/application.yml index a73601451b5..0cebd9bc87e 100644 --- a/apps/arbeidsforhold-service/src/main/resources/application.yml +++ b/apps/arbeidsforhold-service/src/main/resources/application.yml @@ -46,4 +46,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/batch-bestilling-service/src/main/resources/application.yml b/apps/batch-bestilling-service/src/main/resources/application.yml index c94c017e80e..2c0f29cb9dd 100644 --- a/apps/batch-bestilling-service/src/main/resources/application.yml +++ b/apps/batch-bestilling-service/src/main/resources/application.yml @@ -45,6 +45,8 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always consumers: dolly-backend: diff --git a/apps/brreg-stub/src/main/resources/application.yaml b/apps/brreg-stub/src/main/resources/application.yaml index 1ee72bc46e8..f5cbfac1e91 100644 --- a/apps/brreg-stub/src/main/resources/application.yaml +++ b/apps/brreg-stub/src/main/resources/application.yaml @@ -29,4 +29,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/bruker-service/src/main/resources/application.yml b/apps/bruker-service/src/main/resources/application.yml index 7269e777be2..8e7c4794648 100644 --- a/apps/bruker-service/src/main/resources/application.yml +++ b/apps/bruker-service/src/main/resources/application.yml @@ -44,4 +44,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/budpro-service/src/main/resources/application.yml b/apps/budpro-service/src/main/resources/application.yml index 8e0b8718658..dbaf3135de7 100644 --- a/apps/budpro-service/src/main/resources/application.yml +++ b/apps/budpro-service/src/main/resources/application.yml @@ -37,3 +37,10 @@ consumers: app: security: allow-api: true + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java index 6af8668f777..f0ef428e58d 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java @@ -10,4 +10,4 @@ public static void main(String[] args) { SpringApplication.run(DollyBackendApplicationStarter.class, args); } -} \ No newline at end of file +} diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java index 7e7b9949089..9333c6fe6b2 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java @@ -68,6 +68,7 @@ public Flux gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly var initStatus = miljoer.stream() .map(miljo -> String.format("%s:%s", miljo, getInfoVenter(SYSTEM))) .collect(Collectors.joining(",")); + transactionHelperService.persister(progress, BestillingProgress::getAaregStatus, BestillingProgress::setAaregStatus, initStatus); diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingConsumer.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingConsumer.java index 764d7cecd77..7891bc02455 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingConsumer.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingConsumer.java @@ -11,6 +11,7 @@ import no.nav.testnav.libs.dto.ameldingservice.v1.VirksomhetDTO; import no.nav.testnav.libs.securitycore.domain.ServerProperties; import no.nav.testnav.libs.standalone.servletsecurity.exchange.TokenExchange; +import org.slf4j.event.Level; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; import org.springframework.web.reactive.function.client.WebClient; @@ -30,7 +31,6 @@ public class AmeldingConsumer { private static final String JURIDISK_ENHET_IKKE_FUNNET = "Feil= Juridisk enhet for organisasjon(ene): %s ble ikke funnet i miljø"; private static final DateTimeFormatter YEAR_MONTH = DateTimeFormatter.ofPattern("yyyy-MM"); - private final TokenExchange tokenService; private final WebClient webClient; private final ServerProperties serverProperties; @@ -41,8 +41,8 @@ public AmeldingConsumer( Consumers consumers, ObjectMapper objectMapper, ErrorStatusDecoder errorStatusDecoder, - WebClient.Builder webClientBuilder - ) { + WebClient.Builder webClientBuilder) { + this.tokenService = tokenService; serverProperties = consumers.getTestnavAmeldingService(); this.webClient = webClientBuilder @@ -52,7 +52,7 @@ public AmeldingConsumer( this.errorStatusDecoder = errorStatusDecoder; } - @Timed(name = "providers", tags = { "operation", "amelding_put" }) + @Timed(name = "providers", tags = {"operation", "amelding_put"}) public Flux sendAmeldinger(List ameldinger, String miljoe) { return tokenService.exchange(serverProperties) @@ -67,9 +67,13 @@ public Flux sendAmeldinger(List ameldinger, String miljoe) log.info("Sender Amelding {} til miljø {}: {}", amelding.getKalendermaaned().format(YEAR_MONTH), miljoe, Json.pretty(amelding)); return new AmeldingPutCommand(webClient, amelding, miljoe, token.getTokenValue()).call() - .doOnNext(status -> log.info("Ameldingstatus: {}", status.getStatusCode())) .map(status -> status.getStatusCode().is2xxSuccessful() ? "OK" : - errorStatusDecoder.getErrorText(HttpStatus.valueOf(status.getStatusCode().value()), status.getBody())); + errorStatusDecoder.getErrorText(HttpStatus.valueOf(status.getStatusCode().value()), status.getBody())) + .doOnNext(status -> + log.atLevel("OK".equals(status) ? Level.INFO : Level.ERROR) + .log("Ameldingstatus: {}, miljoe: {}, kalendermåned: {}, organisasjon: {}", + status, miljoe, amelding.getKalendermaaned(), + amelding.getOpplysningspliktigOrganisajonsnummer())); } })); } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingService.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingService.java index 388baf613bc..ad4c851d363 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingService.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/AmeldingService.java @@ -16,6 +16,7 @@ import reactor.core.publisher.Mono; import java.util.Collection; +import java.util.Comparator; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -25,7 +26,7 @@ @Slf4j public class AmeldingService { - private static final String STATUS_ELEMENT = "%s: arbforhold=1$%s"; + private static final String STATUS_ELEMENT = "%s:Amelding$%s"; private final AmeldingConsumer ameldingConsumer; private final MapperFacade mapperFacade; @@ -34,7 +35,7 @@ public class AmeldingService { public Mono sendAmelding(RsDollyUtvidetBestilling bestilling, DollyPerson dollyPerson, Set miljoer) { - var orgnumre = bestilling.getAareg().get(0).getAmelding().stream() + var orgnumre = bestilling.getAareg().getFirst().getAmelding().stream() .map(RsAmeldingRequest::getArbeidsforhold) .flatMap(Collection::stream) .map(RsArbeidsforholdAareg::getArbeidsgiver) @@ -46,14 +47,15 @@ public Mono sendAmelding(RsDollyUtvidetBestilling bestilling, DollyPerso .filter(OrganisasjonDTO::isFunnet) .collect(Collectors.toMap(OrganisasjonDTO::getOrgnummer, OrganisasjonDTO::getJuridiskEnhet)) .flatMapMany(organisasjon -> - prepareAmeldinger(bestilling.getAareg().get(0), dollyPerson.getIdent(), + prepareAmeldinger(bestilling.getAareg().getFirst(), dollyPerson.getIdent(), organisasjon, miljoe)) .collect(Collectors.joining(","))) .flatMap(Flux::from) .collect(Collectors.joining(",")); } - private Flux prepareAmeldinger(RsAareg aareg, String ident, Map organisasjon, String miljoe) { + private Flux prepareAmeldinger(RsAareg aareg, String ident, Map organisasjon, + String miljoe) { var context = new MappingContext.Factory().getContext(); context.setProperty("personIdent", ident); @@ -62,9 +64,10 @@ private Flux prepareAmeldinger(RsAareg aareg, String ident, Map mapperFacade.map(aamelding, AMeldingDTO.class, context)) + .sort(Comparator.comparing(AMeldingDTO::getKalendermaaned)) .collectList() - .flatMapMany(reultat -> ameldingConsumer.sendAmeldinger(reultat, miljoe) + .flatMapMany(ameldinger -> ameldingConsumer.sendAmeldinger(ameldinger, miljoe) .distinct() - .map(status -> String.format(STATUS_ELEMENT, miljoe, status))); + .map(status -> STATUS_ELEMENT.formatted(miljoe, status))); } } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/mapper/AmeldingRequestMappingStrategy.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/mapper/AmeldingRequestMappingStrategy.java index 9d0d11df1b2..89ad49345d5 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/mapper/AmeldingRequestMappingStrategy.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/amelding/mapper/AmeldingRequestMappingStrategy.java @@ -24,6 +24,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; @@ -54,16 +55,21 @@ public void mapAtoB(RsAmeldingRequest rsAmelding, amelding.setKalendermaaned(LocalDate.of(Integer.parseInt(date[0]), Integer.parseInt(date[1]), 1)); var opplysningsPliktig = (Map) context.getProperty("opplysningspliktig"); - amelding.setOpplysningspliktigOrganisajonsnummer(opplysningsPliktig.get(rsAmelding.getArbeidsforhold().get(0).getArbeidsgiver().getOrgnummer())); + amelding.setOpplysningspliktigOrganisajonsnummer(opplysningsPliktig.get(rsAmelding.getArbeidsforhold() + .getFirst().getArbeidsgiver().getOrgnummer())); var virksomheter = mapperFacade.mapAsList(rsAmelding.getArbeidsforhold(), Virksomhet.class, context); - virksomheter.forEach(virksomhet -> { - var arbForholdId = new AtomicInteger(0); - virksomhet.getPersoner() - .forEach(person -> person.getArbeidsforhold() - .forEach(arbeidsforhold -> arbeidsforhold - .setArbeidsforholdId(Integer.toString(arbForholdId.incrementAndGet())))); - }); + var arbeidsForholdIder = new HashMap(); + virksomheter + .forEach(virksomhet -> virksomhet.getPersoner().forEach(person -> + arbeidsForholdIder.put(virksomhet.getOrganisajonsnummer()+person.getIdent(), + new AtomicInteger(0)))); + virksomheter.forEach(virksomhet -> virksomhet.getPersoner() + .forEach(person -> person.getArbeidsforhold() + .forEach(arbeidsforhold -> arbeidsforhold + .setArbeidsforholdId(Integer.toString( + arbeidsForholdIder.get(virksomhet.getOrganisajonsnummer()+person.getIdent()) + .incrementAndGet()))))); var ameldingVirksomheter = virksomheter.stream().map(virksomhet -> VirksomhetDTO.builder() .organisajonsnummer(virksomhet.getOrganisajonsnummer()) @@ -94,12 +100,14 @@ public void mapAtoB(RsArbeidsforholdAareg rsArbeidsforholdAareg, Virksomhet virk getDate(rsArbeidsforholdAareg.getAnsettelsesPeriode().getTom()) : null) .antallTimerPerUke( !rsArbeidsforholdAareg.getAntallTimerForTimeloennet().isEmpty() ? - rsArbeidsforholdAareg.getAntallTimerForTimeloennet().get(0).getAntallTimer().floatValue() : + rsArbeidsforholdAareg.getAntallTimerForTimeloennet() + .getFirst().getAntallTimer().floatValue() : getAvtaltArbeidstidPerUke(rsArbeidsforholdAareg)) .arbeidsforholdType((String) context.getProperty("arbeidsforholdstype")) .arbeidstidsordning(rsArbeidsforholdAareg.getArbeidsavtale().getArbeidstidsordning()) .fartoey(nonNull(rsArbeidsforholdAareg.getFartoy()) && !rsArbeidsforholdAareg.getFartoy().isEmpty() ? - mapperFacade.map(rsArbeidsforholdAareg.getFartoy().get(0), FartoeyDTO.class) : null) + mapperFacade.map(rsArbeidsforholdAareg.getFartoy() + .getFirst(), FartoeyDTO.class) : null) .inntekter( (nonNull(rsArbeidsforholdAareg.getUtenlandsopphold()) && !rsArbeidsforholdAareg.getUtenlandsopphold().isEmpty()) || diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/command/AmeldingPutCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/command/AmeldingPutCommand.java index 7abf1f1b253..b675a80a052 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/command/AmeldingPutCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/command/AmeldingPutCommand.java @@ -9,11 +9,14 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; import java.util.concurrent.Callable; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; + @RequiredArgsConstructor public class AmeldingPutCommand implements Callable>> { @@ -31,6 +34,10 @@ public Mono> call() { return webClient.put() .uri(uriBuilder -> uriBuilder.path(AMELDING_URL) .build()) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .header(UserConstant.USER_HEADER_JWT, TokenXUtil.getUserJwt()) .header(MILJOE, miljo) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOppdateringCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOppdateringCommand.java index aea49ffdfb4..47d8da35b38 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOppdateringCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOppdateringCommand.java @@ -13,12 +13,14 @@ import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.net.http.HttpTimeoutException; import java.time.Duration; import java.util.concurrent.Callable; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static no.nav.dolly.util.TokenXUtil.getUserJwt; @Slf4j @@ -37,6 +39,10 @@ public Flux call() { return webClient .put() .uri(PDL_FORVALTER_PERSONER_URL, ident) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .contentType(MediaType.APPLICATION_JSON) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOpprettingCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOpprettingCommand.java index e476b4e6ce9..ee9a194e245 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOpprettingCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOpprettingCommand.java @@ -13,12 +13,14 @@ import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.net.http.HttpTimeoutException; import java.time.Duration; import java.util.concurrent.Callable; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static no.nav.dolly.util.TokenXUtil.getUserJwt; @Slf4j @@ -36,6 +38,10 @@ public Flux call() { return webClient .post() .uri(PDL_FORVALTER_PERSONER_URL) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .contentType(MediaType.APPLICATION_JSON) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOrdreCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOrdreCommand.java index 353b0290336..1b9dcc72e2b 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOrdreCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pdldata/command/PdlDataOrdreCommand.java @@ -10,12 +10,14 @@ import org.springframework.http.MediaType; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.net.http.HttpTimeoutException; import java.time.Duration; import java.util.concurrent.Callable; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static no.nav.dolly.util.TokenXUtil.getUserJwt; @RequiredArgsConstructor @@ -36,6 +38,10 @@ public Flux call() { .uri(uriBuilder -> uriBuilder.path(PDL_FORVALTER_ORDRE_URL) .queryParam(EXCLUDE_EKSTERNE_PERSONER, ekskluderEksternePersoner) .build(ident)) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .contentType(MediaType.APPLICATION_JSON) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreAlderspensjonCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreAlderspensjonCommand.java index bd61b58027d..af37ff5627f 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreAlderspensjonCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreAlderspensjonCommand.java @@ -9,6 +9,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; @@ -17,6 +18,8 @@ import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CALL_ID; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID; +import static no.nav.dolly.util.CallIdUtil.generateCallId; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @Slf4j @@ -40,6 +43,10 @@ public Flux call() { .path(alderspensjonRequest instanceof AlderspensjonVedtakRequest ? PENSJON_AP_VEDTAK_URL : PENSJON_AP_SOKNAD_URL) .build()) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(AUTHORIZATION, "Bearer " + token) .header(HEADER_NAV_CALL_ID, callId) .header(HEADER_NAV_CONSUMER_ID, CONSUMER) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagrePoppInntektCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagrePoppInntektCommand.java index 01239d75c00..0c23bd3f1f4 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagrePoppInntektCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagrePoppInntektCommand.java @@ -8,6 +8,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; @@ -16,6 +17,8 @@ import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CALL_ID; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID; +import static no.nav.dolly.util.CallIdUtil.generateCallId; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @Slf4j @@ -35,6 +38,10 @@ public Flux call() { .uri(uriBuilder -> uriBuilder .path(POPP_INNTEKT_URL) .build()) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(AUTHORIZATION, "Bearer " + token) .header(HEADER_NAV_CALL_ID, callId) .header(HEADER_NAV_CONSUMER_ID, CONSUMER) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpForholdCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpForholdCommand.java index c1e35f4855c..a0bbcad5abc 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpForholdCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpForholdCommand.java @@ -9,6 +9,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; @@ -17,6 +18,8 @@ import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CALL_ID; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID; +import static no.nav.dolly.util.CallIdUtil.generateCallId; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static no.nav.dolly.util.TokenXUtil.getUserJwt; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @@ -39,6 +42,10 @@ public Flux call() { .uri(uriBuilder -> uriBuilder .path(PENSJON_TP_FORHOLD_URL) .build()) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(AUTHORIZATION, "Bearer " + token) .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .header(HEADER_NAV_CALL_ID, callId) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpYtelseCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpYtelseCommand.java index 46e3604a370..51222793c1c 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpYtelseCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreTpYtelseCommand.java @@ -9,6 +9,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; @@ -17,6 +18,8 @@ import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CALL_ID; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID; +import static no.nav.dolly.util.CallIdUtil.generateCallId; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static no.nav.dolly.util.TokenXUtil.getUserJwt; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @@ -38,6 +41,10 @@ public Flux call() { .uri(uriBuilder -> uriBuilder .path(PENSJON_TP_YTELSE_URL) .build()) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(AUTHORIZATION, "Bearer " + token) .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .header(HEADER_NAV_CALL_ID, callId) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreUforetrygdCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreUforetrygdCommand.java index b1a8fb2df47..0fc1d461032 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreUforetrygdCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreUforetrygdCommand.java @@ -8,6 +8,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; @@ -16,6 +17,8 @@ import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CALL_ID; import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID; +import static no.nav.dolly.util.CallIdUtil.generateCallId; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @Slf4j @@ -37,6 +40,10 @@ public Flux call() { .uri(uriBuilder -> uriBuilder .path(PENSJON_UT_URL) .build()) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .header(AUTHORIZATION, "Bearer " + token) .header(HEADER_NAV_CALL_ID, callId) .header(HEADER_NAV_CONSUMER_ID, CONSUMER) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/EgenansattPostCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/EgenansattPostCommand.java index 132696f1460..8cae609e3e0 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/EgenansattPostCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/EgenansattPostCommand.java @@ -9,6 +9,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; @@ -18,6 +19,7 @@ import java.util.concurrent.Callable; import static java.util.Objects.nonNull; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; @RequiredArgsConstructor @Slf4j @@ -44,6 +46,10 @@ public Flux call() { .queryParamIfPresent(MILJOER_PARAM, nonNull(miljoer) ? Optional.of(miljoer) : Optional.empty()) .queryParam(EGENANSATT_FRA_PARAM, datoFra) .build(ident)) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .retrieve() diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/TpsMessagingPostCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/TpsMessagingPostCommand.java index cf17fa53891..a2d111acb97 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/TpsMessagingPostCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/tpsmessagingservice/command/TpsMessagingPostCommand.java @@ -9,6 +9,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; import reactor.util.retry.Retry; import java.time.Duration; @@ -17,6 +18,7 @@ import java.util.concurrent.Callable; import static java.util.Objects.nonNull; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; @RequiredArgsConstructor @Slf4j @@ -41,6 +43,10 @@ public Flux call() { .path(urlPath) .queryParamIfPresent(MILJOER_PARAM, nonNull(miljoer) ? Optional.of(miljoer) : Optional.empty()) .build(ident)) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .bodyValue(body) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/mapper/BestillingAaregStatusMapper.java b/apps/dolly-backend/src/main/java/no/nav/dolly/mapper/BestillingAaregStatusMapper.java index 65cde2d4305..b648b8b13cb 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/mapper/BestillingAaregStatusMapper.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/mapper/BestillingAaregStatusMapper.java @@ -8,12 +8,12 @@ import no.nav.dolly.domain.resultset.RsStatusRapport; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static no.nav.dolly.domain.resultset.SystemTyper.AAREG; import static no.nav.dolly.mapper.AbstractRsStatusMiljoeIdentForhold.checkAndUpdateStatus; @@ -43,23 +43,26 @@ public static List buildAaregStatusMap(List } }); - return errorEnvIdents.isEmpty() ? emptyList() : - singletonList(RsStatusRapport.builder().id(AAREG).navn(AAREG.getBeskrivelse()) - .statuser(errorEnvIdents.entrySet().stream().map(status -> - RsStatusRapport.Status.builder() - .melding(status.getKey().replace(";", ",")) - .detaljert(status.getValue().entrySet().stream().map(miljo -> - RsStatusRapport.Detaljert.builder() - .miljo(miljo.getKey()) - .identer(miljo.getValue()) - .build()) - .toList()) - .build()) - .toList()) + var statuser = errorEnvIdents.entrySet().stream().map(status -> + RsStatusRapport.Status.builder() + .melding(status.getKey().replace(";", ",")) + .detaljert(status.getValue().entrySet().stream().map(miljo -> + RsStatusRapport.Detaljert.builder() + .miljo(miljo.getKey()) + .identer(miljo.getValue()) + .build()) + .toList()) + .build()) + .toList(); + + return statuser.isEmpty() ? Collections.emptyList() : + singletonList(RsStatusRapport.builder() + .navn(AAREG.getBeskrivelse()) + .id(AAREG) + .statuser(statuser) .build()); } - public static String konverterBAfeilkodeTilFeilmelding(String baKode) { var baFeilkode = getBaFeilkodeFromFeilmelding(baKode); try { diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/util/RequestTimeout.java b/apps/dolly-backend/src/main/java/no/nav/dolly/util/RequestTimeout.java new file mode 100644 index 00000000000..4f646e47f71 --- /dev/null +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/util/RequestTimeout.java @@ -0,0 +1,9 @@ +package no.nav.dolly.util; + +import lombok.experimental.UtilityClass; + +@UtilityClass +public class RequestTimeout { + + public static final int REQUEST_DURATION = 30000; +} diff --git a/apps/dolly-backend/src/main/resources/application.yaml b/apps/dolly-backend/src/main/resources/application.yaml index c77f4fce394..162828fbb86 100644 --- a/apps/dolly-backend/src/main/resources/application.yaml +++ b/apps/dolly-backend/src/main/resources/application.yaml @@ -17,6 +17,8 @@ server: encoding: charset: UTF-8 max-http-header-size: 70KB + error: + include-message: always spring: cloud: @@ -83,11 +85,6 @@ open: total-fields: 1500 index: bestilling -tps: - person: - service: - wait: 30_000 - consumers: testnav-organisasjon-forvalter: name: testnav-organisasjon-forvalter diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/config/CachingConfig.java b/apps/dolly-backend/src/test/java/no/nav/dolly/config/TestCachingConfig.java similarity index 76% rename from apps/dolly-backend/src/test/java/no/nav/dolly/config/CachingConfig.java rename to apps/dolly-backend/src/test/java/no/nav/dolly/config/TestCachingConfig.java index 8c3637d9ca2..35e12eb8005 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/config/CachingConfig.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/config/TestCachingConfig.java @@ -4,13 +4,16 @@ import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.support.NoOpCacheManager; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +@Configuration @EnableCaching -public class CachingConfig { +@Profile("test") +public class TestCachingConfig { @Bean - @Profile("test") public CacheManager cacheManager() { return new NoOpCacheManager(); } + } \ No newline at end of file diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/config/OpenSearchConfig.java b/apps/dolly-backend/src/test/java/no/nav/dolly/config/TestOpenSearchConfig.java similarity index 90% rename from apps/dolly-backend/src/test/java/no/nav/dolly/config/OpenSearchConfig.java rename to apps/dolly-backend/src/test/java/no/nav/dolly/config/TestOpenSearchConfig.java index 6c94c7f5b8c..9a943bafd9c 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/config/OpenSearchConfig.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/config/TestOpenSearchConfig.java @@ -7,12 +7,14 @@ import org.opensearch.testcontainers.OpensearchContainer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; import org.testcontainers.utility.DockerImageName; @Configuration +@Profile("test") @EnableElasticsearchRepositories("no.nav.dolly.elastic") -public class OpenSearchConfig extends AbstractOpenSearchConfiguration { +public class TestOpenSearchConfig extends AbstractOpenSearchConfiguration { private static final DockerImageName OPENSEARCH_IMAGE = DockerImageName.parse("opensearchproject/opensearch:2.0.0"); diff --git a/apps/dolly-frontend/src/main/js/package-lock.json b/apps/dolly-frontend/src/main/js/package-lock.json index ec997444229..9e7f00d1f20 100644 --- a/apps/dolly-frontend/src/main/js/package-lock.json +++ b/apps/dolly-frontend/src/main/js/package-lock.json @@ -1,12 +1,12 @@ { "name": "dolly", - "version": "3.0.4", + "version": "3.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dolly", - "version": "3.0.4", + "version": "3.0.6", "license": "ISC", "dependencies": { "@babel/preset-flow": "^7.18.6", @@ -3120,15 +3120,15 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, "node_modules/@types/lodash": { - "version": "4.14.202", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", - "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", + "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==", "dev": true }, "node_modules/@types/node": { - "version": "20.11.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.26.tgz", - "integrity": "sha512-YwOMmyhNnAWijOBQweOJnQPl068Oqd4K3OFbTc6AHJwzweUwwWG3GIFY74OKks2PJUDkQPeddOQES9mLn1CTEQ==", + "version": "20.11.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.27.tgz", + "integrity": "sha512-qyUZfMnCg1KEz57r7pzFtSGt49f6RPkPBis3Vo4PbS7roQEDn22hiHzl/Lo1q4i4hDEgBJmBF/NTNg2XR0HbFg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3196,9 +3196,9 @@ "dev": true }, "node_modules/@types/react-dom": { - "version": "18.2.21", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.21.tgz", - "integrity": "sha512-gnvBA/21SA4xxqNXEwNiVcP0xSGHh/gi1VhWv9Bl46a0ItbTT5nFY+G9VSQpaG/8N/qdJpJ+vftQ4zflTtnjLw==", + "version": "18.2.22", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", + "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", "dev": true, "dependencies": { "@types/react": "*" @@ -4950,9 +4950,9 @@ "integrity": "sha512-LO/lzYRw134LMDVnLyAf1dHE5tyO6axEFkR3TXjQIOmMkAM9YL6QsiUwuXzZAmFnuDJcs4hayOgyIYtViXFrLw==" }, "node_modules/cypress": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.6.tgz", - "integrity": "sha512-S+2S9S94611hXimH9a3EAYt81QM913ZVA03pUmGDfLTFa5gyp85NJ8dJGSlEAEmyRsYkioS1TtnWtbv/Fzt11A==", + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.7.0.tgz", + "integrity": "sha512-UimjRSJJYdTlvkChcdcfywKJ6tUYuwYuk/n1uMMglrvi+ZthNhoRYcxnWgTqUtkl17fXrPAsD5XT2rcQYN1xKA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -5397,9 +5397,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.701", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.701.tgz", - "integrity": "sha512-K3WPQ36bUOtXg/1+69bFlFOvdSm0/0bGqmsfPDLRXLanoKXdA+pIWuf/VbA9b+2CwBFuONgl4NEz4OEm+OJOKA==" + "version": "1.4.705", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.705.tgz", + "integrity": "sha512-LKqhpwJCLhYId2VVwEzFXWrqQI5n5zBppz1W9ehhTlfYU8CUUW6kClbN8LHF/v7flMgRdETS772nqywJ+ckVAw==" }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -6524,9 +6524,9 @@ "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -10249,9 +10249,9 @@ } }, "node_modules/require-in-the-middle": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz", - "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.1.tgz", + "integrity": "sha512-u5XngygsJ+XV2dBV/Pl4SrcNpUXQfmYmXtuFeHDXfzk4i4NnGnret6xKWkkJHjMHS/16yMV9pEAlAunqmjllkA==", "dependencies": { "debug": "^4.1.1", "module-details-from-path": "^1.0.3", @@ -10583,9 +10583,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.71.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.1.tgz", - "integrity": "sha512-wovtnV2PxzteLlfNzbgm1tFXPLoZILYAMJtvoXXkD7/+1uP41eKkIt1ypWq5/q2uT94qHjXehEYfmjKOvjL9sg==", + "version": "1.72.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.72.0.tgz", + "integrity": "sha512-Gpczt3WA56Ly0Mn8Sl21Vj94s1axi9hDIzDFn9Ph9x3C3p4nNyvsqJoQyVXKou6cBlfFWEgRW4rT8Tb4i3XnVA==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -12019,14 +12019,14 @@ } }, "node_modules/vite-tsconfig-paths": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.1.tgz", - "integrity": "sha512-cfgJwcGOsIxXOLU/nELPny2/LUD/lcf1IbfyeKTv2bsupVbTH/xpFtdQlBmIP1GEK2CjjLxYhFfB+QODFAx5aw==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.2.tgz", + "integrity": "sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==", "dev": true, "dependencies": { "debug": "^4.1.1", "globrex": "^0.1.2", - "tsconfck": "^3.0.1" + "tsconfck": "^3.0.3" }, "peerDependencies": { "vite": "*" diff --git a/apps/dolly-frontend/src/main/js/package.json b/apps/dolly-frontend/src/main/js/package.json index 1f28751bcf2..65f4d589edc 100644 --- a/apps/dolly-frontend/src/main/js/package.json +++ b/apps/dolly-frontend/src/main/js/package.json @@ -1,6 +1,6 @@ { "name": "dolly", - "version": "3.0.4", + "version": "3.0.6", "type": "module", "description": "", "main": "index.js", diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx index 88b0a17ace8..aa8ad5257dd 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx @@ -89,8 +89,16 @@ export const ArbeidsforholdForm = ({ } const { setError, watch, control, getValues, setValue, trigger, resetField } = useFormContext() - const [navArbeidsforholdPeriode, setNavArbeidsforholdPeriode] = useState(null as unknown as Date) - const { tidligereBestillinger } = useContext(BestillingsveilederContext) + const eksisterendeArbeidsforholdPeriode = watch(`${path}.navArbeidsforholdPeriode`) + const [navArbeidsforholdPeriode, setNavArbeidsforholdPeriode] = useState( + eksisterendeArbeidsforholdPeriode + ? new Date( + eksisterendeArbeidsforholdPeriode.year, + eksisterendeArbeidsforholdPeriode.monthValue, + ) + : null, + ) + const { tidligereBestillinger }: any = useContext(BestillingsveilederContext) const tidligereAaregBestillinger = hentUnikeAaregBestillinger(tidligereBestillinger) const erLaastArbeidsforhold = (arbeidsgiverType === ArbeidsgiverTyper.felles || @@ -101,12 +109,13 @@ export const ArbeidsforholdForm = ({ if (_.isEmpty(tidligereAaregBestillinger) || harGjortFormEndringer()) { return } - resetField('aareg', { - defaultValue: tidligereAaregBestillinger?.map((aaregBestilling) => { + setValue( + 'aareg', + tidligereAaregBestillinger?.map((aaregBestilling) => { aaregBestilling.isOppdatering = true return aaregBestilling }), - }) + ) trigger('aareg') }, [watch('aareg')]) @@ -306,6 +315,7 @@ export const ArbeidsforholdForm = ({ date={navArbeidsforholdPeriode} label="NAV arbeidsforholdsperiode" onChange={setNavArbeidsforholdPeriode} + value={navArbeidsforholdPeriode} isClearable={true} /> {arbeidsforholdstype === 'forenkletOppgjoersordning' && ( diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx index dca3e42330c..af34c0e70f6 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx @@ -1,5 +1,5 @@ import { registerLocale } from 'react-datepicker' -import { addYears, subYears } from 'date-fns' +import { addYears, isDate, subYears } from 'date-fns' import locale_nb from 'date-fns/locale/nb' import { Label } from '@/components/ui/form/inputs/label/Label' import { InputWrapper } from '@/components/ui/form/inputWrapper/InputWrapper' @@ -10,11 +10,12 @@ import './Datepicker.less' import { useFormContext } from 'react-hook-form' import { DatePicker, useDatepicker } from '@navikt/ds-react' import _ from 'lodash' +import { formatDate } from '@/utils/DataFormatter' registerLocale('nb', locale_nb) function addHours(date, amount) { - date.setHours(amount, 0, 0) + date.setHours(amount) return date } @@ -30,23 +31,36 @@ export const Datepicker = ({ maxDate, }) => { const formMethods = useFormContext() - const eksisterendeVerdi = formMethods.watch(name) - const { datepickerProps, inputProps, selectedDay } = useDatepicker({ + + const getSelectedDay = () => { + const selected = formMethods.watch(name) + if (_.isNil(selected) || (!isDate(selected) && _.isEmpty(selected))) { + return undefined + } else if (isDate(selected)) { + return fixTimezone(selected) + } else { + return fixTimezone(new Date(selected)) + } + } + + const { datepickerProps, inputProps } = useDatepicker({ fromDate: minDate || subYears(new Date(), 125), toDate: maxDate || addYears(new Date(), 5), onDateChange: onChange || onBlur, - defaultSelected: !_.isEmpty(eksisterendeVerdi) ? new Date(eksisterendeVerdi) : undefined, disabled: excludeDates, + defaultSelected: getSelectedDay(), }) + const selectedDay = getSelectedDay() return ( ) diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/monthpicker/Monthpicker.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/monthpicker/Monthpicker.tsx index b52186d5a29..40bce233630 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/monthpicker/Monthpicker.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/monthpicker/Monthpicker.tsx @@ -1,7 +1,7 @@ import { Label } from '@/components/ui/form/inputs/label/Label' import { InputWrapper } from '@/components/ui/form/inputWrapper/InputWrapper' import { MonthPicker, useMonthpicker } from '@navikt/ds-react' -import { addYears, subYears } from 'date-fns' +import { addYears, isDate, subYears } from 'date-fns' import { useFormContext } from 'react-hook-form' import _ from 'lodash' @@ -28,24 +28,42 @@ export const Monthpicker = ({ ...props }: MonthpickerProps) => { const formMethods = useFormContext() - const eksisterendeVerdi = formMethods.watch(name) + const val = formMethods.watch(name) - const formattedDate = date instanceof Date || date === null ? date : new Date(date) + function getEksisterendeVerdi() { + if (name.includes('navArbeidsforholdPeriode')) { + return val?.year ? new Date(val?.year, val?.monthValue) : null + } + return val + } - const { monthpickerProps, inputProps, selectedMonth } = useMonthpicker({ + const eksisterendeVerdi = getEksisterendeVerdi() + + const formattedDate = + eksisterendeVerdi instanceof Date + ? eksisterendeVerdi + : date instanceof Date || date === null + ? date + : new Date(date) + + const { monthpickerProps, inputProps } = useMonthpicker({ fromDate: minDate || subYears(new Date(), 125), toDate: maxDate || addYears(new Date(), 5), onMonthChange: (selectedDate) => { - selectedDate?.setHours(12, 0, 0, 0) + selectedDate?.setHours(12) onChange ? onChange(selectedDate) : handleDateChange(selectedDate) }, - defaultSelected: !_.isEmpty(eksisterendeVerdi) ? new Date(eksisterendeVerdi) : undefined, + defaultSelected: !_.isNil(formattedDate) + ? isDate(formattedDate) + ? formattedDate + : new Date(formattedDate) + : undefined, }) return ( diff --git a/apps/dolly-frontend/src/main/resources/application.yml b/apps/dolly-frontend/src/main/resources/application.yml index 5062856d51f..a9deec0b05f 100644 --- a/apps/dolly-frontend/src/main/resources/application.yml +++ b/apps/dolly-frontend/src/main/resources/application.yml @@ -233,6 +233,8 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always logging: pattern: diff --git a/apps/dollystatus/src/main/resources/application.yml b/apps/dollystatus/src/main/resources/application.yml index cd124ff3702..ff84d84209f 100644 --- a/apps/dollystatus/src/main/resources/application.yml +++ b/apps/dollystatus/src/main/resources/application.yml @@ -15,6 +15,8 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always logging: level: diff --git a/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/EndringsmeldingFrontendApplicationStarter.java b/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/EndringsmeldingFrontendApplicationStarter.java index 3687476c9d4..00a741fa6a7 100644 --- a/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/EndringsmeldingFrontendApplicationStarter.java +++ b/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/EndringsmeldingFrontendApplicationStarter.java @@ -38,7 +38,7 @@ public class EndringsmeldingFrontendApplicationStarter { public RouteLocator customRouteLocator(RouteLocatorBuilder builder) { return builder .routes() - .route(createRoute(consumers.getEndringsmeldingService())) + .route(createRoute(consumers.getEndringsmeldingService(), "endringsmelding-service")) .route(createRoute(consumers.getTestnorgeProfilApi())) .build(); } @@ -68,4 +68,20 @@ private Function> createRoute(ServerProperties s ).uri(host); } + private Function> createRoute(ServerProperties serverProperties, String segment) { + return createRoute( + segment, + serverProperties.getUrl(), + addAuthenticationHeaderFilterFrom(serverProperties) + ); + } + + private Function> createRoute(String segment, String host, GatewayFilter filter) { + return spec -> spec + .path("/" + segment + "/**") + .filters(filterSpec -> filterSpec + .rewritePath("/" + segment + "/(?.*)", "/${segment}") + .filters(filter) + ).uri(host); + } } \ No newline at end of file diff --git a/apps/endringsmelding-frontend/src/main/js/package-lock.json b/apps/endringsmelding-frontend/src/main/js/package-lock.json index e465541bd01..9fc9a89792c 100644 --- a/apps/endringsmelding-frontend/src/main/js/package-lock.json +++ b/apps/endringsmelding-frontend/src/main/js/package-lock.json @@ -1,35 +1,39 @@ { "name": "endringsmelding-frontend", - "version": "1.2.11", + "version": "1.2.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "endringsmelding-frontend", - "version": "1.2.11", + "version": "1.2.15", "dependencies": { "@navikt/dolly-komponenter": "^1.3.33", "@navikt/ds-icons": "^3.4.3", "@navikt/ds-react": "^6.0.0", - "@navikt/fnrvalidator": "^1.3.0", + "@navikt/fnrvalidator": "^2.0.7", "axios": "^1.1.3", "classnames": "^2.3.1", + "cors": "^2.8.5", "dayjs": "^1.11.4", "lodash.throttle": "^4.1.1", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.3.0", + "react-router-dom": "^6.22.3", "react-select": "^5.4.0", "styled-components": "^6.0.0" }, "devDependencies": { + "@types/lodash": "^4.14.202", "@types/react": "^18.0.15", "@types/react-dom": "^18.0.6", "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.0.0", "babel-plugin-styled-components": "^2.0.7", + "isomorphic-fetch": "^3.0.0", "less": "^4.1.3", + "lodash": "^4.17.21", "mini-css-extract-plugin": "^2.6.1", "prettier": "^3.0.1", "swr": "^2.0.0", @@ -40,55 +44,55 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", - "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.1.tgz", + "integrity": "sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", - "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", + "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.2", + "@babel/generator": "^7.24.1", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.9", - "@babel/parser": "^7.23.9", - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/helpers": "^7.24.1", + "@babel/parser": "^7.24.1", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -104,14 +108,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", + "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", "dev": true, "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -181,11 +185,11 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", + "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", "dependencies": { - "@babel/types": "^7.22.15" + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -211,9 +215,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -244,9 +248,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", + "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", "engines": { "node": ">=6.9.0" } @@ -269,36 +273,37 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", - "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", + "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", "dev": true, "dependencies": { - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", - "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", + "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -308,12 +313,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", - "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -323,12 +328,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", - "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.24.1.tgz", + "integrity": "sha512-kDJgnPujTmAZ/9q2CN4m2/lRsUUPDvsG3+tSHWUJIzMGTt5U/b/fwWd3RO3n+5mjLrsBrVa5eKFRVSQbi3dF1w==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -338,12 +343,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", - "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.24.1.tgz", + "integrity": "sha512-1v202n7aUq4uXAieRTKcwPzNyphlCuqHHDcdSNc+vdhoTEZcFMh+L5yZuCmGaIO7bs1nJUNfHB89TZyoL48xNA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -353,9 +358,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", - "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.1.tgz", + "integrity": "sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -364,33 +369,33 @@ } }, "node_modules/@babel/template": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", - "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", - "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", + "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.1", + "@babel/generator": "^7.24.1", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/parser": "^7.24.1", + "@babel/types": "^7.24.0", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -399,9 +404,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", - "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -484,9 +489,9 @@ "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, "node_modules/@emotion/react": { - "version": "11.11.3", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.3.tgz", - "integrity": "sha512-Cnn0kuq4DoONOMcnoVsTOR8E+AdnKFf//6kUWc4LCdnxj31pZWn7rIULd6Y7/Js1PiPHzn7SKCM9vB/jBni8eA==", + "version": "11.11.4", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.4.tgz", + "integrity": "sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -547,9 +552,9 @@ "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", "cpu": [ "ppc64" ], @@ -563,9 +568,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "cpu": [ "arm" ], @@ -579,9 +584,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -595,9 +600,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -611,9 +616,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -627,9 +632,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -643,9 +648,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -659,9 +664,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -675,9 +680,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -691,9 +696,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -707,9 +712,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -723,9 +728,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "cpu": [ "loong64" ], @@ -739,9 +744,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -755,9 +760,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -771,9 +776,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -787,9 +792,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -803,9 +808,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -819,9 +824,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -835,9 +840,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -851,9 +856,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -867,9 +872,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -883,9 +888,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -899,9 +904,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -973,14 +978,14 @@ "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -996,23 +1001,23 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "peer": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -1022,9 +1027,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -1032,9 +1037,9 @@ } }, "node_modules/@navikt/aksel-icons": { - "version": "6.0.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/6.0.0/c43fb02f061aea1df175436345cae28d83ac8c46", - "integrity": "sha512-41U7tHtCfoBPoEO1FGYl2p8yDvtXOtR6CJ9d4qFbM2Wii7vt50D994W7u4Z11K3PbLKCGcHFlAPbkXU9LQvujA==" + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/6.3.3/251b544c7aea1904c7d11341fbc999e6b7e6e3e1", + "integrity": "sha512-DRWDvqJCPc1kYTjJwzv6sw5Bxf6DfHortkYDUtFSriwvXRaL1DM1/LxPtpu+fkMlCIBBioGps8CHZzRpg7Q8UQ==" }, "node_modules/@navikt/dolly-assets": { "version": "1.2.15", @@ -1076,9 +1081,9 @@ "integrity": "sha512-9cuullCMapcPoIPOad2j6DkOr8ZWCm9zxRv5n+2EOAD7y3Ex4bVgJgSHSgc4bvB2Td4ApWyhTocQvyo2OfjSHg==" }, "node_modules/@navikt/ds-css": { - "version": "6.0.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/6.0.0/0943c7f430f62d5bbd64c21b6dd0fb19a1eb375a", - "integrity": "sha512-r54/kB9CYWvHFht1qUhy9iySzJU9OkzvGR8X1SMmLIHddI4GrZPfRbgtRZhFFCTl7b+ilnav6iETNgZ4tRfChw==" + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/6.3.3/86285e2560cc1c06a9fdac1baf34415dcf7808dd", + "integrity": "sha512-Rpm71ivCpJ5CQuItrIKCe7h/tSnjqnZh9+DS1Mq3LUXaAEdBa1wIg1wF8Eqximy3QcObcO/tRwEkMcFxKe4xLQ==" }, "node_modules/@navikt/ds-icons": { "version": "3.4.3", @@ -1090,13 +1095,13 @@ } }, "node_modules/@navikt/ds-react": { - "version": "6.0.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/6.0.0/715b264e3a69856666fc1409ad85477c136b86b5", - "integrity": "sha512-/791FxO1L+d/G8qSpjCHAYsYcHxhRXY/lFEUScWDEOkLQt63pr3qnpjKyNX1cc2PsJVj5AAAMWiO09o4J9g/vg==", + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/6.3.3/b432ae6ff3940ea88951a467923d96ff53b16b96", + "integrity": "sha512-iOCX4zO/CB6yM5GxTBDd8yl/sFe7QP2aNMxgA2uqH6l4S+tX1T7CKnMyUhxWrYTgGYFbjAaEppj77q2Gjokvkg==", "dependencies": { "@floating-ui/react": "0.25.4", - "@navikt/aksel-icons": "^6.0.0", - "@navikt/ds-tokens": "^6.0.0", + "@navikt/aksel-icons": "^6.3.3", + "@navikt/ds-tokens": "^6.3.3", "@radix-ui/react-tabs": "1.0.0", "@radix-ui/react-toggle-group": "1.0.0", "clsx": "^2.1.0", @@ -1109,14 +1114,17 @@ } }, "node_modules/@navikt/ds-tokens": { - "version": "6.0.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/6.0.0/d362b06543941efa9b8f5df9d179d372ff792e02", - "integrity": "sha512-CLjtNMhW0LpAutfU5SuW35Vic+MUsB3d9d8Pu3A9rdqnOOqLK1PWrHRTmW+MJpbKA53kF0vbAApw/fAaUqvkoQ==" + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/6.3.3/d6403f08c3aa389e917b6fbb962ded0c5ce6f603", + "integrity": "sha512-EArixE4zSCbkqAYh2iQarsWtTl80yhcKrkAyPlQHrUr19EeRLJIRBQW+lnSiGFMXe+jh7ZUqsHeY1mDOr693Eg==" }, "node_modules/@navikt/fnrvalidator": { - "version": "1.3.3", - "resolved": "https://npm.pkg.github.com/download/@navikt/fnrvalidator/1.3.3/8414963a30e59e3056c9befea7bb022498a2a742", - "integrity": "sha512-GsLa9ioYPGsDMBHcgKUNoYbZor09KyFIqSaWy8jy1I7f06q6DgUhdpZuRTHLVRCPjWqF2aLzKtvAfrw5dSeakg==" + "version": "2.0.7", + "resolved": "https://npm.pkg.github.com/download/@navikt/fnrvalidator/2.0.7/89ceb6a448fbd068e4ad8ff7a414705bd0ea6315", + "integrity": "sha512-3TQ2NLUk1rstZEoF65r9dr4RZxvmBEcXNKfA1dcZNpLw0SAb89WwcRpUrZMhd+7UdrfmKvfoTBvsfBwMoP9cyw==", + "dependencies": { + "typescript": "^5.4.2" + } }, "node_modules/@popperjs/core": { "version": "2.11.8", @@ -1346,9 +1354,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.1.tgz", - "integrity": "sha512-zcU0gM3z+3iqj8UX45AmWY810l3oUmXM7uH4dt5xtzvMhRtYVhKGOmgOd1877dOPPepfCjUv57w+syamWIYe7w==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.3.tgz", + "integrity": "sha512-Oy8rmScVrVxWZVOpEF57ovlnhpZ8CCPlnIIumVcV9nFdiSIrus99+Lw78ekXyGvVDlIsFJbSfmSovJUhCWYV3w==", "engines": { "node": ">=14.0.0" } @@ -1375,9 +1383,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", - "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", + "integrity": "sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==", "cpu": [ "arm" ], @@ -1387,9 +1395,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", - "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz", + "integrity": "sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==", "cpu": [ "arm64" ], @@ -1399,9 +1407,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", - "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz", + "integrity": "sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==", "cpu": [ "arm64" ], @@ -1411,9 +1419,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", - "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz", + "integrity": "sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==", "cpu": [ "x64" ], @@ -1423,9 +1431,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", - "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz", + "integrity": "sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==", "cpu": [ "arm" ], @@ -1435,9 +1443,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", - "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz", + "integrity": "sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==", "cpu": [ "arm64" ], @@ -1447,9 +1455,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", - "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz", + "integrity": "sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==", "cpu": [ "arm64" ], @@ -1459,9 +1467,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", - "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz", + "integrity": "sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==", "cpu": [ "riscv64" ], @@ -1471,9 +1479,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", - "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz", + "integrity": "sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==", "cpu": [ "x64" ], @@ -1483,9 +1491,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", - "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz", + "integrity": "sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==", "cpu": [ "x64" ], @@ -1495,9 +1503,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", - "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz", + "integrity": "sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==", "cpu": [ "arm64" ], @@ -1507,9 +1515,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", - "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz", + "integrity": "sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==", "cpu": [ "ia32" ], @@ -1519,9 +1527,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", - "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz", + "integrity": "sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==", "cpu": [ "x64" ], @@ -1811,9 +1819,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.2.tgz", - "integrity": "sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw==", + "version": "8.56.6", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.6.tgz", + "integrity": "sha512-ymwc+qb1XkjT/gfoQwxIeHZ6ixH23A+tCT2ADSA/DPVKzAjwYkTXBMCQ/f6fe4wEa85Lhp26VPeUxI7wMhAi7A==", "dev": true, "peer": true, "dependencies": { @@ -1849,10 +1857,16 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "node_modules/@types/lodash": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", + "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==", + "dev": true + }, "node_modules/@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "20.11.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", + "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", "dev": true, "peer": true, "dependencies": { @@ -1870,9 +1884,9 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { - "version": "18.2.57", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.57.tgz", - "integrity": "sha512-ZvQsktJgSYrQiMirAN60y4O/LRevIV8hUzSOSNB6gfR3/o3wCBFQx3sPwIYtuDMeiVgsSS3UzCV26tEzgnfvQw==", + "version": "18.2.67", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.67.tgz", + "integrity": "sha512-vkIE2vTIMHQ/xL0rgmuoECBCkZFZeHr49HeWSc24AptMbNRo7pwSBvj73rlJJs9fGKj0koS+V7kQB1jHS0uCgw==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1880,9 +1894,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.19", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz", - "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==", + "version": "18.2.22", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", + "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", "dev": true, "dependencies": { "@types/react": "*" @@ -1947,9 +1961,9 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "peer": true, "dependencies": { @@ -1972,9 +1986,9 @@ "peer": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true, "peer": true }, @@ -1998,16 +2012,16 @@ "peer": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { @@ -2038,30 +2052,30 @@ "peer": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -2069,26 +2083,26 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -2097,13 +2111,13 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -2217,11 +2231,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -2340,9 +2354,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001588", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz", - "integrity": "sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ==", + "version": "1.0.30001600", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001600.tgz", + "integrity": "sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==", "dev": true, "funding": [ { @@ -2450,6 +2464,18 @@ "url": "https://github.com/sponsors/mesqueeb" } }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -2489,9 +2515,9 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/date-fns": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", - "integrity": "sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", + "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==", "funding": { "type": "github", "url": "https://github.com/sponsors/kossnocorp" @@ -2547,15 +2573,15 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.677", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.677.tgz", - "integrity": "sha512-erDa3CaDzwJOpyvfKhOiJjBVNnMM0qxHq47RheVVwsSQrgBA9ZSGV9kdaOfZDPXcHzhG7lBxhj6A7KvfLJBd6Q==", + "version": "1.4.715", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.715.tgz", + "integrity": "sha512-XzWNH4ZSa9BwVUQSDorPWAUQ5WGuYz7zJUNpNif40zFCiCl20t8zgylmreNmn26h5kiyw2lg7RfTmeMBsDklqg==", "dev": true }, "node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", "dev": true, "peer": true, "dependencies": { @@ -2600,16 +2626,16 @@ } }, "node_modules/es-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", - "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.2.tgz", + "integrity": "sha512-7nOqkomXZEaxUDJw21XZNtRk739QvrPSoZoRtbsEfcii00vdzZUh6zh1CQwHhrib8MdEtJfv5rJiGeb4KuV/vw==", "dev": true, "peer": true }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, "hasInstallScript": true, "bin": { @@ -2619,29 +2645,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } }, "node_modules/escalade": { @@ -2764,9 +2790,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -2862,9 +2888,9 @@ } }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -2943,6 +2969,16 @@ "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", "dev": true }, + "node_modules/isomorphic-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", + "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", + "dev": true, + "dependencies": { + "node-fetch": "^2.6.1", + "whatwg-fetch": "^3.4.1" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -3197,9 +3233,9 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.8.0.tgz", - "integrity": "sha512-CxmUYPFcTgET1zImteG/LZOy/4T5rTojesQXkSNBiquhydn78tfbCE9sjIjnJ/UcjNjOC1bphTCCW5rrS7cXAg==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.8.1.tgz", + "integrity": "sha512-/1HDlyFRxWIZPI1ZpgqlZ8jMw/1Dp/dl3P0L1jtZ+zVcHqwPhGwaJwKL00WVgfnBy6PWCde9W65or7IIETImuA==", "dev": true, "dependencies": { "schema-utils": "^4.0.0", @@ -3273,6 +3309,26 @@ "tslib": "^2.0.3" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-releases": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", @@ -3471,9 +3527,9 @@ } }, "node_modules/react-datepicker": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-6.1.0.tgz", - "integrity": "sha512-8uz+hAOpvHqZGvD4Ky1hJ0/tLI4S9B0Gu9LV7LtLxRKXODs/xrxEay0aMVp7AW9iizTeImZh/6aA00fFaRZpJw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-6.5.0.tgz", + "integrity": "sha512-VXufB/CH04O9K/puRxr7BGBD+2Hf9mSSwG9HMa6ZP+LXckCpibllOPuRYxk4kW8W22AfLps4MY04NJAgk4JpJg==", "dependencies": { "@floating-ui/react": "^0.26.2", "classnames": "^2.2.6", @@ -3577,11 +3633,11 @@ } }, "node_modules/react-router": { - "version": "6.22.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.22.1.tgz", - "integrity": "sha512-0pdoRGwLtemnJqn1K0XHUbnKiX0S4X8CgvVVmHGOWmofESj31msHo/1YiqcJWK7Wxfq2a4uvvtS01KAQyWK/CQ==", + "version": "6.22.3", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.22.3.tgz", + "integrity": "sha512-dr2eb3Mj5zK2YISHK++foM9w4eBnO23eKnZEDs7c880P6oKbrjz/Svg9+nxqtHQK+oMW4OtjZca0RqPglXxguQ==", "dependencies": { - "@remix-run/router": "1.15.1" + "@remix-run/router": "1.15.3" }, "engines": { "node": ">=14.0.0" @@ -3591,12 +3647,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.22.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.22.1.tgz", - "integrity": "sha512-iwMyyyrbL7zkKY7MRjOVRy+TMnS/OPusaFVxM2P11x9dzSzGmLsebkCvYirGq0DWB9K9hOspHYYtDz33gE5Duw==", + "version": "6.22.3", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.22.3.tgz", + "integrity": "sha512-7ZILI7HjcE+p31oQvwbokjk6OA/bnFxrhJ19n82Ex9Ph8fNAq+Hm/7KchpMGlTgWhUxRHMMCut+vEtNpWpowKw==", "dependencies": { - "@remix-run/router": "1.15.1", - "react-router": "6.22.1" + "@remix-run/router": "1.15.3", + "react-router": "6.22.3" }, "engines": { "node": ">=14.0.0" @@ -3669,9 +3725,9 @@ } }, "node_modules/rollup": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", - "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.0.tgz", + "integrity": "sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==", "dependencies": { "@types/estree": "1.0.5" }, @@ -3683,26 +3739,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.0", - "@rollup/rollup-android-arm64": "4.12.0", - "@rollup/rollup-darwin-arm64": "4.12.0", - "@rollup/rollup-darwin-x64": "4.12.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", - "@rollup/rollup-linux-arm64-gnu": "4.12.0", - "@rollup/rollup-linux-arm64-musl": "4.12.0", - "@rollup/rollup-linux-riscv64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-musl": "4.12.0", - "@rollup/rollup-win32-arm64-msvc": "4.12.0", - "@rollup/rollup-win32-ia32-msvc": "4.12.0", - "@rollup/rollup-win32-x64-msvc": "4.12.0", + "@rollup/rollup-android-arm-eabi": "4.13.0", + "@rollup/rollup-android-arm64": "4.13.0", + "@rollup/rollup-darwin-arm64": "4.13.0", + "@rollup/rollup-darwin-x64": "4.13.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.0", + "@rollup/rollup-linux-arm64-gnu": "4.13.0", + "@rollup/rollup-linux-arm64-musl": "4.13.0", + "@rollup/rollup-linux-riscv64-gnu": "4.13.0", + "@rollup/rollup-linux-x64-gnu": "4.13.0", + "@rollup/rollup-linux-x64-musl": "4.13.0", + "@rollup/rollup-win32-arm64-msvc": "4.13.0", + "@rollup/rollup-win32-ia32-msvc": "4.13.0", + "@rollup/rollup-win32-x64-msvc": "4.13.0", "fsevents": "~2.3.2" } }, "node_modules/rollup-plugin-import-css": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-import-css/-/rollup-plugin-import-css-3.4.0.tgz", - "integrity": "sha512-997dJi7M7yYFn7tZer/UVt72mh4GH/hHBv48j3V4jsGSg+1DdYUXn+QB9SMMCNKF99pSv6QXmIOLTyeuijIsgg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-import-css/-/rollup-plugin-import-css-3.5.0.tgz", + "integrity": "sha512-JOVow6n00qt2C/NnsqPmIjFOfxIAudwWqC5SaC84CodMGiMFaP1gPAdgnJ8g8hcG+P85TCYp2kI98grYCEt5pg==", "dependencies": { "@rollup/pluginutils": "^5.0.4" }, @@ -3819,9 +3875,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "engines": { "node": ">=0.10.0" } @@ -3945,9 +4001,9 @@ } }, "node_modules/terser": { - "version": "5.27.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.2.tgz", - "integrity": "sha512-sHXmLSkImesJ4p5apTeT63DsV4Obe1s37qT8qvwHRmVxKTBH7Rv9Wr26VcAMmLbmk9UliiwK8z+657NyJHHy/w==", + "version": "5.29.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.29.2.tgz", + "integrity": "sha512-ZiGkhUBIM+7LwkNjXYJq8svgkd+QK3UUr0wJqY4MieaezBSAIPgbSPZyIx0idM6XWK5CMzSWa8MJIzmRcB8Caw==", "dev": true, "peer": true, "dependencies": { @@ -4059,10 +4115,16 @@ "node": ">=4" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "node_modules/tsconfck": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.2.tgz", - "integrity": "sha512-6lWtFjwuhS3XI4HsX4Zg0izOI3FU/AI9EGVlPEUMDIhvLPMD4wkiof0WCoDgW7qY+Dy198g4d9miAqUHWHFH6Q==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.3.tgz", + "integrity": "sha512-4t0noZX9t6GcPTfBAbIbbIU4pfpCwh0ueq3S4O/5qXI1VwK1outmxhe9dOiEWqMz3MW2LKgDTpqWV+37IWuVbA==", "dev": true, "bin": { "tsconfck": "bin/tsconfck.js" @@ -4086,10 +4148,9 @@ "dev": true }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", - "dev": true, + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4166,15 +4227,23 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/vite": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", - "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.2.tgz", + "integrity": "sha512-FWZbz0oSdLq5snUI0b6sULbz58iXFXdvkZfZWR/F0ZJuKTSPO7v72QPXt6KqYeMFb0yytNp6kZosxJ96Nr/wDQ==", "dev": true, "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.20.1", + "postcss": "^8.4.36", + "rollup": "^4.13.0" }, "bin": { "vite": "bin/vite.js" @@ -4236,14 +4305,14 @@ } }, "node_modules/vite-tsconfig-paths": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.1.tgz", - "integrity": "sha512-cfgJwcGOsIxXOLU/nELPny2/LUD/lcf1IbfyeKTv2bsupVbTH/xpFtdQlBmIP1GEK2CjjLxYhFfB+QODFAx5aw==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.2.tgz", + "integrity": "sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==", "dev": true, "dependencies": { "debug": "^4.1.1", "globrex": "^0.1.2", - "tsconfck": "^3.0.1" + "tsconfck": "^3.0.3" }, "peerDependencies": { "vite": "*" @@ -4255,9 +4324,9 @@ } }, "node_modules/vite/node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { @@ -4276,7 +4345,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -4291,9 +4360,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", + "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", "dev": true, "peer": true, "dependencies": { @@ -4304,28 +4373,34 @@ "node": ">=10.13.0" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, "node_modules/webpack": { - "version": "5.90.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.3.tgz", - "integrity": "sha512-h6uDYlWCctQRuXBs1oYpVe6sFcWedl0dpcVaTf/YF67J9bKvwJajFulMVSYKHrksMB3I/pIagRzDxwxkebuzKA==", + "version": "5.91.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", + "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", "dev": true, "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", "acorn-import-assertions": "^1.9.0", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.16.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", @@ -4333,7 +4408,7 @@ "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.0", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -4415,6 +4490,22 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/whatwg-fetch": { + "version": "3.6.20", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", + "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", diff --git a/apps/endringsmelding-frontend/src/main/js/package.json b/apps/endringsmelding-frontend/src/main/js/package.json index f55e69ead7a..93d27d3e41a 100644 --- a/apps/endringsmelding-frontend/src/main/js/package.json +++ b/apps/endringsmelding-frontend/src/main/js/package.json @@ -1,6 +1,6 @@ { "name": "endringsmelding-frontend", - "version": "1.2.11", + "version": "1.2.15", "private": true, "type": "module", "homepage": "/", @@ -8,31 +8,35 @@ "@navikt/dolly-komponenter": "^1.3.33", "@navikt/ds-icons": "^3.4.3", "@navikt/ds-react": "^6.0.0", - "@navikt/fnrvalidator": "^1.3.0", + "@navikt/fnrvalidator": "^2.0.7", + "axios": "^1.1.3", "classnames": "^2.3.1", + "cors": "^2.8.5", "dayjs": "^1.11.4", - "axios": "^1.1.3", "lodash.throttle": "^4.1.1", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.3.0", + "react-router-dom": "^6.22.3", "react-select": "^5.4.0", "styled-components": "^6.0.0" }, "devDependencies": { + "@types/lodash": "^4.14.202", "@types/react": "^18.0.15", "@types/react-dom": "^18.0.6", "@types/react-router-dom": "^5.3.3", + "@vitejs/plugin-react": "^4.0.0", "babel-plugin-styled-components": "^2.0.7", + "isomorphic-fetch": "^3.0.0", "less": "^4.1.3", + "lodash": "^4.17.21", "mini-css-extract-plugin": "^2.6.1", "prettier": "^3.0.1", + "swr": "^2.0.0", "typescript": "^5.0.2", - "@vitejs/plugin-react": "^4.0.0", "vite": "^5.0.12", "vite-plugin-svgr": "^4.0.0", - "swr": "^2.0.0", "vite-tsconfig-paths": "^4.0.0" }, "scripts": { diff --git a/apps/endringsmelding-frontend/src/main/js/src/App.tsx b/apps/endringsmelding-frontend/src/main/js/src/App.tsx index 519a26df1d9..c793e3ac073 100644 --- a/apps/endringsmelding-frontend/src/main/js/src/App.tsx +++ b/apps/endringsmelding-frontend/src/main/js/src/App.tsx @@ -12,7 +12,7 @@ const App = () => (
} /> } /> - } /> + } /> ); diff --git a/apps/endringsmelding-frontend/src/main/js/src/components/search/Search.tsx b/apps/endringsmelding-frontend/src/main/js/src/components/search/Search.tsx index 2adedcd8285..8250405d593 100644 --- a/apps/endringsmelding-frontend/src/main/js/src/components/search/Search.tsx +++ b/apps/endringsmelding-frontend/src/main/js/src/components/search/Search.tsx @@ -9,7 +9,7 @@ import { WarningAlert, WarningAlertstripe, } from '@navikt/dolly-komponenter'; -import { useIdentSearch } from '@/useIdentSearch'; +import _ from 'lodash'; import { Action } from '@/pages/endringsmelding-page/form/endringsmelding-form/EndringsmeldingReducer'; const Search = styled.div` @@ -57,18 +57,68 @@ const StyledWarning = styled(WarningAlertstripe)` width: -webkit-fill-available; `; -export default ({ labels, onChange, setMiljoer, dispatch }: Props) => { +export default ({ labels, onChange, dispatch, setMiljoer }: Props) => { const [value, setValue] = useState(''); const [search, setSearch] = useState(null); + const [response, setResponse] = useState(null); + const [loading, setLoading] = useState(null); + const [error, setError] = useState(null); - const { error, identer, loading } = useIdentSearch(search); + const renderAlert = () => { + if (_.isEmpty(response?.miljoer)) { + return null; + } else if (error) { + return ; + } else if (response.miljoer.length === 0) { + return ; + } else { + return ; + } + }; + + const hentMiljoeInfo = async (ident: string) => { + setError(false); + setLoading(true); + return fetch(`/endringsmelding-service/api/v1/ident/miljoer`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ ident: ident }), + }) + .then(async (res) => { + setLoading(false); + const jsonResponse = await res.json(); + setResponse(jsonResponse?.[0]); + }) + .catch((reason) => { + console.error(reason); + setLoading(false); + setError(true); + if (reason?.response?.status === 401 || reason?.response?.status === 403) { + console.error('Auth feilet'); + } + if (reason.status === 404 || reason.response?.status === 404) { + if (reason.response?.data?.error) { + throw new Error(reason.response?.data?.error); + } + } + throw new Error(`Henting av data fra endringsmelding-service feilet.`); + }); + }; useEffect(() => { - setMiljoer(identer?.map((ident) => ident.miljoe)); + if (search && search.length === 11) { + hentMiljoeInfo(search); + } else { + setError('Ident må være 11 siffer.'); + } + }, [search]); + + useEffect(() => { + setMiljoer(response?.miljoer); error ? dispatch({ type: Action.SET_HENT_MILJOER_ERROR_ACTION }) : dispatch({ type: Action.SET_HENT_MILJOER_SUCCESS_ACTION }); - }, [identer, error]); + }, [response, error]); return ( @@ -83,24 +133,17 @@ export default ({ labels, onChange, setMiljoer, dispatch }: P }} /> setSearch(value)} + onClick={(event: any) => { + event.preventDefault(); + setSearch(value); + }} disabled={loading || isSyntheticIdent(value)} loading={loading} > {labels.button} {isSyntheticIdent(value) && } - - {!identer ? null : identer.length === 0 ? ( - error ? ( - - ) : ( - - ) - ) : ( - - )} - + {renderAlert()} ); }; diff --git a/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/dodsmelding-form/DodsmeldingForm.tsx b/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/dodsmelding-form/DodsmeldingForm.tsx index 0d93b4705fb..23cc720de40 100644 --- a/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/dodsmelding-form/DodsmeldingForm.tsx +++ b/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/dodsmelding-form/DodsmeldingForm.tsx @@ -36,11 +36,11 @@ export default () => { ident: state.ident.trim(), handling: state.handling, }, - state.miljoer + state.miljoer, ); const getSuccessMessage = () => { - const miljoer = state.miljoer?.join(', '); + const miljoer = state.miljoer; if (state.handling === 'SETTE_DOEDSDATO') { return `Dødsmelding for ident ${state.ident} ble sendt til miljø ${miljoer}.`; } @@ -61,6 +61,9 @@ export default () => { getSuccessMessage={getSuccessMessage} setMiljoer={(miljoer) => { dispatch({ type: Action.SET_MILJOER_OPTIONS_ACTION, value: miljoer }); + if (miljoer?.length > 0) { + dispatch({ type: Action.SET_MILJOER_ACTION, value: [miljoer[0]] }); + } }} > diff --git a/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/fodselsmelding-from/FodselsmeldingForm.tsx b/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/fodselsmelding-from/FodselsmeldingForm.tsx index 4987293da2b..fb602d8ffc2 100644 --- a/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/fodselsmelding-from/FodselsmeldingForm.tsx +++ b/apps/endringsmelding-frontend/src/main/js/src/pages/endringsmelding-page/form/fodselsmelding-from/FodselsmeldingForm.tsx @@ -39,7 +39,7 @@ export default () => { foedselsdato: state.foedselsdato, kjoenn: state.kjoenType, }, - state.miljoer + state.miljoer, ).then((ident) => { dispatch({ type: Action.SET_BARNS_IDENT, value: ident.trim() }); return Promise.resolve(ident); @@ -60,6 +60,10 @@ export default () => { getSuccessMessage={getSuccessMessage} setMiljoer={(miljoer) => { dispatch({ type: Action.SET_MILJOER_OPTIONS_ACTION, value: miljoer }); + + if (miljoer?.length > 0) { + dispatch({ type: Action.SET_MILJOER_ACTION, value: [miljoer[0]] }); + } }} > diff --git a/apps/endringsmelding-frontend/src/main/js/src/useIdentSearch.tsx b/apps/endringsmelding-frontend/src/main/js/src/useIdentSearch.tsx deleted file mode 100644 index 76e678a3e15..00000000000 --- a/apps/endringsmelding-frontend/src/main/js/src/useIdentSearch.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import useSWR from 'swr'; -import axios from 'axios'; - -const fetcher = (url, headers) => - axios - .get(url, { headers: headers }) - .then((res) => { - return res.data; - }) - .catch((reason) => { - if (reason?.response?.status === 401 || reason?.response?.status === 403) { - console.error('Auth feilet'); - } - if (reason.status === 404 || reason.response?.status === 404) { - if (reason.response?.data?.error) { - throw new Error(reason.response?.data?.error); - } - } - throw new Error(`Henting av data fra ${url} feilet.`); - }); - -const getIdentSearchUrl = (ident) => { - return ident ? `/endringsmelding-service/api/v1/identer/${ident}/miljoer` : null; -}; - -export const useIdentSearch = (ident) => { - const { data, isLoading, error } = useSWR(getIdentSearchUrl(ident), fetcher); - - return { - identer: data, - loading: isLoading, - error: error, - }; -}; diff --git a/apps/endringsmelding-frontend/src/main/resources/application.yml b/apps/endringsmelding-frontend/src/main/resources/application.yml index d17fabe319b..b80dc78aaaf 100644 --- a/apps/endringsmelding-frontend/src/main/resources/application.yml +++ b/apps/endringsmelding-frontend/src/main/resources/application.yml @@ -60,6 +60,8 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always logging: level: diff --git a/apps/endringsmelding-frontend/src/main/resources/logback-spring.xml b/apps/endringsmelding-frontend/src/main/resources/logback-spring.xml index 52c15597b3c..9ebcb909c3d 100644 --- a/apps/endringsmelding-frontend/src/main/resources/logback-spring.xml +++ b/apps/endringsmelding-frontend/src/main/resources/logback-spring.xml @@ -36,5 +36,4 @@ - \ No newline at end of file diff --git a/apps/endringsmelding-service/config.yml b/apps/endringsmelding-service/config.yml index 0eb96c908cb..4e0c0a762e8 100644 --- a/apps/endringsmelding-service/config.yml +++ b/apps/endringsmelding-service/config.yml @@ -28,6 +28,9 @@ spec: outbound: rules: - application: testnav-tps-messaging-service + - application: testnav-ident-pool + - application: generer-navn-service + - application: testnav-adresse-service external: - host: tps-forvalteren-proxy.dev-fss-pub.nais.io liveness: diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/EndringsmeldingServiceApplicationStarter.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/EndringsmeldingServiceApplicationStarter.java index ba8d360a362..5f6bc7c91ce 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/EndringsmeldingServiceApplicationStarter.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/EndringsmeldingServiceApplicationStarter.java @@ -17,4 +17,4 @@ public class EndringsmeldingServiceApplicationStarter { public static void main(String[] args) { SpringApplication.run(EndringsmeldingServiceApplicationStarter.class, args); } -} \ No newline at end of file +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/Consumers.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/Consumers.java index 0b633903ee0..67a149f36c7 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/Consumers.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/Consumers.java @@ -26,5 +26,7 @@ public class Consumers { private ServerProperties tpsForvalterenProxy; private ServerProperties tpsMessagingService; - + private ServerProperties adresseService; + private ServerProperties genererNavnService; + private ServerProperties identPool; } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/AdresseServiceConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/AdresseServiceConsumer.java new file mode 100644 index 00000000000..d9234331567 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/AdresseServiceConsumer.java @@ -0,0 +1,38 @@ +package no.nav.testnav.endringsmeldingservice.consumer; + +import no.nav.testnav.endringsmeldingservice.config.Consumers; +import no.nav.testnav.endringsmeldingservice.consumer.command.VegadresseServiceCommand; +import no.nav.testnav.libs.dto.adresseservice.v1.VegadresseDTO; +import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; +import no.nav.testnav.libs.securitycore.domain.ServerProperties; +import org.springframework.stereotype.Service; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; + +import java.util.List; + +@Service +public class AdresseServiceConsumer { + private final WebClient webClient; + private final TokenExchange tokenExchange; + private final ServerProperties serverProperties; + + public AdresseServiceConsumer( + TokenExchange tokenExchange, + Consumers consumers) { + this.tokenExchange = tokenExchange; + serverProperties = consumers.getAdresseService(); + this.webClient = WebClient + .builder() + .baseUrl(serverProperties.getUrl()) + .build(); + } + + public Mono> getVegadresse() { + + return tokenExchange.exchange(serverProperties) + .flatMapMany(token -> new VegadresseServiceCommand(webClient, token.getTokenValue()).call()) + .collectList(); + + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/GenererNavnServiceConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/GenererNavnServiceConsumer.java new file mode 100644 index 00000000000..905d09107e1 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/GenererNavnServiceConsumer.java @@ -0,0 +1,38 @@ +package no.nav.testnav.endringsmeldingservice.consumer; + +import no.nav.testnav.endringsmeldingservice.config.Consumers; +import no.nav.testnav.endringsmeldingservice.consumer.command.GenererNavnServiceCommand; +import no.nav.testnav.libs.dto.generernavnservice.v1.NavnDTO; +import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; +import no.nav.testnav.libs.securitycore.domain.ServerProperties; +import org.springframework.stereotype.Service; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; + +import java.util.List; + +@Service +public class GenererNavnServiceConsumer { + + private final WebClient webClient; + private final TokenExchange tokenExchange; + private final ServerProperties serverProperties; + + public GenererNavnServiceConsumer( + TokenExchange tokenExchange, + Consumers consumers) { + this.tokenExchange = tokenExchange; + serverProperties = consumers.getGenererNavnService(); + this.webClient = WebClient + .builder() + .baseUrl(serverProperties.getUrl()) + .build(); + } + + public Mono> getNavn() { + + return tokenExchange.exchange(serverProperties) + .flatMapMany(token -> new GenererNavnServiceCommand(webClient, 1, token.getTokenValue()).call()) + .collectList(); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/IdentPoolConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/IdentPoolConsumer.java new file mode 100644 index 00000000000..76c17363321 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/IdentPoolConsumer.java @@ -0,0 +1,38 @@ +package no.nav.testnav.endringsmeldingservice.consumer; + +import no.nav.testnav.endringsmeldingservice.config.Consumers; +import no.nav.testnav.endringsmeldingservice.consumer.command.IdentpoolPostCommand; +import no.nav.testnav.endringsmeldingservice.consumer.dto.HentIdenterRequest; +import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; +import no.nav.testnav.libs.securitycore.domain.ServerProperties; +import org.springframework.stereotype.Service; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; + +import java.util.List; + +@Service +public class IdentPoolConsumer { + + private final WebClient webClient; + private final TokenExchange tokenExchange; + private final ServerProperties serverProperties; + + public IdentPoolConsumer( + TokenExchange tokenExchange, + Consumers consumers) { + this.tokenExchange = tokenExchange; + serverProperties = consumers.getIdentPool(); + this.webClient = WebClient + .builder() + .baseUrl(serverProperties.getUrl()) + .build(); + } + + public Mono> acquireIdents(HentIdenterRequest request) { + + return tokenExchange.exchange(serverProperties) + .flatMap(token -> new IdentpoolPostCommand(webClient, request, + token.getTokenValue()).call()); + } +} \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsForvalterConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsForvalterConsumer.java index c35e4f060e6..952856c6331 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsForvalterConsumer.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsForvalterConsumer.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import no.nav.testnav.endringsmeldingservice.config.Consumers; -import no.nav.testnav.endringsmeldingservice.consumer.command.SendDoedsmeldingCommand; -import no.nav.testnav.endringsmeldingservice.consumer.command.SendFoedselsmeldingCommand; +import no.nav.testnav.endringsmeldingservice.consumer.command.SendDoedsmeldingOldCommand; +import no.nav.testnav.endringsmeldingservice.consumer.command.SendFoedselsmeldingOldCommand; import no.nav.testnav.endringsmeldingservice.consumer.dto.DoedsmeldingDTO; import no.nav.testnav.endringsmeldingservice.consumer.request.FoedselsmeldingRequest; import no.nav.testnav.endringsmeldingservice.domain.Status; @@ -53,14 +53,14 @@ public TpsForvalterConsumer( public Mono sendFoedselsmelding(FoedselsmeldingDTO dto, Set miljoer) { return accessTokenService .exchange(serverProperties) - .flatMap(accessToken -> new SendFoedselsmeldingCommand(webClient, new FoedselsmeldingRequest(dto, miljoer), accessToken.getTokenValue()).call()) + .flatMap(accessToken -> new SendFoedselsmeldingOldCommand(webClient, new FoedselsmeldingRequest(dto, miljoer), accessToken.getTokenValue()).call()) .map(Status::new); } public Mono sendDoedsmelding(no.nav.testnav.libs.dto.endringsmelding.v1.DoedsmeldingDTO dto, Set miljoer) { return accessTokenService .exchange(serverProperties) - .flatMap(accessToken -> new SendDoedsmeldingCommand(webClient, new DoedsmeldingDTO(dto, miljoer), accessToken.getTokenValue()).call()) + .flatMap(accessToken -> new SendDoedsmeldingOldCommand(webClient, new DoedsmeldingDTO(dto, miljoer), accessToken.getTokenValue()).call()) .map(Status::new); } } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java index dbed99e80e6..9888efcefc9 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/TpsMessagingConsumer.java @@ -1,9 +1,26 @@ package no.nav.testnav.endringsmeldingservice.consumer; import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; import no.nav.testnav.endringsmeldingservice.config.Consumers; +import no.nav.testnav.endringsmeldingservice.consumer.command.GetAdressehistorikkCommand; +import no.nav.testnav.endringsmeldingservice.consumer.command.GetEksistererPersonCommand; import no.nav.testnav.endringsmeldingservice.consumer.command.GetIdentEnvironmentsCommand; +import no.nav.testnav.endringsmeldingservice.consumer.command.GetPersondataCommand; +import no.nav.testnav.endringsmeldingservice.consumer.command.SendDoedsmeldingCommand; +import no.nav.testnav.endringsmeldingservice.consumer.command.SendFoedselsmeldingCommand; +import no.nav.testnav.endringsmeldingservice.consumer.command.SendKansellerDoedsmeldingCommand; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.IdentMiljoeDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonMiljoeDTO; +import no.nav.testnav.endringsmeldingservice.domain.IdenterRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.TpsIdentStatusDTO; import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; import no.nav.testnav.libs.securitycore.domain.ServerProperties; import org.springframework.http.MediaType; @@ -13,7 +30,12 @@ import org.springframework.web.reactive.function.client.ExchangeStrategies; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import java.time.LocalDate; +import java.util.Set; + +@Slf4j @Component public class TpsMessagingConsumer { private final WebClient webClient; @@ -44,9 +66,71 @@ public TpsMessagingConsumer( .build(); } - public Flux hentMiljoer(String ident) { + public Flux hentMiljoer(IdenterRequest body) { // Skal ryddes til slutt + return accessTokenService + .exchange(serverProperties) + .flatMapMany(accessToken -> new GetIdentEnvironmentsCommand(webClient, body.ident(), accessToken.getTokenValue()).call()); + } + + public Flux getEksistererPerson(Set identer, Set miljoer) { + + return accessTokenService + .exchange(serverProperties) + .flatMapMany(accessToken -> new GetEksistererPersonCommand(webClient, identer, miljoer, accessToken.getTokenValue()).call()) + .doOnNext(resultat -> log.info("Get eksisterende resultat {}", resultat)); + } + + public Flux getPersondata(String ident, Set miljoer) { + + return accessTokenService + .exchange(serverProperties) + .flatMapMany(accessToken -> new GetPersondataCommand(webClient, ident, miljoer, accessToken.getTokenValue()).call()); + } + + public Flux getAdressehistorikk(String ident, LocalDate aksjonsdato, Set miljoer) { + + return getAdressehistorikk(AdressehistorikkRequest.builder() + .ident(ident) + .aksjonsdato(aksjonsdato) + .build(), + miljoer); + } + + public Flux getAdressehistorikk(AdressehistorikkRequest request, Set miljoer) { + + return accessTokenService + .exchange(serverProperties) + .flatMapMany(accessToken -> + new GetAdressehistorikkCommand(webClient, request, miljoer, accessToken.getTokenValue()).call()) + .doOnNext(response -> log.info("Adressehistorikk mottatt: {}", response)); + } + + public Mono sendKansellerDoedsmelding(PersonDTO person, Set miljoer) { + + return accessTokenService + .exchange(serverProperties) + .flatMap(accessToken -> + new SendKansellerDoedsmeldingCommand(webClient, person, miljoer, accessToken.getTokenValue()).call()) + .doOnNext(response -> log.info("Mottatt status for kanseller dødsmelding {}", response)); + } + + public Mono sendDoedsmelding(DoedsmeldingRequest request, Set miljoer) { + + return accessTokenService + .exchange(serverProperties) + .flatMap(accessToken -> + new SendDoedsmeldingCommand(webClient, request, miljoer, accessToken.getTokenValue()).call()) + .doOnNext(response -> log.info("Mottatt status for dødsmelding {}", response)); + } + + public Mono sendFoedselsmelding(FoedselsmeldingRequest request, Set miljoer) { + + log.info("Sender fødselsmelding til miljøer {} {}", miljoer, request); + return accessTokenService .exchange(serverProperties) - .flatMapMany(accessToken -> new GetIdentEnvironmentsCommand(webClient, ident, accessToken.getTokenValue()).call()); + .flatMap(accessToken -> + new SendFoedselsmeldingCommand(webClient, request, miljoer, accessToken.getTokenValue()).call()) + .doOnNext(response -> log.info("Mottatt status for fødselsmelding {}", response)); } } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GenererNavnServiceCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GenererNavnServiceCommand.java new file mode 100644 index 00000000000..6953946a4e8 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GenererNavnServiceCommand.java @@ -0,0 +1,38 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.libs.dto.generernavnservice.v1.NavnDTO; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.concurrent.Callable; + +@RequiredArgsConstructor +public class GenererNavnServiceCommand implements Callable> { + + private static final String NAVN_URL = "/api/v1/navn"; + + private final WebClient webClient; + private final Integer antall; + private final String token; + + @Override + public Flux call() { + + return webClient + .get() + .uri(builder -> builder.path(NAVN_URL).queryParam("antall", antall).build()) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .retrieve() + .bodyToFlux(NavnDTO.class) + .doOnError(WebClientFilter::logErrorMessage) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)); + } +} \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetAdressehistorikkCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetAdressehistorikkCommand.java new file mode 100644 index 00000000000..8b4c950049a --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetAdressehistorikkCommand.java @@ -0,0 +1,44 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkRequest; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.Set; +import java.util.concurrent.Callable; + +@RequiredArgsConstructor +public class GetAdressehistorikkCommand implements Callable> { + + private static final String ADRESSE_HIST_URL = "/api/v1/personer/adressehistorikk"; + private static final String MILJOER = "miljoer"; + + private final WebClient webClient; + private final AdressehistorikkRequest request; + private final Set miljoer; + private final String token; + + @Override + public Flux call() { + + return webClient + .post() + .uri(builder -> builder.path(ADRESSE_HIST_URL) + .queryParam(MILJOER, miljoer) + .build()) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .body(BodyInserters.fromValue(request)) + .retrieve() + .bodyToFlux(AdressehistorikkDTO.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .doOnError(WebClientFilter::logErrorMessage); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetEksistererPersonCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetEksistererPersonCommand.java new file mode 100644 index 00000000000..b569e68923e --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetEksistererPersonCommand.java @@ -0,0 +1,47 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.IdentMiljoeDTO; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.Callable; + +@RequiredArgsConstructor +public class GetEksistererPersonCommand implements Callable> { + + private static final String PERSON_DATA_URL = "/api/v1/identer"; + private static final String MILJOER = "miljoer"; + private static final String IDENTER = "identer"; + + private static final String INCLUDE_PROD = "includeProd"; + + private final WebClient webClient; + private final Set identer; + private final Set miljoer; + private final String token; + + @Override + public Flux call() { + + return webClient + .get() + .uri(builder -> builder.path(PERSON_DATA_URL) + .queryParam(IDENTER, identer) + .queryParamIfPresent(MILJOER, Optional.ofNullable(miljoer)) + .queryParam(INCLUDE_PROD, true) + .build()) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .retrieve() + .bodyToFlux(IdentMiljoeDTO.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .doOnError(WebClientFilter::logErrorMessage); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetIdentEnvironmentsCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetIdentEnvironmentsCommand.java index c0c14e4e837..b11c0792820 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetIdentEnvironmentsCommand.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetIdentEnvironmentsCommand.java @@ -2,7 +2,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonMiljoeDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.TpsIdentStatusDTO; import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import org.springframework.http.HttpHeaders; import org.springframework.web.reactive.function.client.WebClient; @@ -14,20 +14,22 @@ @Slf4j @RequiredArgsConstructor -public class GetIdentEnvironmentsCommand implements Callable> { +public class GetIdentEnvironmentsCommand implements Callable> { private final WebClient webClient; private final String ident; private final String token; @Override - public Flux call() { + public Flux call() { return webClient .get() - .uri(builder -> builder.path("/api/v1/personer/{ident}") + .uri(builder -> builder.path("/api/v1/identer") + .queryParam("identer", ident) + .queryParam("includeProd", false) .build(ident)) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .retrieve() - .bodyToFlux(PersonMiljoeDTO.class) + .bodyToFlux(TpsIdentStatusDTO.class) .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) .filter(WebClientFilter::is5xxException)); } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetPersondataCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetPersondataCommand.java new file mode 100644 index 00000000000..63c7c8dd37c --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/GetPersondataCommand.java @@ -0,0 +1,41 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonMiljoeDTO; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.Set; +import java.util.concurrent.Callable; + +@RequiredArgsConstructor +public class GetPersondataCommand implements Callable> { + + private static final String PERSON_DATA_URL = "/api/v1/personer/{ident}"; + private static final String MILJOER = "miljoer"; + + private final WebClient webClient; + private final String ident; + private final Set miljoer; + private final String token; + + @Override + public Flux call() { + + return webClient + .get() + .uri(builder -> builder.path(PERSON_DATA_URL) + .queryParam(MILJOER, miljoer) + .build(ident)) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .retrieve() + .bodyToFlux(PersonMiljoeDTO.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .doOnError(WebClientFilter::logErrorMessage); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/IdentpoolPostCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/IdentpoolPostCommand.java new file mode 100644 index 00000000000..5e682ab1bfa --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/IdentpoolPostCommand.java @@ -0,0 +1,46 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.testnav.endringsmeldingservice.consumer.dto.HentIdenterRequest; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.Callable; + +@Slf4j +@RequiredArgsConstructor +public class IdentpoolPostCommand implements Callable>> { + + private static final String ACQUIRE_IDENTS_URL = "/api/v1/identifikator"; + + private final WebClient webClient; + private final HentIdenterRequest body; + private final String token; + + @Override + public Mono> call() { + return webClient + .post() + .uri(builder -> builder.path(ACQUIRE_IDENTS_URL).build()) + .body(BodyInserters.fromValue(body)) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .retrieve() + .bodyToMono(String[].class) + .map(Arrays::asList) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException) + .onRetryExhaustedThrow((retryBackoffSpec, retrySignal) -> + new InternalError("Identpool: antall repeterende forsøk nådd"))) + .doOnError(WebClientFilter::logErrorMessage); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendDoedsmeldingCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendDoedsmeldingCommand.java index 34739353b95..9ef9c0bd681 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendDoedsmeldingCommand.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendDoedsmeldingCommand.java @@ -1,47 +1,44 @@ package no.nav.testnav.endringsmeldingservice.consumer.command; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import no.nav.testnav.endringsmeldingservice.consumer.dto.DoedsmeldingDTO; -import no.nav.testnav.endringsmeldingservice.consumer.response.EndringsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingResponse; import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import org.springframework.http.HttpHeaders; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.client.WebClient; -import org.springframework.web.reactive.function.client.WebClientResponseException; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; import java.time.Duration; +import java.util.Set; import java.util.concurrent.Callable; -@Slf4j @RequiredArgsConstructor -public class SendDoedsmeldingCommand implements Callable> { +public class SendDoedsmeldingCommand implements Callable> { + + private static final String DOEDSMELDING_URL = "/api/v1/personer/doedsmelding"; + private static final String MILJOER = "miljoer"; + private final WebClient webClient; - private final DoedsmeldingDTO dto; + private final DoedsmeldingRequest request; + private final Set miljoer; private final String token; @Override - public Mono call() { + public Mono call() { + return webClient .post() - .uri("/api/v1/tpsmelding/doedsmelding") + .uri(builder -> builder.path(DOEDSMELDING_URL) + .queryParam(MILJOER, miljoer) + .build()) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) - .body(BodyInserters.fromPublisher(Mono.just(dto), DoedsmeldingDTO.class)) + .body(BodyInserters.fromValue(request)) .retrieve() - .bodyToMono(EndringsmeldingResponse.class) + .bodyToMono(DoedsmeldingResponse.class) .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) .filter(WebClientFilter::is5xxException)) - .doOnError(error -> { - if (error instanceof WebClientResponseException) { - log.error( - "Feil ved innsendelse av dødsmelding. Feilmelding: {}.", - ((WebClientResponseException) error).getResponseBodyAsString() - ); - } else { - log.error("Feil ved innsendelse av dødsmelding.", error); - } - }); + .doOnError(WebClientFilter::logErrorMessage); } } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendDoedsmeldingOldCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendDoedsmeldingOldCommand.java new file mode 100644 index 00000000000..ef314c3f595 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendDoedsmeldingOldCommand.java @@ -0,0 +1,47 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.testnav.endringsmeldingservice.consumer.dto.DoedsmeldingDTO; +import no.nav.testnav.endringsmeldingservice.consumer.response.EndringsmeldingResponse; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.concurrent.Callable; + +@Slf4j +@RequiredArgsConstructor +public class SendDoedsmeldingOldCommand implements Callable> { + private final WebClient webClient; + private final DoedsmeldingDTO dto; + private final String token; + + @Override + public Mono call() { + return webClient + .post() + .uri("/api/v1/tpsmelding/doedsmelding") + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .body(BodyInserters.fromPublisher(Mono.just(dto), DoedsmeldingDTO.class)) + .retrieve() + .bodyToMono(EndringsmeldingResponse.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .doOnError(error -> { + if (error instanceof WebClientResponseException) { + log.error( + "Feil ved innsendelse av dødsmelding. Feilmelding: {}.", + ((WebClientResponseException) error).getResponseBodyAsString() + ); + } else { + log.error("Feil ved innsendelse av dødsmelding.", error); + } + }); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendFoedselsmeldingCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendFoedselsmeldingCommand.java index 96a95f5a0c6..abb2d14229a 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendFoedselsmeldingCommand.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendFoedselsmeldingCommand.java @@ -1,47 +1,44 @@ package no.nav.testnav.endringsmeldingservice.consumer.command; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import no.nav.testnav.endringsmeldingservice.consumer.request.FoedselsmeldingRequest; -import no.nav.testnav.endringsmeldingservice.consumer.response.EndringsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingResponse; import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import org.springframework.http.HttpHeaders; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.client.WebClient; -import org.springframework.web.reactive.function.client.WebClientResponseException; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; import java.time.Duration; +import java.util.Set; import java.util.concurrent.Callable; -@Slf4j @RequiredArgsConstructor -public class SendFoedselsmeldingCommand implements Callable> { +public class SendFoedselsmeldingCommand implements Callable> { + + private static final String FOEDSELSMELDING_URL = "/api/v1/personer/foedselsmelding"; + private static final String MILJOER = "miljoer"; + private final WebClient webClient; private final FoedselsmeldingRequest request; + private final Set miljoer; private final String token; @Override - public Mono call() { + public Mono call() { + return webClient .post() - .uri("/api/v1/tpsmelding/foedselsmelding") + .uri(builder -> builder.path(FOEDSELSMELDING_URL) + .queryParam(MILJOER, miljoer) + .build()) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) - .body(BodyInserters.fromPublisher(Mono.just(request), FoedselsmeldingRequest.class)) + .body(BodyInserters.fromValue(request)) .retrieve() - .bodyToMono(EndringsmeldingResponse.class) + .bodyToMono(FoedselsmeldingResponse.class) .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) .filter(WebClientFilter::is5xxException)) - .doOnError(error -> { - if (error instanceof WebClientResponseException) { - log.error( - "Feil ved innsendelse av fødseslmelding. Feilmelding: {}.", - ((WebClientResponseException) error).getResponseBodyAsString() - ); - } else { - log.error("Feil ved innsendelse av fødseslmelding.", error); - } - }); + .doOnError(WebClientFilter::logErrorMessage); } } diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendFoedselsmeldingOldCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendFoedselsmeldingOldCommand.java new file mode 100644 index 00000000000..3ca70f1e1c2 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendFoedselsmeldingOldCommand.java @@ -0,0 +1,47 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.testnav.endringsmeldingservice.consumer.request.FoedselsmeldingRequest; +import no.nav.testnav.endringsmeldingservice.consumer.response.EndringsmeldingResponse; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.concurrent.Callable; + +@Slf4j +@RequiredArgsConstructor +public class SendFoedselsmeldingOldCommand implements Callable> { + private final WebClient webClient; + private final FoedselsmeldingRequest request; + private final String token; + + @Override + public Mono call() { + return webClient + .post() + .uri("/api/v1/tpsmelding/foedselsmelding") + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .body(BodyInserters.fromPublisher(Mono.just(request), FoedselsmeldingRequest.class)) + .retrieve() + .bodyToMono(EndringsmeldingResponse.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .doOnError(error -> { + if (error instanceof WebClientResponseException) { + log.error( + "Feil ved innsendelse av fødseslmelding. Feilmelding: {}.", + ((WebClientResponseException) error).getResponseBodyAsString() + ); + } else { + log.error("Feil ved innsendelse av fødseslmelding.", error); + } + }); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendKansellerDoedsmeldingCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendKansellerDoedsmeldingCommand.java new file mode 100644 index 00000000000..7e446f23ced --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/SendKansellerDoedsmeldingCommand.java @@ -0,0 +1,45 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.Set; +import java.util.concurrent.Callable; + +@RequiredArgsConstructor +public class SendKansellerDoedsmeldingCommand implements Callable> { + + private static final String DOEDSMELDING_URL = "/api/v1/personer/doedsmelding"; + private static final String MILJOER = "miljoer"; + + private final WebClient webClient; + private final PersonDTO person; + private final Set miljoer; + private final String token; + + @Override + public Mono call() { + + return webClient + .method(HttpMethod.DELETE) + .uri(builder -> builder.path(DOEDSMELDING_URL) + .queryParam(MILJOER, miljoer) + .build()) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .body(BodyInserters.fromValue(person)) + .retrieve() + .bodyToMono(DoedsmeldingResponse.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .doOnError(WebClientFilter::logErrorMessage); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/VegadresseServiceCommand.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/VegadresseServiceCommand.java new file mode 100644 index 00000000000..3702d40ba65 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/command/VegadresseServiceCommand.java @@ -0,0 +1,56 @@ +package no.nav.testnav.endringsmeldingservice.consumer.command; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.libs.dto.adresseservice.v1.VegadresseDTO; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import reactor.core.Exceptions; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.concurrent.Callable; + +@RequiredArgsConstructor +public class VegadresseServiceCommand implements Callable> { + + private static final String ADRESSER_VEG_URL = "/api/v1/adresser/veg"; + + private final WebClient webClient; + private final String token; + + @Override + public Flux call() { + + return webClient + .get() + .uri(builder -> builder.path(ADRESSER_VEG_URL).build()) + .header("antall", "1") + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .retrieve() + .bodyToFlux(VegadresseDTO.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .onErrorResume(throwable -> throwable instanceof WebClientResponseException.NotFound || + throwable instanceof WebClientResponseException.BadRequest || + Exceptions.isRetryExhausted(throwable), + throwable -> Mono.just(defaultAdresse())); + } + + public static VegadresseDTO defaultAdresse() { + + return VegadresseDTO.builder() + .matrikkelId("285693617") + .adressenavn("FYRSTIKKALLÉEN") + .postnummer("0661") + .husnummer(2) + .kommunenummer("0301") + .poststed("Oslo") + .build(); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/dto/HentIdenterRequest.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/dto/HentIdenterRequest.java new file mode 100644 index 00000000000..0e0f5df9eea --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/consumer/dto/HentIdenterRequest.java @@ -0,0 +1,37 @@ +package no.nav.testnav.endringsmeldingservice.consumer.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import jakarta.validation.constraints.NotNull; +import java.time.LocalDate; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class HentIdenterRequest { + + private Identtype identtype; + private LocalDate foedtEtter; + private LocalDate foedtFoer; + private Kjoenn kjoenn; + + @NotNull + private int antall; + private String rekvirertAv; + private Boolean syntetisk; + + public enum Identtype { + FNR, + DNR, + BOST + } + + public enum Kjoenn { + KVINNE, + MANN + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/controller/IdentMiljoeController.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/controller/IdentMiljoeController.java index 2eda8247e5d..2b48adc7daa 100644 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/controller/IdentMiljoeController.java +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/controller/IdentMiljoeController.java @@ -1,23 +1,26 @@ package no.nav.testnav.endringsmeldingservice.controller; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import no.nav.testnav.endringsmeldingservice.consumer.TpsMessagingConsumer; -import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonMiljoeDTO; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; +import no.nav.testnav.endringsmeldingservice.domain.IdenterRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.TpsIdentStatusDTO; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux; @RestController -@RequestMapping("/api/v1/identer/{ident}/miljoer") +@RequestMapping("/api/v1/ident") @RequiredArgsConstructor public class IdentMiljoeController { private final TpsMessagingConsumer tpsMessagingConsumer; - @GetMapping - public Flux getMiljoer(@PathVariable String ident) { - return tpsMessagingConsumer.hentMiljoer(ident); + @PostMapping("/miljoer") + @Operation(description = "Sjekk om ident finnes i miljøer") + public Flux identFinnesIMiljoer(@RequestBody IdenterRequest body) { + return tpsMessagingConsumer.hentMiljoer(body); } -} +} \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/controller/SkdEndringsmeldingerController.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/controller/SkdEndringsmeldingerController.java new file mode 100644 index 00000000000..a07b93a17d4 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/controller/SkdEndringsmeldingerController.java @@ -0,0 +1,52 @@ +package no.nav.testnav.endringsmeldingservice.controller; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.endringsmeldingservice.service.DoedsmeldingService; +import no.nav.testnav.endringsmeldingservice.service.FoedselsmeldingService; +import no.nav.testnav.libs.dto.endringsmelding.v2.DoedsmeldingDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.DoedsmeldingResponseDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.FoedselsmeldingDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.FoedselsmeldingResponseDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.KansellerDoedsmeldingDTO; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import reactor.core.publisher.Mono; + +import java.util.Set; + +@RestController +@RequestMapping("/api/v2/endringsmelding") +@RequiredArgsConstructor +public class SkdEndringsmeldingerController { + + private final FoedselsmeldingService foedselsmeldingService; + private final DoedsmeldingService doedsmeldingService; + + @PostMapping("/foedselsmelding") + public Mono sendFoedselsmelding( + @RequestHeader Set miljoer, + @RequestBody FoedselsmeldingDTO dto) { + + return foedselsmeldingService.sendFoedselsmelding(dto, miljoer); + } + + @PostMapping("/doedsmelding") + public Mono sendDoedsmelding( + @RequestHeader Set miljoer, + @RequestBody DoedsmeldingDTO doedsmelding) { + + return doedsmeldingService.sendDoedsmelding(doedsmelding, miljoer); + } + + @DeleteMapping("/doedsmelding") + public Mono kansellerDoedsmelding( + @RequestHeader Set miljoer, + @RequestBody KansellerDoedsmeldingDTO kansellerDoedsmelding) { + + return doedsmeldingService.sendKansellerDoedsmelding(kansellerDoedsmelding.getIdent(), miljoer); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/domain/IdenterRequest.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/domain/IdenterRequest.java new file mode 100644 index 00000000000..1d2c9fc4589 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/domain/IdenterRequest.java @@ -0,0 +1,4 @@ +package no.nav.testnav.endringsmeldingservice.domain; + +public record IdenterRequest(String ident) { +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/AdressehistorikkMapper.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/AdressehistorikkMapper.java new file mode 100644 index 00000000000..7d7c8ebb28f --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/AdressehistorikkMapper.java @@ -0,0 +1,115 @@ +package no.nav.testnav.endringsmeldingservice.mapper; + +import lombok.experimental.UtilityClass; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.GateadresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.MatrikkeladresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonMiljoeDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PostadresseDTO; + +import java.time.LocalDate; + +@UtilityClass +public class AdressehistorikkMapper { + + public static PersonDTO mapHistorikk(AdressehistorikkDTO.PersonData person) { + + return PersonDTO.builder() + .ident(person.getIdent()) + .identtype(person.getIdentType()) + .boadresse(mapBoadresse(person)) + .postadresse(person.getPostAdresse().stream() + .map(postadresse -> PostadresseDTO.builder() + .postLinje1(postadresse.getAdresse1()) + .postLinje2(postadresse.getAdresse2()) + .postLinje3(postadresse.getAdresse3()) + .postLand(postadresse.getLand()) + .build() + ) + .findFirst() + .orElse(null) + ) + .build(); + } + + public static AdresseDTO mapBoadresse(AdressehistorikkDTO.PersonData person) { + + return (AdresseDTO) person.getBostedsAdresse().stream() + .map(boadresse -> { + + if ("OFFA".equals(boadresse.getAdresseType())) { + return GateadresseDTO.builder() + .gatekode(boadresse.getOffAdresse().getGatekode()) + .adresse(boadresse.getOffAdresse().getGateNavn()) + .husnummer(boadresse.getOffAdresse().getHusnr()) + .husbokstav(boadresse.getOffAdresse().getBokstav()) + .bolignr(boadresse.getBolignr()) + .flyttedato(boadresse.getDatoFom().atStartOfDay()) + .postnr(boadresse.getPostnr()) + .kommunenr(boadresse.getKommunenr()) + .tilleggsadresse(boadresse.getTilleggsAdresseSKD()) + .build(); + } else { + + return MatrikkeladresseDTO.builder() + .mellomnavn(boadresse.getMatrAdresse().getMellomAdresse()) + .gardsnr(boadresse.getMatrAdresse().getGardsnr()) + .bruksnr(boadresse.getMatrAdresse().getBruksnr()) + .festenr(boadresse.getMatrAdresse().getFestenr()) + .undernr(boadresse.getMatrAdresse().getUndernr()) + .bolignr(boadresse.getBolignr()) + .flyttedato(boadresse.getDatoFom().atStartOfDay()) + .postnr(boadresse.getPostnr()) + .kommunenr(boadresse.getKommunenr()) + .tilleggsadresse(boadresse.getTilleggsAdresseSKD()); + } + }) + .findFirst() + .orElse(null); + } + + public static PostadresseDTO mapPostBoadresse(AdressehistorikkDTO.PersonData person) { + + return (PostadresseDTO) person.getBostedsAdresse().stream() + .map(boadresse -> { + + if ("OFFA".equals(boadresse.getAdresseType())) { + return PostadresseDTO.builder() + .postLinje1("%s %s%s".formatted(boadresse.getOffAdresse().getGateNavn(), + boadresse.getOffAdresse().getHusnr(), + boadresse.getOffAdresse().getBokstav())) + .postLinje2("%s %s".formatted(boadresse.getPostnr(), boadresse.getPoststed())) + .postLand("NOR") + .build(); + } else { + + return PostadresseDTO.builder() + .postLinje1("Gardsnummer: " + boadresse.getMatrAdresse().getGardsnr()) + .postLinje2("Bruksnummer: " + boadresse.getMatrAdresse().getBruksnr()) + .postLinje3("Kommunenummer: " + boadresse.getKommunenr()) + .postLand("NOR"); + } + }) + .findFirst() + .orElse(null); + } + + public static AdressehistorikkRequest buildAdresseRequest(PersonMiljoeDTO person) { + + return AdressehistorikkRequest.builder() + .ident(person.getIdent()) + .aksjonsdato(person.getPerson().getDoedsdato().toLocalDate().minusDays(1)) + .build(); + } + + public static AdressehistorikkRequest buildAdresseRequest(String ident, LocalDate aksjonsdato) { + + return AdressehistorikkRequest.builder() + .ident(ident) + .aksjonsdato(aksjonsdato) + .build(); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/FoedselsmeldingRequestMapper.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/FoedselsmeldingRequestMapper.java new file mode 100644 index 00000000000..175dbbd4ea8 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/FoedselsmeldingRequestMapper.java @@ -0,0 +1,112 @@ +package no.nav.testnav.endringsmeldingservice.mapper; + +import lombok.experimental.UtilityClass; +import no.nav.testnav.endringsmeldingservice.utility.KjoennFraIdentUtility; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.GateadresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PostadresseDTO; +import no.nav.testnav.libs.dto.adresseservice.v1.VegadresseDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.FoedselsmeldingDTO; +import no.nav.testnav.libs.dto.generernavnservice.v1.NavnDTO; +import reactor.util.function.Tuple5; + +import java.util.List; +import java.util.Objects; + +import static java.util.Objects.isNull; +import static java.util.Objects.nonNull; +import static no.nav.testnav.endringsmeldingservice.mapper.AdressehistorikkMapper.mapBoadresse; +import static no.nav.testnav.endringsmeldingservice.mapper.AdressehistorikkMapper.mapPostBoadresse; +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +@UtilityClass +public class FoedselsmeldingRequestMapper { + + public static FoedselsmeldingRequest map(FoedselsmeldingDTO foedselsmelding, Tuple5, List, List, + List, List> opplysninger) { + + return FoedselsmeldingRequest.builder() + .barn(PersonDTO.builder() + .ident(opplysninger.getT1().getFirst()) + .identtype(foedselsmelding.getIdenttype().name()) + .fornavn(opplysninger.getT2().getFirst().getAdjektiv()) + .mellomnavn(opplysninger.getT2().getFirst().getAdverb()) + .etternavn(opplysninger.getT2().getFirst().getSubstantiv()) + .boadresse(mapAdresse(foedselsmelding, opplysninger.getT3(), opplysninger.getT4(), opplysninger.getT5())) + .postadresse(mapPostadresse(foedselsmelding, opplysninger.getT3(), opplysninger.getT4(), opplysninger.getT5())) + .kjonn(KjoennFraIdentUtility.get(opplysninger.getT1().getFirst())) + .build()) + .mor(PersonDTO.builder() + .ident(foedselsmelding.getIdentMor()) + .build()) + .far(isNotBlank(foedselsmelding.getIdentFar()) ? + PersonDTO.builder() + .ident(foedselsmelding.getIdentFar()) + .build() : null) + .build(); + } + + private static PostadresseDTO mapPostadresse(FoedselsmeldingDTO foedselsmelding, List vegadresse, + List morsadresser, List farsadresser) { + + if (isNull(foedselsmelding.getAdresseFra())) { + return mapPostadresse(vegadresse.getFirst()); + } + + return switch (foedselsmelding.getAdresseFra()) { + + case LAG_NY_ADRESSE -> mapPostadresse(vegadresse.getFirst()); + case ARV_FRA_MORS -> mapPostBoadresse(morsadresser.getFirst().getPersondata()); + case ARV_FRA_FARS -> nonNull(farsadresser) && !farsadresser.isEmpty() && + nonNull(farsadresser.getFirst().getPersondata()) ? + mapPostBoadresse(farsadresser.getFirst().getPersondata()) : + mapPostadresse(vegadresse.getFirst()); + }; + } + + private static AdresseDTO mapAdresse(FoedselsmeldingDTO foedselsmelding, List vegadresse, + List morsadresser, List farsadresser) { + + if (isNull(foedselsmelding.getAdresseFra())) { + return mapAdresse(vegadresse.getFirst()); + } + + return switch (foedselsmelding.getAdresseFra()) { + + case LAG_NY_ADRESSE -> mapAdresse(vegadresse.getFirst()); + case ARV_FRA_MORS -> mapBoadresse(morsadresser.getFirst().getPersondata()); + case ARV_FRA_FARS -> nonNull(farsadresser) && !farsadresser.isEmpty() && + nonNull(farsadresser.getFirst().getPersondata()) ? + mapBoadresse(farsadresser.getFirst().getPersondata()) : + mapAdresse(vegadresse.getFirst()); + }; + } + + private static AdresseDTO mapAdresse(VegadresseDTO vegadresse) { + + return GateadresseDTO.builder() + .adresse(vegadresse.getAdressenavn()) + .gatekode(vegadresse.getAdressekode()) + .husnummer(vegadresse.getHusnummer().toString()) + .husbokstav(vegadresse.getHusbokstav()) + .postnr(vegadresse.getPostnummer()) + .poststed(vegadresse.getPoststed()) + .kommunenr(vegadresse.getKommunenummer()) + .kommuneNavn(vegadresse.getKommunenavn()) + .tilleggsadresse(vegadresse.getTilleggsnavn()) + .build(); + } + + private static PostadresseDTO mapPostadresse(VegadresseDTO vegadresse) { + + return PostadresseDTO.builder() + .postLinje1("%s %s%s".formatted(vegadresse.getAdressenavn(), vegadresse.getHusnummer().toString(), + Objects.toString(vegadresse.getHusbokstav(), ""))) + .postLinje2("%s %s".formatted(vegadresse.getPostnummer(), vegadresse.getPoststed())) + .postLand("NOR") + .build(); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/IdentpoolRequestMapper.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/IdentpoolRequestMapper.java new file mode 100644 index 00000000000..f5f049a7dbb --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/mapper/IdentpoolRequestMapper.java @@ -0,0 +1,44 @@ +package no.nav.testnav.endringsmeldingservice.mapper; + +import lombok.experimental.UtilityClass; +import no.nav.testnav.endringsmeldingservice.consumer.dto.HentIdenterRequest; +import no.nav.testnav.endringsmeldingservice.consumer.dto.HentIdenterRequest.Identtype; +import no.nav.testnav.libs.dto.endringsmelding.v2.FoedselsmeldingDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.Kjoenn; + +import java.security.SecureRandom; +import java.util.Random; + +import static java.util.Objects.isNull; +import static no.nav.testnav.endringsmeldingservice.consumer.dto.HentIdenterRequest.Kjoenn.KVINNE; +import static no.nav.testnav.endringsmeldingservice.consumer.dto.HentIdenterRequest.Kjoenn.MANN; + +@UtilityClass +public class IdentpoolRequestMapper { + + private static final Random random = new SecureRandom(); + + public HentIdenterRequest convert(FoedselsmeldingDTO fodselsmelding) { + + return HentIdenterRequest.builder() + .identtype(Identtype.valueOf(fodselsmelding.getIdenttype().name())) + .foedtFoer(fodselsmelding.getFoedselsdato()) + .foedtEtter(fodselsmelding.getFoedselsdato()) + .kjoenn(convertKjoenn(fodselsmelding.getKjoenn())) + .rekvirertAv("TEMS") // testnav-endringsmelding-service + .antall(1) + .build(); + } + private HentIdenterRequest.Kjoenn convertKjoenn(Kjoenn kjoenn) { + + if (isNull(kjoenn)) { + return random.nextBoolean() ? MANN : KVINNE; + } + + return switch (kjoenn) { + case GUTT -> MANN; + case JENTE -> KVINNE; + case UKJENT -> random.nextBoolean() ? MANN : KVINNE; + }; + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/service/DoedsmeldingService.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/service/DoedsmeldingService.java new file mode 100644 index 00000000000..85c1ec1ae02 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/service/DoedsmeldingService.java @@ -0,0 +1,165 @@ +package no.nav.testnav.endringsmeldingservice.service; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.endringsmeldingservice.consumer.TpsMessagingConsumer; +import no.nav.testnav.endringsmeldingservice.mapper.AdressehistorikkMapper; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.IdentMiljoeDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonMiljoeDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.DoedsmeldingDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.DoedsmeldingResponseDTO; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ResponseStatusException; +import reactor.core.publisher.Mono; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import static java.util.Objects.isNull; +import static no.nav.testnav.endringsmeldingservice.mapper.AdressehistorikkMapper.buildAdresseRequest; +import static org.apache.commons.lang3.StringUtils.isBlank; +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +@Service +@RequiredArgsConstructor +public class DoedsmeldingService { + + private final TpsMessagingConsumer tpsMessagingConsumer; + + public Mono sendDoedsmelding(DoedsmeldingDTO doedsmelding, Set miljoer) { + + if (isNotBlank(validate(doedsmelding))) { + + return Mono.just(DoedsmeldingResponseDTO.builder() + .error(validate(doedsmelding)) + .build()); + } + + return tpsMessagingConsumer.getEksistererPerson(Set.of(doedsmelding.getIdent()), miljoer) + .collectList() + .flatMap(resultater -> { + + if (resultater.stream() + .anyMatch(resultat -> resultat.getMiljoer().contains("p") || + !resultat.getMiljoer().containsAll(miljoer))) { + + return getDoedsmeldingResponseDTO(miljoer, resultater); + + } else { + + return tpsMessagingConsumer.getPersondata(doedsmelding.getIdent(), miljoer) + .filter(PersonMiljoeDTO::isOk) + .flatMap(persondata -> { + + if (persondata.getPerson().isDoed()) { + return tpsMessagingConsumer.getAdressehistorikk(buildAdresseRequest(persondata), + Set.of(persondata.getMiljoe())) + .filter(AdressehistorikkDTO::isOk) + .map(AdressehistorikkDTO::getPersondata) + .map(AdressehistorikkMapper::mapHistorikk) + .flatMap(person -> + tpsMessagingConsumer.sendKansellerDoedsmelding(person, Set.of(persondata.getMiljoe()))) + .flatMap(response -> tpsMessagingConsumer.sendDoedsmelding(DoedsmeldingRequest.builder() + .ident(doedsmelding.getIdent()) + .doedsdato(doedsmelding.getDoedsdato()) + .build(), Set.of(persondata.getMiljoe()))); + + } else { + return tpsMessagingConsumer.sendDoedsmelding(DoedsmeldingRequest.builder() + .ident(doedsmelding.getIdent()) + .doedsdato(doedsmelding.getDoedsdato()) + .build(), Set.of(persondata.getMiljoe())); + + } + }) + .map(DoedsmeldingResponse::getMiljoStatus) + .reduce((firstMap, secondMap) -> { + firstMap.putAll(secondMap); + return firstMap; + }) + .map(status -> DoedsmeldingResponseDTO.builder() + .ident(doedsmelding.getIdent()) + .miljoStatus(status) + .build()); + } + }); + } + + private static Mono getDoedsmeldingResponseDTO(Set miljoer, List resultater) { + + return resultater.stream() + .filter(resultat -> resultat.getMiljoer().contains("p") || + !resultat.getMiljoer().containsAll(miljoer)) + .map(resultat -> + Mono.just(DoedsmeldingResponseDTO.builder() + .ident(resultat.getIdent()) + .miljoStatus(resultat.getMiljoer().stream() + .sorted() + .collect(Collectors.toMap(miljoe -> miljoe, + miljoe -> "finnes i %smiljø".formatted("p".equals(miljoe) ? "produksjons" : "")))) + .error("FEIL: ident %s finnes ikke i alle forspurte miljøer/og eller i prod(p) %s".formatted( + resultat.getIdent(), miljoer)) + .build())) + .findFirst() + .orElseThrow(() -> new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Feilet å dekode identstatus")); + } + + public Mono sendKansellerDoedsmelding(String ident, Set miljoer) { + + if (isBlank(ident)) { + + return Mono.just(DoedsmeldingResponseDTO.builder() + .error("FEIL: ident mangler") + .build()); + } + + return tpsMessagingConsumer.getEksistererPerson(Set.of(ident), miljoer) + .collectList() + .flatMap(resultater -> { + + if (resultater.stream() + .anyMatch(resultat -> resultat.getMiljoer().contains("p") || + !resultat.getMiljoer().containsAll(miljoer))) { + + return getDoedsmeldingResponseDTO(miljoer, resultater); + + } else { + + return tpsMessagingConsumer.getPersondata(ident, miljoer) + .filter(PersonMiljoeDTO::isOk) + .filter(persondata -> persondata.getPerson().isDoed()) + .collectList() + .filter(persondata -> !persondata.isEmpty()) + .flatMap(persondata -> tpsMessagingConsumer.getAdressehistorikk(buildAdresseRequest(persondata.getFirst()), + persondata.stream().map(PersonMiljoeDTO::getMiljoe).collect(Collectors.toSet())) + .filter(AdressehistorikkDTO::isOk) + .map(AdressehistorikkDTO::getPersondata) + .map(AdressehistorikkMapper::mapHistorikk) + .collectList() + .flatMap(personer -> + tpsMessagingConsumer.sendKansellerDoedsmelding(personer.getFirst(), + persondata.stream().map(PersonMiljoeDTO::getMiljoe).collect(Collectors.toSet())))) + .map(response -> DoedsmeldingResponseDTO.builder() + .ident(ident) + .miljoStatus(response.getMiljoStatus()) + .build()); + } + }); + } + + private static String validate(DoedsmeldingDTO doedsmelding) { + + if (isBlank(doedsmelding.getIdent())) { + return "FEIL: ident mangler"; + + } else if (isNull(doedsmelding.getDoedsdato())) { + return "FEIL: dødsdato mangler"; + + } + return null; + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/service/FoedselsmeldingService.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/service/FoedselsmeldingService.java new file mode 100644 index 00000000000..4d937a0048c --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/service/FoedselsmeldingService.java @@ -0,0 +1,113 @@ +package no.nav.testnav.endringsmeldingservice.service; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.testnav.endringsmeldingservice.consumer.AdresseServiceConsumer; +import no.nav.testnav.endringsmeldingservice.consumer.GenererNavnServiceConsumer; +import no.nav.testnav.endringsmeldingservice.consumer.IdentPoolConsumer; +import no.nav.testnav.endringsmeldingservice.consumer.TpsMessagingConsumer; +import no.nav.testnav.endringsmeldingservice.mapper.FoedselsmeldingRequestMapper; +import no.nav.testnav.endringsmeldingservice.mapper.IdentpoolRequestMapper; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.FoedselsmeldingDTO; +import no.nav.testnav.libs.dto.endringsmelding.v2.FoedselsmeldingResponseDTO; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ResponseStatusException; +import reactor.core.publisher.Mono; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static java.util.Objects.isNull; +import static org.apache.commons.lang3.StringUtils.isBlank; +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +@Slf4j +@Service +@RequiredArgsConstructor +public class FoedselsmeldingService { + + private final IdentPoolConsumer identPoolConsumer; + private final GenererNavnServiceConsumer genererNavnServiceConsumer; + private final AdresseServiceConsumer adresseServiceConsumer; + private final TpsMessagingConsumer tpsMessagingConsumer; + + public Mono sendFoedselsmelding(FoedselsmeldingDTO request, Set miljoer) { + + if (isNotBlank(validate(request))) { + + return Mono.just(FoedselsmeldingResponseDTO.builder() + .error(validate(request)) + .build()); + } + + return tpsMessagingConsumer.getEksistererPerson(getForeldre(request), miljoer) + .collectList() + .flatMap(resultater -> { + + if (resultater.stream() + .anyMatch(resultat -> resultat.getMiljoer().contains("p") || + !resultat.getMiljoer().containsAll(miljoer))) { + + return resultater.stream() + .filter(resultat -> resultat.getMiljoer().contains("p") || + !resultat.getMiljoer().containsAll(miljoer)) + .map(resultat -> + Mono.just(FoedselsmeldingResponseDTO.builder() + .ident(resultat.getIdent()) + .miljoStatus(resultat.getMiljoer().stream() + .sorted() + .collect(Collectors.toMap(miljoe -> miljoe, + miljoe -> "finnes i %smiljø".formatted("p".equals(miljoe) ? "produksjons" : "")))) + .error("FEIL: ident %s finnes ikke i alle forspurte miljøer/og eller i prod(p) %s".formatted( + resultat.getIdent(), miljoer)) + .build())) + .findFirst() + .orElseThrow(() -> new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Feilet å dekode identstatus")); + + } else { + return Mono.zip(identPoolConsumer.acquireIdents( + IdentpoolRequestMapper.convert(request)), + genererNavnServiceConsumer.getNavn(), + adresseServiceConsumer.getVegadresse(), + tpsMessagingConsumer.getAdressehistorikk(request.getIdentMor(), request.getFoedselsdato(), miljoer).collectList(), + isBlank(request.getIdentFar()) ? Mono.just(Collections.emptyList()) : + tpsMessagingConsumer.getAdressehistorikk(request.getIdentFar(), request.getFoedselsdato(), miljoer).collectList()) + .flatMap(opplysninger -> Mono.just(FoedselsmeldingRequestMapper.map(request, opplysninger)) + .flatMap(foedselsmelding -> tpsMessagingConsumer.sendFoedselsmelding(foedselsmelding, + opplysninger.getT4().stream().map(AdressehistorikkDTO::getMiljoe).collect(Collectors.toSet())))) + .map(response -> FoedselsmeldingResponseDTO.builder() + .ident(response.getIdent()) + .miljoStatus(response.getMiljoStatus()) + .build()); + } + }); + } + + private static String validate(FoedselsmeldingDTO request) { + + if (isBlank(request.getIdentMor())) { + return "FEIL: mors ident mangler"; + + } else if (isNull(request.getFoedselsdato())) { + return "FEIL: fødselsdato mangler"; + + } else if (isNull(request.getIdenttype())) { + return "FEIL: identtype mangler"; + + } else return null; + } + + private static Set getForeldre(FoedselsmeldingDTO request) { + + return Stream.of(List.of(request.getIdentMor()), + isNotBlank(request.getIdentFar()) ? List.of(request.getIdentFar()) : Collections.emptyList()) + .flatMap(Collection::stream) + .collect(Collectors.toSet()); + } +} diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/utility/KjoennFraIdentUtility.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/utility/KjoennFraIdentUtility.java new file mode 100644 index 00000000000..7876fef778e --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/utility/KjoennFraIdentUtility.java @@ -0,0 +1,15 @@ +package no.nav.testnav.endringsmeldingservice.utility; + +import lombok.experimental.UtilityClass; + +import static java.lang.Integer.parseInt; + +@UtilityClass +public class KjoennFraIdentUtility { + + public String get(String ident){ + + int kjoennNummer = parseInt(ident.substring(8,9)); + return kjoennNummer % 2 == 0 ? "K" : "M"; + } +} \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/resources/application-dev.yml b/apps/endringsmelding-service/src/main/resources/application-dev.yml new file mode 100644 index 00000000000..749d6f813ed --- /dev/null +++ b/apps/endringsmelding-service/src/main/resources/application-dev.yml @@ -0,0 +1,10 @@ + +consumers: + adresse-service: + url: https://testnav-adresse-service.intern.dev.nav.no + generer-navn-service: + url: https://generer-navn-service.intern.dev.nav.no + ident-pool: + url: https://testnav-ident-pool.intern.dev.nav.no + tps-messaging-service: + url: https://testnav-tps-messaging-service.intern.dev.nav.no \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/resources/application-prod.yml b/apps/endringsmelding-service/src/main/resources/application-prod.yml new file mode 100644 index 00000000000..894f2d09e4e --- /dev/null +++ b/apps/endringsmelding-service/src/main/resources/application-prod.yml @@ -0,0 +1,9 @@ + +spring: + security: + oauth2: + resourceserver: + tokenx: + issuer-uri: ${TOKEN_X_ISSUER} + jwk-set-uri: ${TOKEN_X_JWKS_URI} + accepted-audience: ${TOKEN_X_CLIENT_ID} \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/resources/application.yml b/apps/endringsmelding-service/src/main/resources/application.yml index 40398f5dfe6..0bf48ac4a92 100644 --- a/apps/endringsmelding-service/src/main/resources/application.yml +++ b/apps/endringsmelding-service/src/main/resources/application.yml @@ -12,10 +12,6 @@ spring: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} - tokenx: - issuer-uri: ${TOKEN_X_ISSUER} - jwk-set-uri: ${TOKEN_X_JWKS_URI} - accepted-audience: ${TOKEN_X_CLIENT_ID} springdoc: swagger-ui: @@ -33,6 +29,21 @@ consumers: cluster: dev-gcp namespace: dolly name: testnav-tps-messaging-service + ident-pool: + url: http://testnav-ident-pool.dolly.svc.cluster.local + cluster: dev-gcp + namespace: dolly + name: testnav-ident-pool + adresse-service: + url: http://testnav-adresse-service.dolly.svc.cluster.local + cluster: dev-gcp + namespace: dolly + name: testnav-adresse-service + generer-navn-service: + url: http://generer-navn-service.dolly.svc.cluster.local + cluster: dev-gcp + namespace: dolly + name: generer-navn-service management: endpoints: @@ -55,4 +66,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/resources/logback-spring.xml b/apps/endringsmelding-service/src/main/resources/logback-spring.xml index 52c15597b3c..de8c7308e9c 100644 --- a/apps/endringsmelding-service/src/main/resources/logback-spring.xml +++ b/apps/endringsmelding-service/src/main/resources/logback-spring.xml @@ -35,6 +35,4 @@ - - \ No newline at end of file diff --git a/apps/ereg-batch-status-service/README.md b/apps/ereg-batch-status-service/README.md index b258606b430..030a76d60dc 100644 --- a/apps/ereg-batch-status-service/README.md +++ b/apps/ereg-batch-status-service/README.md @@ -2,7 +2,7 @@ App for å hente ut batch status. ## Swagger -Swagger finnes under [/swagger](https://ereg-batch-status-service.dev.intern.nav.no/swagger) -endepunktet til applikasjonen. +Swagger finnes under [/swagger](https://testnav-ereg-batch-status-service.intern.dev.nav.no/swagger) -endepunktet til applikasjonen. ## Lokal kjøring Ha naisdevice kjørende og kjør EregBatchServiceServiceApplicationStarter med følgende argumenter: diff --git a/apps/ereg-batch-status-service/build.gradle b/apps/ereg-batch-status-service/build.gradle index ac3f1fb375e..c5aa01d3aaa 100644 --- a/apps/ereg-batch-status-service/build.gradle +++ b/apps/ereg-batch-status-service/build.gradle @@ -44,21 +44,21 @@ dependencies { implementation 'no.nav.testnav.libs:data-transfer-objects' implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' + implementation 'no.nav.testnav.libs:reactive-security' + implementation 'no.nav.testnav.libs:security-core' implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.cloud:spring-cloud-starter-gateway' implementation 'org.springframework.cloud:spring-cloud-starter-vault-config' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'io.micrometer:micrometer-registry-prometheus' - implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0' + implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.3.0' implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20' implementation 'net.logstash.logback:logstash-logback-encoder:7.4' diff --git a/apps/ereg-batch-status-service/config.yml b/apps/ereg-batch-status-service/config.yml index 23f5416dc3e..5e1b25b8980 100644 --- a/apps/ereg-batch-status-service/config.yml +++ b/apps/ereg-batch-status-service/config.yml @@ -18,6 +18,9 @@ spec: cluster: dev-gcp - application: organisasjon-bestilling-service cluster: dev-gcp + outbound: + external: + - host: testnav-modapp-ereg-proxy.dev-fss-pub.nais.io tokenx: enabled: true azure: @@ -48,4 +51,4 @@ spec: limits: memory: 2048Mi ingresses: - - "https://ereg-batch-status-service.dev-fss-pub.nais.io" \ No newline at end of file + - "https://testnav-ereg-batch-status-service.intern.dev.nav.no" \ No newline at end of file diff --git a/apps/ereg-batch-status-service/settings.gradle b/apps/ereg-batch-status-service/settings.gradle index 5b9f453200b..8c37d66ba90 100644 --- a/apps/ereg-batch-status-service/settings.gradle +++ b/apps/ereg-batch-status-service/settings.gradle @@ -6,8 +6,8 @@ rootProject.name = 'ereg-batch-status-service' includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/reactive-core' -includeBuild '../../libs/servlet-core' -includeBuild '../../libs/servlet-security' +includeBuild '../../libs/reactive-security' +includeBuild '../../libs/security-core' gradleEnterprise { buildScan { diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/ApplicationConfig.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/ApplicationConfig.java index 67f13c87191..6e6b082290c 100644 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/ApplicationConfig.java +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/ApplicationConfig.java @@ -1,14 +1,17 @@ package no.nav.registre.testnorge.eregbatchstatusservice.config; +import no.nav.testnav.libs.reactivecore.config.CoreConfig; +import no.nav.testnav.libs.reactivesecurity.config.SecureOAuth2ServerToServerConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import org.springframework.web.reactive.config.EnableWebFlux; -import no.nav.testnav.libs.servletcore.config.ApplicationCoreConfig; -import no.nav.testnav.libs.servletsecurity.config.SecureOAuth2ServerToServerConfiguration; @Configuration +@EnableWebFlux @Import({ - ApplicationCoreConfig.class, + CoreConfig.class, + SecurityConfig.class, SecureOAuth2ServerToServerConfiguration.class }) public class ApplicationConfig { diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/Consumers.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/Consumers.java new file mode 100644 index 00000000000..a39eadfc259 --- /dev/null +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/Consumers.java @@ -0,0 +1,29 @@ +package no.nav.registre.testnorge.eregbatchstatusservice.config; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import no.nav.testnav.libs.securitycore.domain.ServerProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import static lombok.AccessLevel.PACKAGE; + +/** + * Samler alle placeholders for ulike {@code consumers.*}-konfigurasjon her, dvs. subklasser av {@code ServerProperties}. + *

+ * Husk at Spring Boot bruker relaxed binding + * mellom configuration properties og field names. + * + * @see ServerProperties + */ +@Configuration +@ConfigurationProperties(prefix = "consumers") +@NoArgsConstructor(access = PACKAGE) +@Getter +@Setter(PACKAGE) +public class Consumers { + + private ServerProperties modappEregProxy; + +} diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/EregProperties.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/EregProperties.java deleted file mode 100644 index 4b3c4647e47..00000000000 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/EregProperties.java +++ /dev/null @@ -1,16 +0,0 @@ -package no.nav.registre.testnorge.eregbatchstatusservice.config; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -import java.util.Map; - -@Getter -@Setter -@Configuration -@ConfigurationProperties(prefix = "ereg") -public class EregProperties { - private Map envHostMap; -} diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/OpenApiConfig.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/OpenApiConfig.java index 49734eadc21..d72806f2a12 100644 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/OpenApiConfig.java +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/OpenApiConfig.java @@ -7,17 +7,15 @@ import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; +import no.nav.testnav.libs.reactivecore.config.ApplicationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.http.HttpHeaders; import java.util.Arrays; -import no.nav.testnav.libs.servletcore.config.ApplicationProperties; - @Configuration -public class OpenApiConfig implements WebMvcConfigurer { +public class OpenApiConfig { @Bean public OpenAPI openApi(ApplicationProperties applicationProperties) { @@ -27,7 +25,7 @@ public OpenAPI openApi(ApplicationProperties applicationProperties) { .scheme("bearer") .bearerFormat("JWT") .in(SecurityScheme.In.HEADER) - .name("Authorization") + .name(HttpHeaders.AUTHORIZATION) )) .addSecurityItem( new SecurityRequirement().addList("bearer-jwt", Arrays.asList("read", "write"))) @@ -47,9 +45,4 @@ public OpenAPI openApi(ApplicationProperties applicationProperties) { ) ); } - - @Override - public void addViewControllers(ViewControllerRegistry registry) { - registry.addViewController("/swagger").setViewName("redirect:/swagger-ui.html"); - } } \ No newline at end of file diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java index 11037bdd77f..8edc18ab66e 100644 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java @@ -1,26 +1,30 @@ package no.nav.registre.testnorge.eregbatchstatusservice.config; +import lombok.RequiredArgsConstructor; +import no.nav.testnav.libs.reactivesecurity.manager.JwtReactiveAuthenticationManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.security.config.Customizer; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; -import org.springframework.security.config.http.SessionCreationPolicy; -import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.config.annotation.method.configuration.EnableReactiveMethodSecurity; +import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.web.server.SecurityWebFilterChain; -@EnableWebSecurity @Configuration +@EnableWebFluxSecurity +@EnableReactiveMethodSecurity +@RequiredArgsConstructor @Profile({ "prod", "dev" }) public class SecurityConfig { + private final JwtReactiveAuthenticationManager jwtReactiveAuthenticationManager; + @Bean - public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception { + public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity httpSecurity) { - httpSecurity.sessionManagement(sessionConfig -> sessionConfig.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) - .csrf(AbstractHttpConfigurer::disable) - .authorizeHttpRequests(authorizeConfig -> authorizeConfig.requestMatchers( + return httpSecurity + .csrf(ServerHttpSecurity.CsrfSpec::disable) + .authorizeExchange(authorizeConfig -> authorizeConfig.pathMatchers( "/internal/**", "/webjars/**", "/swagger-resources/**", @@ -29,10 +33,9 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/swagger", "/error", "/swagger-ui.html" - ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); - - return httpSecurity.build(); + ).permitAll().anyExchange().authenticated()) + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtSpec -> jwtSpec.authenticationManager(jwtReactiveAuthenticationManager))) + .build(); } } diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/EregConsumer.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/EregConsumer.java index 5a9164c9ca2..b5ed69cfced 100644 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/EregConsumer.java +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/EregConsumer.java @@ -1,38 +1,37 @@ package no.nav.registre.testnorge.eregbatchstatusservice.consumer; import lombok.extern.slf4j.Slf4j; -import no.nav.registre.testnorge.eregbatchstatusservice.config.EregProperties; +import no.nav.registre.testnorge.eregbatchstatusservice.config.Consumers; import no.nav.registre.testnorge.eregbatchstatusservice.consumer.command.GetBatchStatusCommand; +import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; +import no.nav.testnav.libs.securitycore.domain.ServerProperties; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.client.WebClient; - -import java.util.Map; -import java.util.stream.Collectors; +import reactor.core.publisher.Mono; @Slf4j @Component public class EregConsumer { - private final Map envWebClientMap; + private final ServerProperties serverProperties; + private final WebClient webClient; + private final TokenExchange tokenService; + - public EregConsumer(EregProperties eregProperties) { + public EregConsumer(TokenExchange tokenService, + Consumers consumers + ) { - this.envWebClientMap = eregProperties - .getEnvHostMap() - .entrySet() - .stream() - .collect(Collectors.toMap( - Map.Entry::getKey, - entry -> WebClient.builder() - .baseUrl(entry.getValue()) - .build() - )); + this.tokenService = tokenService; + this.serverProperties = consumers.getModappEregProxy(); + this.webClient = WebClient.builder() + .baseUrl(consumers.getModappEregProxy().getUrl()) + .build(); } - public Long getStatusKode(String miljo, Long id) { - if (!envWebClientMap.containsKey(miljo)) { - throw new RuntimeException("Stotter ikke miljo: " + miljo + " i EREG."); - } else { - return new GetBatchStatusCommand(envWebClientMap.get(miljo), id).call(); - } + public Mono getStatusKode(String miljo, Long id) { + return tokenService + .exchange(serverProperties) + .flatMap(accessToken -> + new GetBatchStatusCommand(webClient, miljo, id, accessToken.getTokenValue()).call()); } -} +} \ No newline at end of file diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/command/GetBatchStatusCommand.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/command/GetBatchStatusCommand.java index fbbf9ec1e25..cf5cc38f465 100644 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/command/GetBatchStatusCommand.java +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/consumer/command/GetBatchStatusCommand.java @@ -1,27 +1,45 @@ package no.nav.registre.testnorge.eregbatchstatusservice.consumer.command; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import no.nav.registre.testnorge.eregbatchstatusservice.util.WebClientFilter; +import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.server.ResponseStatusException; +import reactor.core.publisher.Mono; import reactor.util.retry.Retry; import java.time.Duration; import java.util.concurrent.Callable; +import static org.springframework.http.HttpHeaders.AUTHORIZATION; + @RequiredArgsConstructor -public class GetBatchStatusCommand implements Callable { +@Slf4j +public class GetBatchStatusCommand implements Callable> { private final WebClient webClient; + private final String miljoe; private final Long id; + private final String token; @Override - public Long call() { + public Mono call() { return webClient .get() - .uri(builder -> builder.path("/ereg/internal/batch/poll/{id}").build(id)) + .uri(builder -> builder.path("/{miljoe}/ereg/internal/batch/poll/{id}").build(miljoe, id)) + .header(AUTHORIZATION, "Bearer " + token) .retrieve() + .onStatus(HttpStatusCode::is4xxClientError, clientResponse -> { + if (clientResponse.statusCode().equals(HttpStatus.UNAUTHORIZED)) { + log.error("Unauthorized error occurred when calling modapp-ereg-proxy"); + return Mono.error(new ResponseStatusException(HttpStatus.NOT_FOUND, "Resource not found")); + } + log.error("Client error occurred when calling modapp-ereg-proxy"); + return Mono.error(new ResponseStatusException(clientResponse.statusCode(), "Client error occurred")); + }) .bodyToMono(Long.class) .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) - .filter(WebClientFilter::is5xxException)) - .block(); + .filter(WebClientFilter::is5xxException)); } } diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/filter/SwaggerWebFilter.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/filter/SwaggerWebFilter.java new file mode 100644 index 00000000000..6141d2e2409 --- /dev/null +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/filter/SwaggerWebFilter.java @@ -0,0 +1,23 @@ +package no.nav.registre.testnorge.eregbatchstatusservice.filter; + +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; +import org.springframework.web.server.WebFilter; +import org.springframework.web.server.WebFilterChain; +import reactor.core.publisher.Mono; + +@Component +public class SwaggerWebFilter implements WebFilter { + @Override + public Mono filter(ServerWebExchange exchange, WebFilterChain chain) { + if (exchange.getRequest().getURI().getPath().equals("/swagger")) { + return chain + .filter(exchange.mutate() + .request(exchange.getRequest() + .mutate().path("/swagger-ui.html").build()) + .build()); + } + + return chain.filter(exchange); + } +} \ No newline at end of file diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/provider/BatchStatusController.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/provider/BatchStatusController.java index f886c3ed961..4086e65f040 100644 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/provider/BatchStatusController.java +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/provider/BatchStatusController.java @@ -1,6 +1,7 @@ package no.nav.registre.testnorge.eregbatchstatusservice.provider; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import no.nav.registre.testnorge.eregbatchstatusservice.consumer.EregConsumer; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; @@ -9,7 +10,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.reactive.function.client.WebClientResponseException; +import reactor.core.publisher.Mono; +@Slf4j @RequiredArgsConstructor @RestController @RequestMapping("/api/v1/batch/items") @@ -17,11 +20,12 @@ public class BatchStatusController { private final EregConsumer eregConsumer; @GetMapping("/{id}") - public ResponseEntity getStatusKode(@RequestHeader("miljoe") String miljo, @PathVariable("id") Long id) { + public ResponseEntity> getStatusKode(@RequestHeader("miljoe") String miljo, @PathVariable("id") Long id) { try { var status = eregConsumer.getStatusKode(miljo, id); return ResponseEntity.ok(status); - } catch (WebClientResponseException.NotFound e) { + } catch (WebClientResponseException e) { + log.error(e.getMessage(), e); return ResponseEntity.notFound().build(); } } diff --git a/apps/ereg-batch-status-service/src/main/resources/application-dev.yml b/apps/ereg-batch-status-service/src/main/resources/application-dev.yml new file mode 100644 index 00000000000..f05debbd219 --- /dev/null +++ b/apps/ereg-batch-status-service/src/main/resources/application-dev.yml @@ -0,0 +1 @@ +TOKEN_X_ISSUER: dummy \ No newline at end of file diff --git a/apps/ereg-batch-status-service/src/main/resources/application.yml b/apps/ereg-batch-status-service/src/main/resources/application.yml index ede2e74d146..37422dfcf14 100644 --- a/apps/ereg-batch-status-service/src/main/resources/application.yml +++ b/apps/ereg-batch-status-service/src/main/resources/application.yml @@ -1,11 +1,14 @@ AAD_ISSUER_URI: https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535279d0b spring: + cloud: + vault: + enabled: false main: banner-mode: off application: name: ereg-batch-status-service - version: application.version.todo #TODO Finn ut hvordan denne kan settes fra gradle + version: application.version.todo description: Tjeneste for å hente ut batch status fra EREG. security: oauth2: @@ -15,7 +18,7 @@ spring: jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} tokenx: - issuer-uri: ${TOKEN_X_ISSUER} + issuer-uri: ${TOKEN_X_ISSUER} jwk-set-uri: ${TOKEN_X_JWKS_URI} accepted-audience: ${TOKEN_X_CLIENT_ID} @@ -24,13 +27,12 @@ springdoc: disable-swagger-default-url: true url: /v3/api-docs -ereg: - envHostMap: - q1: https://ereg-services-q1.dev.intern.nav.no - q2: https://ereg-services-q2.dev.intern.nav.no - q4: https://ereg-services-q4.dev.intern.nav.no - q5: https://ereg-services-q5.dev.intern.nav.no - t3: https://ereg-services-t3.dev.intern.nav.no +consumers: + modapp-ereg-proxy: + name: testnav-modapp-ereg-proxy + namespace: dolly + url: https://testnav-modapp-ereg-proxy.dev-fss-pub.nais.io + cluster: dev-fss management: endpoints: @@ -50,4 +52,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/ereg-batch-status-service/src/main/resources/bootstrap.yml b/apps/ereg-batch-status-service/src/main/resources/bootstrap.yml deleted file mode 100644 index 0451449ca23..00000000000 --- a/apps/ereg-batch-status-service/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,4 +0,0 @@ -spring: - cloud: - vault: - enabled: false \ No newline at end of file diff --git a/apps/faste-data-frontend/src/main/resources/application.yml b/apps/faste-data-frontend/src/main/resources/application.yml index 6dd51931bf9..154c8d31050 100644 --- a/apps/faste-data-frontend/src/main/resources/application.yml +++ b/apps/faste-data-frontend/src/main/resources/application.yml @@ -76,6 +76,8 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always logging: level: diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/resources/application.yml b/apps/generer-arbeidsforhold-populasjon-service/src/main/resources/application.yml index 085b24d0fab..cc75a1aabe5 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/src/main/resources/application.yml +++ b/apps/generer-arbeidsforhold-populasjon-service/src/main/resources/application.yml @@ -64,4 +64,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/generer-navn-service/config.yml b/apps/generer-navn-service/config.yml index 2e2ad5598d3..62df6e2fd25 100644 --- a/apps/generer-navn-service/config.yml +++ b/apps/generer-navn-service/config.yml @@ -39,6 +39,8 @@ spec: cluster: dev-gcp - application: testnav-budpro-service cluster: dev-gcp + - application: testnav-endringsmelding-service + cluster: dev-gcp tokenx: enabled: true azure: diff --git a/apps/generer-navn-service/src/main/resources/application.yml b/apps/generer-navn-service/src/main/resources/application.yml index fbf80725da1..b4332bd4614 100644 --- a/apps/generer-navn-service/src/main/resources/application.yml +++ b/apps/generer-navn-service/src/main/resources/application.yml @@ -45,4 +45,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/generer-organisasjon-populasjon-service/src/main/resources/application.yml b/apps/generer-organisasjon-populasjon-service/src/main/resources/application.yml index 1095396feec..49df1d9f339 100644 --- a/apps/generer-organisasjon-populasjon-service/src/main/resources/application.yml +++ b/apps/generer-organisasjon-populasjon-service/src/main/resources/application.yml @@ -54,4 +54,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/geografiske-kodeverk-service/src/main/resources/application.yml b/apps/geografiske-kodeverk-service/src/main/resources/application.yml index 90f1aec1670..0ddc0bcbe92 100644 --- a/apps/geografiske-kodeverk-service/src/main/resources/application.yml +++ b/apps/geografiske-kodeverk-service/src/main/resources/application.yml @@ -39,4 +39,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/inntektsmelding-generator-service/src/main/resources/application.yml b/apps/inntektsmelding-generator-service/src/main/resources/application.yml index 110264c0e1e..36e7e00f1e5 100644 --- a/apps/inntektsmelding-generator-service/src/main/resources/application.yml +++ b/apps/inntektsmelding-generator-service/src/main/resources/application.yml @@ -40,4 +40,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/jenkins-batch-status-service/src/main/resources/application.yml b/apps/jenkins-batch-status-service/src/main/resources/application.yml index 282bf9b0a24..e03bc81d3c9 100644 --- a/apps/jenkins-batch-status-service/src/main/resources/application.yml +++ b/apps/jenkins-batch-status-service/src/main/resources/application.yml @@ -54,4 +54,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/joark-dokument-service/src/main/resources/application.yml b/apps/joark-dokument-service/src/main/resources/application.yml index d9900d2f2c7..fbbb0b3349a 100644 --- a/apps/joark-dokument-service/src/main/resources/application.yml +++ b/apps/joark-dokument-service/src/main/resources/application.yml @@ -47,4 +47,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/miljoer-service/src/main/resources/application.yml b/apps/miljoer-service/src/main/resources/application.yml index 4beddf8972e..41871840501 100644 --- a/apps/miljoer-service/src/main/resources/application.yml +++ b/apps/miljoer-service/src/main/resources/application.yml @@ -47,4 +47,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/repository/OppsummeringsdokumentRepository.java b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/repository/OppsummeringsdokumentRepository.java index 9e22e797374..a744f3ab626 100644 --- a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/repository/OppsummeringsdokumentRepository.java +++ b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/repository/OppsummeringsdokumentRepository.java @@ -1,14 +1,9 @@ package no.nav.testnav.apps.oppsummeringsdokumentservice.repository; import no.nav.testnav.apps.oppsummeringsdokumentservice.repository.model.OppsummeringsdokumentModel; -import no.nav.testnav.libs.dto.oppsummeringsdokumentservice.v2.Populasjon; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; public interface OppsummeringsdokumentRepository extends ElasticsearchRepository { - void deleteAllByMiljoAndPopulasjon(String miljo, Populasjon populasjon); - - void deleteAllByMiljo(String miljo); - } diff --git a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/service/SearchQueryUtility.java b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/service/SearchQueryUtility.java index a596653e8bc..4331755b721 100644 --- a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/service/SearchQueryUtility.java +++ b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/service/SearchQueryUtility.java @@ -23,8 +23,8 @@ public static QueryBuilder prepareQuery(QueryRequest request) { matchString(query, "_id", request.getId()); matchString(query, "miljo", request.getMiljo()); + matchString(query, "opplysningspliktigOrganisajonsnummer", request.getOrgnummer()); matchString(query, "virksomheter.personer.ident", request.getIdent()); - matchString(query, "virksomheter.organisajonsnummer", request.getOrgnummer()); matchString(query, "virksomheter.personer.arbeidsforhold.typeArbeidsforhold", request.getTypeArbeidsforhold()); if (nonNull(request.getFom())) { diff --git a/apps/oppsummeringsdokument-service/src/main/resources/application.yml b/apps/oppsummeringsdokument-service/src/main/resources/application.yml index b3e24a33969..f24768dca66 100644 --- a/apps/oppsummeringsdokument-service/src/main/resources/application.yml +++ b/apps/oppsummeringsdokument-service/src/main/resources/application.yml @@ -47,3 +47,5 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always diff --git a/apps/organisasjon-bestilling-service/config.yml b/apps/organisasjon-bestilling-service/config.yml index aac16e21e70..085a993d852 100644 --- a/apps/organisasjon-bestilling-service/config.yml +++ b/apps/organisasjon-bestilling-service/config.yml @@ -33,8 +33,10 @@ spec: - application: testnav-organisasjon-mottak-service cluster: dev-gcp outbound: + rules: + - application: ereg-batch-status-service + cluster: dev-gcp external: - - host: ereg-batch-status-service.dev-fss-pub.nais.io - host: testnorge-batch-adeo-proxy.dev-fss-pub.nais.io gcp: sqlInstances: diff --git a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/command/GetEregBatchStatusCommand.java b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/command/GetEregBatchStatusCommand.java index 1efac7ce2b5..e480b8ab753 100644 --- a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/command/GetEregBatchStatusCommand.java +++ b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/consumer/command/GetEregBatchStatusCommand.java @@ -1,14 +1,18 @@ package no.nav.testnav.apps.organisasjonbestillingservice.consumer.command; import lombok.RequiredArgsConstructor; -import no.nav.testnav.libs.commands.utils.WebClientFilter; +import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.web.server.ResponseStatusException; import reactor.util.retry.Retry; import java.time.Duration; import java.util.concurrent.Callable; +@Slf4j @RequiredArgsConstructor public class GetEregBatchStatusCommand implements Callable { private final WebClient webClient; @@ -18,14 +22,19 @@ public class GetEregBatchStatusCommand implements Callable { @Override public Long call() { - return webClient.get() - .uri(uriBuilder -> uriBuilder.path("/api/v1/batch/items/{id}").build(batchId)) - .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) - .header("miljoe", miljo) - .retrieve() - .bodyToMono(Long.class) - .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) - .filter(WebClientFilter::is5xxException)) - .block(); + try { + return webClient.get() + .uri(uriBuilder -> uriBuilder.path("/api/v1/batch/items/{id}").build(batchId)) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) + .header("miljoe", miljo) + .retrieve() + .bodyToMono(Long.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(throwable -> throwable instanceof WebClientResponseException.GatewayTimeout)) + .block(); + } catch (Exception e) { + log.error("Failed to get status for batch with id: " + batchId, e); + throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Resource not found", e); + } } } \ No newline at end of file diff --git a/apps/organisasjon-bestilling-service/src/main/resources/application.yml b/apps/organisasjon-bestilling-service/src/main/resources/application.yml index 3d3df5fd455..65128d8b646 100644 --- a/apps/organisasjon-bestilling-service/src/main/resources/application.yml +++ b/apps/organisasjon-bestilling-service/src/main/resources/application.yml @@ -16,7 +16,7 @@ spring: jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} tokenx: - issuer-uri: ${TOKEN_X_ISSUER} + issuer-uri: ${TOKEN_X_ISSUER} jwk-set-uri: ${TOKEN_X_JWKS_URI} accepted-audience: ${TOKEN_X_CLIENT_ID} @@ -27,8 +27,8 @@ springdoc: consumers: ereg-batch-status-service: - url: https://ereg-batch-status-service.dev-fss-pub.nais.io - cluster: dev-fss + url: http://ereg-batch-status-service.dolly.svc.cluster.local + cluster: dev-gcp namespace: dolly name: ereg-batch-status-service jenkins: @@ -55,4 +55,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/organisasjon-faste-data-service/src/main/resources/application.yml b/apps/organisasjon-faste-data-service/src/main/resources/application.yml index 8a26cd2b93a..ffe179b761c 100644 --- a/apps/organisasjon-faste-data-service/src/main/resources/application.yml +++ b/apps/organisasjon-faste-data-service/src/main/resources/application.yml @@ -54,4 +54,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/organisasjon-forvalter/src/main/resources/application.yml b/apps/organisasjon-forvalter/src/main/resources/application.yml index 281ffe2add2..9cc4dd6812d 100644 --- a/apps/organisasjon-forvalter/src/main/resources/application.yml +++ b/apps/organisasjon-forvalter/src/main/resources/application.yml @@ -76,4 +76,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/domain/Record.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/domain/Record.java index 0d1f11a0c4e..cecc9238ecc 100644 --- a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/domain/Record.java +++ b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/domain/Record.java @@ -4,21 +4,36 @@ import java.util.Date; import java.util.List; +import static java.util.Objects.nonNull; + public class Record { private final StringBuilder builder = new StringBuilder(); private int record = 0; - public static Record create(List lines, String orgnummer, String enhetstype, boolean update) { + public void append(String value) { + record++; + builder.append(value); + } + + public int getRecord() { + return record; + } + + public String build() { + return builder.toString(); + } + + public static Record create(List lines, String orgnummer, String enhetstype, Date regDato, boolean update) { Record record = new Record(); - record.append(createEHN(update, orgnummer, enhetstype)); + record.append(createEHN(update, orgnummer, enhetstype, regDato)); lines.forEach(line -> record.append(line.getValue())); return record; } - private static String createEHN(boolean update, String orgnummer, String enhetstype) { + private static String createEHN(boolean update, String orgnummer, String enhetstype, Date regDato) { StringBuilder stringBuilder = createStringBuilderWithReplacement(49, ' '); - String dateNowFormatted = getDateNowFormatted(); + String dateNowFormatted = getDateNowFormatted(regDato); String undersakstype = update ? "EN" : "NY"; stringBuilder.replace(0, "ENH".length(), "ENH") @@ -41,21 +56,8 @@ private static StringBuilder createStringBuilderWithReplacement(int size, char r return stringBuilder; } - private static String getDateNowFormatted() { + private static String getDateNowFormatted(Date regDato) { SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); - return format.format(new Date()); - } - - public void append(String value) { - record++; - builder.append(value); - } - - public int getRecord() { - return record; - } - - public String build() { - return builder.toString(); + return format.format(nonNull(regDato) ? regDato : new Date()); } } diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/listener/OrganisasjonMottakListener.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/listener/OrganisasjonMottakListener.java index 92ac3f4e787..a20a58ca856 100644 --- a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/listener/OrganisasjonMottakListener.java +++ b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/listener/OrganisasjonMottakListener.java @@ -29,13 +29,18 @@ import org.springframework.kafka.annotation.KafkaListener; import org.springframework.stereotype.Component; +import java.time.LocalDate; +import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Collection; +import java.util.Date; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; +import static java.util.Objects.nonNull; + @Slf4j @Profile("prod") @Component @@ -95,11 +100,20 @@ private void createRecords(List records, Organisasjon organisasjon, Orga Optional.ofNullable(organisasjon.getFormaal()).ifPresent(value -> list.add(new Formaal(value))); Optional.ofNullable(parent).ifPresent(value -> list.add(new Knytning(value, organisasjon))); + var stiftelsesDato = (nonNull(organisasjon.getStiftelsesdato()) && nonNull(organisasjon.getStiftelsesdato().getDato()) ? organisasjon.getStiftelsesdato().getDato() : null); + var regDato = (nonNull(organisasjon.getStiftelsesdato()) + //Registreringsdato settes til dagen etter stiftelsesdato hvis den er satt + ? Date.from(LocalDate.of(stiftelsesDato.getAar(), stiftelsesDato.getMaaned(), stiftelsesDato.getDag()) + .plusDays(1).atStartOfDay() + .toInstant(ZoneOffset.UTC)) + : null); + var record = Record.create( list.stream().map(ToLine::toLine) .toList(), organisasjon.getOrgnummer(), organisasjon.getEnhetstype(), + regDato, update ); diff --git a/apps/organisasjon-mottak-service/src/main/resources/application.yml b/apps/organisasjon-mottak-service/src/main/resources/application.yml index 12b7a1c3f77..15761dcdecc 100644 --- a/apps/organisasjon-mottak-service/src/main/resources/application.yml +++ b/apps/organisasjon-mottak-service/src/main/resources/application.yml @@ -64,4 +64,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/organisasjon-mottak-service/src/test/java/no/nav/registre/testnorge/organisasjonmottak/domain/RecordTest.java b/apps/organisasjon-mottak-service/src/test/java/no/nav/registre/testnorge/organisasjonmottak/domain/RecordTest.java new file mode 100644 index 00000000000..2db6ce7748c --- /dev/null +++ b/apps/organisasjon-mottak-service/src/test/java/no/nav/registre/testnorge/organisasjonmottak/domain/RecordTest.java @@ -0,0 +1,42 @@ +package no.nav.registre.testnorge.organisasjonmottak.domain; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.MockitoAnnotations; + +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.util.Collections; +import java.util.Date; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; + +class RecordTest { + + @InjectMocks + Record record; + + @BeforeEach + void setUp() { + MockitoAnnotations.openMocks(this); + } + + @Test + void testCreate() { + // Create mock objects + var line = mock(Line.class); + var orgnummer = "123456789"; + var enhetstype = "AS"; + var regDato = Date.from(LocalDate.of(2022, 1, 1).atStartOfDay().toInstant(ZoneOffset.UTC)); + var update = false; + + // Call method under test + var result = Record.create(Collections.singletonList(line), orgnummer, enhetstype, regDato, update); + + // Verify that the StringBuilder contains the correct date + var expectedDate = "20220101"; + assertTrue(result.build().contains(expectedDate)); + } +} \ No newline at end of file diff --git a/apps/organisasjon-service/src/main/resources/application.yml b/apps/organisasjon-service/src/main/resources/application.yml index 0b30288e953..acb2f690e9c 100644 --- a/apps/organisasjon-service/src/main/resources/application.yml +++ b/apps/organisasjon-service/src/main/resources/application.yml @@ -50,4 +50,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/organisasjon-tilgang-frontend/src/main/resources/application.yml b/apps/organisasjon-tilgang-frontend/src/main/resources/application.yml index 4e89713750f..7802aaaadfa 100644 --- a/apps/organisasjon-tilgang-frontend/src/main/resources/application.yml +++ b/apps/organisasjon-tilgang-frontend/src/main/resources/application.yml @@ -50,4 +50,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/organisasjon-tilgang-service/src/main/resources/application.yml b/apps/organisasjon-tilgang-service/src/main/resources/application.yml index c8e30c1fe89..b1a79edb18b 100644 --- a/apps/organisasjon-tilgang-service/src/main/resources/application.yml +++ b/apps/organisasjon-tilgang-service/src/main/resources/application.yml @@ -54,4 +54,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/orgnummer-service/src/main/resources/application.yml b/apps/orgnummer-service/src/main/resources/application.yml index f46b42ceace..58c3ed56ef1 100644 --- a/apps/orgnummer-service/src/main/resources/application.yml +++ b/apps/orgnummer-service/src/main/resources/application.yml @@ -59,4 +59,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/oversikt-frontend/src/main/resources/application.yml b/apps/oversikt-frontend/src/main/resources/application.yml index f65bec9fdf9..7b9ccda5e73 100644 --- a/apps/oversikt-frontend/src/main/resources/application.yml +++ b/apps/oversikt-frontend/src/main/resources/application.yml @@ -55,6 +55,8 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always logging: level: diff --git a/apps/pdl-forvalter/src/main/resources/application.yaml b/apps/pdl-forvalter/src/main/resources/application.yaml index be3bb4cf4bb..b38645ecc26 100644 --- a/apps/pdl-forvalter/src/main/resources/application.yaml +++ b/apps/pdl-forvalter/src/main/resources/application.yaml @@ -70,4 +70,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/person-faste-data-service/src/main/resources/application.yml b/apps/person-faste-data-service/src/main/resources/application.yml index 2515f413b99..85ac1aca946 100644 --- a/apps/person-faste-data-service/src/main/resources/application.yml +++ b/apps/person-faste-data-service/src/main/resources/application.yml @@ -45,4 +45,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/person-organisasjon-tilgang-service/src/main/resources/application.yml b/apps/person-organisasjon-tilgang-service/src/main/resources/application.yml index 749173ef3ec..f52d93eb62a 100644 --- a/apps/person-organisasjon-tilgang-service/src/main/resources/application.yml +++ b/apps/person-organisasjon-tilgang-service/src/main/resources/application.yml @@ -49,4 +49,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/person-search-service/src/main/resources/application.yml b/apps/person-search-service/src/main/resources/application.yml index c98ec2ef19c..970fa1f9642 100644 --- a/apps/person-search-service/src/main/resources/application.yml +++ b/apps/person-search-service/src/main/resources/application.yml @@ -57,4 +57,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/person-service/src/main/resources/application.yml b/apps/person-service/src/main/resources/application.yml index 484075fff2e..a60afe1552d 100644 --- a/apps/person-service/src/main/resources/application.yml +++ b/apps/person-service/src/main/resources/application.yml @@ -59,4 +59,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/profil-api/src/main/resources/application.yml b/apps/profil-api/src/main/resources/application.yml index 9290a3c1203..9a6bdad86fc 100644 --- a/apps/profil-api/src/main/resources/application.yml +++ b/apps/profil-api/src/main/resources/application.yml @@ -54,4 +54,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/sykemelding-api/src/main/resources/application.yml b/apps/sykemelding-api/src/main/resources/application.yml index d6dfd75a4f4..341ca3b64f1 100644 --- a/apps/sykemelding-api/src/main/resources/application.yml +++ b/apps/sykemelding-api/src/main/resources/application.yml @@ -48,6 +48,8 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always ibm: mq: queueManager: ${IBM_MQ_QUEUE_MANAGER} diff --git a/apps/synt-sykemelding-api/src/main/resources/application.yml b/apps/synt-sykemelding-api/src/main/resources/application.yml index f080bf7ac5f..11992aca432 100644 --- a/apps/synt-sykemelding-api/src/main/resources/application.yml +++ b/apps/synt-sykemelding-api/src/main/resources/application.yml @@ -75,4 +75,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/synt-vedtakshistorikk-service/src/main/resources/application.yml b/apps/synt-vedtakshistorikk-service/src/main/resources/application.yml index 7ae839c58cf..9d5ade6dbbd 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/resources/application.yml +++ b/apps/synt-vedtakshistorikk-service/src/main/resources/application.yml @@ -16,7 +16,6 @@ spring: vault: enabled: false - springdoc: swagger-ui: disable-swagger-default-url: true @@ -83,3 +82,5 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/domain/TenorRequest.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/domain/TenorRequest.java index 0415704b80a..2a2e1b4a399 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/domain/TenorRequest.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/domain/TenorRequest.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.math.BigInteger; import java.time.LocalDate; import java.time.YearMonth; import java.util.ArrayList; @@ -139,8 +140,8 @@ public static class DatoIntervall { @NoArgsConstructor public static class Intervall { - private Integer fraOgMed; - private Integer tilOgMed; + private BigInteger fraOgMed; + private BigInteger tilOgMed; } @Data @@ -159,7 +160,7 @@ public static class Adresser { @Schema(description = "Adressesøk, fritekst") private AdresseGradering adresseGradering; - private Integer kommunenummer; + private BigInteger kommunenummer; private Boolean harBostedsadresse; private Boolean harOppholdAnnetSted; private Boolean harPostadresseNorge; @@ -207,7 +208,7 @@ public static class Tjenestepensjonsavtale { public static class Skattemelding { @Schema(description = "Inntektsår, 4 siffre, årene 2018, 2019, 2020, 2021, 2022 ... osv opptil i forfjor") - private Integer inntektsaar; + private BigInteger inntektsaar; private Skattemeldingstype skattemeldingstype; } @@ -216,7 +217,7 @@ public static class Skattemelding { public static class Inntekt { private MonthInterval periode; - private Integer opplysningspliktig; + private BigInteger opplysningspliktig; private List inntektstyper; private AOrdningBeskrivelse beskrivelse; private List forskuddstrekk; @@ -254,7 +255,7 @@ public static class MonthInterval { public static class Skatteplikt { @Schema(description = "Inntektsår, 4 siffre, årene 2019, 2019, 2020, 2021, 2022, 2023 ... osv opptil i fjor") - private Integer inntektsaar; + private BigInteger inntektsaar; private List skattepliktstyper; private SaerskiltSkatteplikt saerskiltSkatteplikt; @@ -271,7 +272,7 @@ public List getSkattepliktstyper() { @NoArgsConstructor public static class Tilleggsskatt { - private Integer inntektsaar; + private BigInteger inntektsaar; private List tilleggsskattTyper; public List getTilleggsskattTyper() { @@ -303,7 +304,7 @@ public static class Arbeidsforhold { public static class BeregnetSkatt { @Schema(description = "Inntektsår, 4 siffre, årene 2018, 2019, 2020, 2021, 2022, 2023 ... osv opptil i fjor") - private Integer inntektsaar; + private BigInteger inntektsaar; private Oppgjoerstype oppgjoerstype; private Boolean pensjonsgivendeInntekt; } @@ -314,7 +315,7 @@ public static class BeregnetSkatt { public static class TestinnsendingSkattPerson { @Schema(description = "Inntektsår, 4 siffre, årene 2020, 2021, 2022, 2023 ... osv opptil i fjor") - private Integer inntektsaar; + private BigInteger inntektsaar; @Schema(description = "Skattemelding utkast, merk at false indikerer har ikke skatteMeldingUtkast") private Boolean harSkattemeldingUtkast; @Schema(description = "Skattemelding fastsatt, merk at false indikerer har ikke skatteMeldingFastsatt") @@ -334,7 +335,7 @@ public static class SamletReskontroInnsyn { public static class SummertSkattegrunnlag { @Schema(description = "Inntektsår, 4 siffre, årene 2019, 2020, 2021, 2022, 2023 ... osv opptil i fjor") - private Integer inntektsaar; + private BigInteger inntektsaar; private Stadietype stadietype; private Oppgjoerstype oppgjoerstype; private TekniskNavn tekniskNavn; @@ -346,7 +347,7 @@ public static class SummertSkattegrunnlag { public static class SpesisfisertSummertSkattegrunnlag { @Schema(description = "Inntektsår, 4 siffre, årene 2019, 2020, 2021, 2022, 2023 ... osv opptil i fjor") - private Integer inntektsaar; + private BigInteger inntektsaar; private Stadietype stadietype; private Oppgjoerstype oppgjoerstype; private TekniskNavn tekniskNavn; diff --git a/apps/tenor-search-service/src/main/resources/application.yml b/apps/tenor-search-service/src/main/resources/application.yml index ae8b30ef805..5a061bada64 100644 --- a/apps/tenor-search-service/src/main/resources/application.yml +++ b/apps/tenor-search-service/src/main/resources/application.yml @@ -50,6 +50,8 @@ server: force: true force-request: true force-response: true + error: + include-message: always consumers: tenor-search-service: diff --git a/apps/testnav-ident-pool/config.yml b/apps/testnav-ident-pool/config.yml index 64c3d600750..db7359ec9db 100644 --- a/apps/testnav-ident-pool/config.yml +++ b/apps/testnav-ident-pool/config.yml @@ -61,6 +61,8 @@ spec: - application: app-1 namespace: plattformsikkerhet cluster: dev-gcp + - application: testnav-endringsmelding-service + cluster: dev-gcp outbound: rules: - application: testnav-tps-messaging-service diff --git a/apps/testnav-ident-pool/src/main/resources/application.yaml b/apps/testnav-ident-pool/src/main/resources/application.yaml index baa41b6593b..f411431ba17 100644 --- a/apps/testnav-ident-pool/src/main/resources/application.yaml +++ b/apps/testnav-ident-pool/src/main/resources/application.yaml @@ -61,4 +61,11 @@ consumers: url: http://testnav-tps-messaging-service.dolly.svc.cluster.local cluster: dev-gcp namespace: dolly - name: testnav-tps-messaging-service \ No newline at end of file + name: testnav-tps-messaging-service + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always diff --git a/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml b/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml index 9c5ba4c9407..f38c4d4cc98 100644 --- a/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml +++ b/apps/testnorge-statisk-data-forvalter/src/main/resources/application.yml @@ -97,3 +97,5 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always diff --git a/apps/tilbakemelding-api/src/main/resources/application.yml b/apps/tilbakemelding-api/src/main/resources/application.yml index f6eaecb9bc1..5a9f356e5bd 100644 --- a/apps/tilbakemelding-api/src/main/resources/application.yml +++ b/apps/tilbakemelding-api/src/main/resources/application.yml @@ -51,4 +51,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/tps-messaging-service/build.gradle b/apps/tps-messaging-service/build.gradle index 5486d73e8e8..88d48546719 100644 --- a/apps/tps-messaging-service/build.gradle +++ b/apps/tps-messaging-service/build.gradle @@ -81,7 +81,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' - implementation 'com.fasterxml.jackson.core:jackson-annotations' implementation 'com.fasterxml.jackson.core:jackson-databind' implementation 'com.ibm.mq:mq-jms-spring-boot-starter:3.2.1' @@ -96,6 +95,7 @@ dependencies { implementation 'no.nav.repository.fellesreg.tpsws:nav-repository-fellesregister-jaxb-tps-s610-domain:2020.08.27-09.53-183ead3d81eb' implementation 'no.nav.repository.fellesreg.tpsws:nav-repository-fellesregister-jaxb-tps-m201-domain:2020.08.27-09.53-183ead3d81eb' + implementation 'no.nav.repository.fellesreg.tpsws:nav-repository-fellesregister-castor-tps-s018-domain:2020.08.27-09.53-183ead3d81eb' implementation 'io.micrometer:micrometer-registry-prometheus' implementation 'ma.glasnost.orika:orika-core:1.5.4' diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/MapperFacadeConfig.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/MapperFacadeConfig.java index 224fc7b82c2..12fdadf32c2 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/MapperFacadeConfig.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/MapperFacadeConfig.java @@ -1,10 +1,9 @@ package no.nav.testnav.apps.tpsmessagingservice.config; -import lombok.RequiredArgsConstructor; +import ma.glasnost.orika.CustomConverter; import ma.glasnost.orika.MapperFacade; import ma.glasnost.orika.impl.DefaultMapperFactory; import no.nav.testnav.apps.tpsmessagingservice.mapper.MappingStrategy; - import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -13,19 +12,24 @@ import static java.util.Objects.nonNull; @Configuration -@RequiredArgsConstructor public class MapperFacadeConfig { - private final List mappingStrategies; - @Bean - MapperFacade mapperFacade() { + MapperFacade mapperFacade(List mappingStrategies, List customConverters) { DefaultMapperFactory mapperFactory = new DefaultMapperFactory.Builder().build(); if (nonNull(mappingStrategies)) { - mappingStrategies.forEach(mapper -> mapper.register(mapperFactory)); + for (MappingStrategy mapper : mappingStrategies) { + mapper.register(mapperFactory); + } + } + + if (nonNull(customConverters)) { + for (CustomConverter converter : customConverters) { + mapperFactory.getConverterFactory().registerConverter(converter); + } } return mapperFactory.getMapperFacade(); } -} +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java index c4b6fa2bea8..2337605971b 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TestmiljoerServiceConsumer.java @@ -8,13 +8,14 @@ import org.springframework.stereotype.Service; import org.springframework.web.reactive.function.client.WebClient; -import java.util.Arrays; import java.util.List; +import java.util.stream.Stream; @Slf4j @Service public class TestmiljoerServiceConsumer { + private final static List EXTRA_ENV = List.of("q5"); private final WebClient webClient; private final ServerProperties serverProperties; private final TokenExchange tokenExchange; @@ -33,8 +34,10 @@ public TestmiljoerServiceConsumer( public List getMiljoer() { - return Arrays.asList(tokenExchange.exchange(serverProperties) + return tokenExchange.exchange(serverProperties) .flatMap(token -> new TestmiljoerServiceCommand(webClient, token.getTokenValue()).call()) - .block()); + .map(miljoer -> Stream.concat(miljoer.stream(), EXTRA_ENV.stream()) + .toList()) + .block(); } } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java index c72482156b9..0b46187871f 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java @@ -1,5 +1,6 @@ package no.nav.testnav.apps.tpsmessagingservice.consumer; +import jakarta.xml.bind.JAXBException; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -11,7 +12,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import jakarta.xml.bind.JAXBException; import java.util.List; import java.util.Map; import java.util.Objects; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TestmiljoerServiceCommand.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TestmiljoerServiceCommand.java index 54c28f0d3bc..109be41e979 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TestmiljoerServiceCommand.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TestmiljoerServiceCommand.java @@ -8,10 +8,12 @@ import reactor.util.retry.Retry; import java.time.Duration; +import java.util.Arrays; +import java.util.List; import java.util.concurrent.Callable; @RequiredArgsConstructor -public class TestmiljoerServiceCommand implements Callable> { +public class TestmiljoerServiceCommand implements Callable>> { private static final String MILJOER_URL = "/api/v1/miljoer"; @@ -19,13 +21,14 @@ public class TestmiljoerServiceCommand implements Callable> { private final String token; @Override - public Mono call() { + public Mono> call() { return webClient.get() .uri(builder -> builder.path(MILJOER_URL).build()) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .retrieve() .bodyToMono(String[].class) + .map(Arrays::asList) .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) .filter(WebClientFilter::is5xxException)) .cache(Duration.ofSeconds(10)); diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java index 4a3544ce01c..9a48e690386 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java @@ -1,7 +1,6 @@ package no.nav.testnav.apps.tpsmessagingservice.consumer.command; import com.ibm.mq.jakarta.jms.MQQueue; -import com.ibm.mq.jmqi.JmqiException; import com.ibm.msg.client.jakarta.wmq.compat.jms.internal.JMSC; import jakarta.jms.Connection; import jakarta.jms.ConnectionFactory; @@ -33,7 +32,7 @@ public class TpsMeldingCommand implements Callable { private final String password; private final String requestMessageContent; - public String call() throws JMSException, JmqiException { + public String call() throws JMSException { try (Connection connection = connectionFactory.createConnection(username, password)) { connection.start(); diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsRequest.java new file mode 100644 index 00000000000..cedc3a6ee61 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsRequest.java @@ -0,0 +1,4 @@ +package no.nav.testnav.apps.tpsmessagingservice.dto; + +public interface TpsRequest { +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServiceRutine.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServiceRutine.java deleted file mode 100644 index c6901b839c5..00000000000 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServiceRutine.java +++ /dev/null @@ -1,21 +0,0 @@ -package no.nav.testnav.apps.tpsmessagingservice.dto; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import jakarta.xml.bind.annotation.XmlType; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@XmlType(propOrder = {"serviceRutinenavn", "fnr", "aksjonsKode", "aksjonsKode2"}) -public class TpsServiceRutine { - - private String serviceRutinenavn; - private String fnr; - private String aksjonsKode; - private String aksjonsKode2; -} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineAksjonsdatoRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineAksjonsdatoRequest.java new file mode 100644 index 00000000000..834df522540 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineAksjonsdatoRequest.java @@ -0,0 +1,35 @@ +package no.nav.testnav.apps.tpsmessagingservice.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@XmlRootElement(name = "tpsPersonData") +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class TpsServicerutineAksjonsdatoRequest implements TpsRequest { + + private TpsServiceRutineMedAksjonsdato tpsServiceRutine; + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @XmlType(propOrder = {"serviceRutinenavn", "fnr", "aksjonsDato", "aksjonsKode", "aksjonsKode2", "buffNr"}) + public static class TpsServiceRutineMedAksjonsdato { + + private String serviceRutinenavn; + private String fnr; + private String aksjonsDato; + private String aksjonsKode; + private String aksjonsKode2; + private String buffNr; + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java index e0d4bf2febb..ec19307221e 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java @@ -4,14 +4,14 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlCData; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import no.nav.tps.ctg.m201.domain.TpsServiceRutineType; -import jakarta.xml.bind.annotation.XmlRootElement; -import jakarta.xml.bind.annotation.XmlType; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -89,4 +89,4 @@ public static class EFnr { private String en; private TpsMeldingResponse svarStatus; } -} +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java index 4a9f69f5fe5..43d28e21fd8 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java @@ -1,20 +1,33 @@ package no.nav.testnav.apps.tpsmessagingservice.dto; import com.fasterxml.jackson.annotation.JsonInclude; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import jakarta.xml.bind.annotation.XmlRootElement; - @Data @Builder @NoArgsConstructor @AllArgsConstructor @XmlRootElement(name = "tpsPersonData") @JsonInclude(JsonInclude.Include.NON_EMPTY) -public class TpsServicerutineRequest { +public class TpsServicerutineRequest implements TpsRequest { private TpsServiceRutine tpsServiceRutine; + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @XmlType(propOrder = {"serviceRutinenavn", "fnr", "aksjonsKode", "aksjonsKode2"}) + public static class TpsServiceRutine { + + private String serviceRutinenavn; + private String fnr; + private String aksjonsKode; + private String aksjonsKode2; + } } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineS018Response.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineS018Response.java new file mode 100644 index 00000000000..d6d4a9cb365 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineS018Response.java @@ -0,0 +1,39 @@ +package no.nav.testnav.apps.tpsmessagingservice.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import no.nav.tps.xjc.ctg.domain.s018.S018PersonType; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class TpsServicerutineS018Response { + + private TpsPersonData tpsPersonData; + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public static class TpsPersonData { + private TpsServicerutineAksjonsdatoRequest.TpsServiceRutineMedAksjonsdato tpsServiceRutine; + private TpsServicerutineS018Response.TpsSvar tpsSvar; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public static class TpsSvar { + + private TpsMeldingResponse svarStatus; + private S018PersonType personDataS018; + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineS610Response.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineS610Response.java index ef5a5b75f68..8f7c614afe0 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineS610Response.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineS610Response.java @@ -23,7 +23,7 @@ public class TpsServicerutineS610Response { @JsonInclude(JsonInclude.Include.NON_EMPTY) public static class TpsPersonData { - private TpsServiceRutine tpsServiceRutine; + private TpsServicerutineRequest.TpsServiceRutine tpsServiceRutine; private TpsSvar tpsSvar; } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdFeltDefinisjonerTrans1.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdFeltDefinisjonerTrans1.java new file mode 100644 index 00000000000..2b64d4e810c --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdFeltDefinisjonerTrans1.java @@ -0,0 +1,208 @@ +package no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger; + +import lombok.Getter; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; + +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.DUMMY_DATO; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.DUMMY_IDENT; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.FIVE_OES; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.SIX_OES; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.WHITESPACE_100_STK; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.WHITESPACE_25_STK; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.WHITESPACE_30_STK; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.WHITESPACE_40_STK; +import static no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.WhitespaceConstants.WHITESPACE_50_STK; + +@Getter +public enum SkdFeltDefinisjonerTrans1 { + FODSELSDATO("fodselsdato", SIX_OES, 1, 6, 1, 6), + PERSONNUMMER("personnummer", FIVE_OES, 2, 5, 7, 11), + MASKINDATO("maskindato", DUMMY_DATO, 3, 8, 12, 19), + MASKINTID("maskintid", SIX_OES, 4, 6, 20, 25), + TRANSTYPE("transtype", "0", 5, 1, 26, 26), + AARSAKSKODE("aarsakskode", "00", 6, 2, 27, 28), + REG_DATO("regDato", DUMMY_DATO, 7, 8, 29, 36), + STATUSKODE("statuskode", " ", 8, 1, 37, 37), + DOEDSDATO("datoDoed", DUMMY_DATO, 9, 8, 38, 45), + SLEKTSNAVN("slektsnavn", WHITESPACE_50_STK, 10, 50, 46, 95), + FORNAVN("fornavn", WHITESPACE_50_STK, 11, 50, 96, 145), + MELLOMNAVN("mellomnavn", WHITESPACE_50_STK, 12, 50, 146, 195), + SLEKTSNAVN_UGIFT_T("slektsnavnUgift", WHITESPACE_50_STK, 13, 50, 196, 245), + FORKORTET_NAVN("forkortetNavn", WHITESPACE_25_STK, 14, 25, 246, 270), + REGDATO_NAVN("regDatoNavn", DUMMY_DATO, 15, 8, 271, 278), + FOEDEKOMMUNE_LAND("foedekommLand", " ", 16, 4, 279, 282), + FOEDESTED("foedested", " ", 17, 20, 283, 302), + STATSBORGERSKAP("statsborgerskap", "000", 18, 3, 303, 305), + STATSBORGERSKAP_REGDATO("regdatoStatsb", DUMMY_DATO, 19, 8, 306, 313), + FAMILIENUMMER("familienummer", DUMMY_IDENT, 20, 11, 314, 324), + REG_DATO_FAM_NR("regdatoFamnr", DUMMY_DATO, 21, 8, 325, 332), + PERSONKODE("personkode", "0", 22, 1, 333, 333), + SPES_REGTYPE("spesRegType", "0", 23, 1, 334, 334), + DATO_SPES_REGTYPE("datoSpesRegType", DUMMY_DATO, 24, 8, 335, 342), + SIVILSTAND("sivilstand", "0", 25, 1, 343, 343), + REGDATO_SIVILSTAND("regdatoSivilstand", DUMMY_DATO, 26, 8, 344, 351), + EKTEFELLE_PARTNER_FODSELSDATO("ektefellePartnerFoedselsdato", SIX_OES, 28, 6, 352, 357), + EKTEFELLE_PARTNER_PERSONNUMMMER("ektefellePartnerPersonnr", FIVE_OES, 29, 5, 358, 362), + EKTEFELLE_PARTNER_NAVN("ektefellePartnerNavn", WHITESPACE_50_STK, 30, 50, 363, 412), + EKTEFELLER_PARTNER_STATSBORGERSKAP("ektefellePartnerStatsb", "000", 31, 3, 413, 415), + REG_DATO_ADR("regdatoAdr", DUMMY_DATO, 33, 8, 416, 423), + FLYTTEDATO_ADR("flyttedatoAdr", DUMMY_DATO, 34, 8, 424, 431), + KOMMUNENUMMER("kommunenummer", "0000", 35, 4, 432, 435), + GATEGAARD("gateGaard", FIVE_OES, 36, 5, 436, 440), + HUSBRUK("husBruk", "0000", 37, 4, 441, 444, true), + BOKSTAVFESTENR("bokstavFestenr", "0000", 38, 4, 445, 448), + UNDERNR("undernr", "000", 39, 3, 449, 451), + ADRESSENAVN("adressenavn", WHITESPACE_25_STK, 40, 25, 452, 476), + ADRESSETYPE("adressetype", " ", 41, 1, 477, 477), + TILLEGGSADRESSE("tilleggsadresse", WHITESPACE_25_STK, 42, 25, 478, 502), + POSTNUMMER("postnummer", "0000", 43, 4, 503, 506), + VALGKRETS("valgkrets", "0000", 44, 4, 507, 510), + POSTADRESSE1("postadresse1", WHITESPACE_30_STK, 46, 30, 511, 540), + POSTADRESSE2("postadresse2", WHITESPACE_30_STK, 47, 30, 541, 570), + POSTADRESSE3("postadresse3", WHITESPACE_30_STK, 48, 30, 571, 600), + POSTADRESSE_LAND("postadresseLand", "000", 49, 3, 601, 603), + INNVANDRET_FRA_LAND("innvandretFraLand", "000", 50, 3, 604, 606), + FRA_LAND_REGDATO("fraLandRegdato", DUMMY_DATO, 51, 8, 607, 614), + FRA_LAND_FLYTTEDATO("fraLandFlyttedato", DUMMY_DATO, 52, 8, 615, 622), + FRA_KOMMUNE("fraKommune", "0000", 53, 4, 623, 626), + FRA_KOMMUNE_REGDATO("fraKommRegdato", DUMMY_DATO, 54, 8, 627, 634), + FRA_KOMMUNE_FLYTTEDATO("fraKommFlyttedato", DUMMY_DATO, 55, 8, 635, 642), + UTVANDRET_TIL_LAND("utvandretTilLand", "000", 56, 3, 643, 645), + TIL_LAND_REGDATO("tilLandRegdato", DUMMY_DATO, 57, 8, 646, 653), + TIL_LAND_FLYTTEDATO("tilLandFlyttedato", DUMMY_DATO, 58, 8, 654, 661), + SAMEMANNTALL("samemanntall", " ", 59, 1, 662, 662), + DATO_SAMEMANNTALL("datoSamemanntall", DUMMY_DATO, 60, 8, 663, 670), + UMYNDIGGJORT("umyndiggjort", " ", 61, 1, 671, 671), + DATO_UMYNDIGGJORT("datoUmyndiggjort", DUMMY_DATO, 62, 8, 672, 679), + FORELDREANSVAR("foreldreansvar", " ", 63, 1, 680, 680), + DATO_FORELDREANSVAR("datoForeldreansvar", DUMMY_DATO, 64, 8, 681, 688), + ARBEIDSTILLATELSE("arbeidstillatelse", " ", 65, 1, 689, 689), + DATO_ARBEIDSTILLATELSE("datoArbeidstillatelse", DUMMY_DATO, 66, 8, 690, 697), + FREMKONNUMMER("fremkonnummer", DUMMY_DATO, 67, 8, 698, 705), + MORS_FODSELSDATO("morsFodselsdato", SIX_OES, 69, 6, 706, 711), + MORS_PERSONNUMMER("morsPersonnummer", FIVE_OES, 70, 5, 712, 716), + MORS_NAVN("morsNavn", WHITESPACE_50_STK, 71, 50, 717, 766), + MORS_STATSBORGERSKAP("morsStatsbSkap", "000", 72, 3, 767, 769), + FARS_FODSELSDATO("farsFodselsdato", SIX_OES, 74, 6, 770, 775), + FARS_PERSONNUMMER("farsPersonnummer", FIVE_OES, 75, 5, 776, 780), + FARS_NAVN("farsNavn", WHITESPACE_50_STK, 76, 50, 781, 830), + FARS_STATSBSKAP("farsStatsbSkap", "000", 77, 3, 831, 833), + TIDLIGERE_FNR_DNR("tidligereFnrDnr", DUMMY_IDENT, 78, 11, 834, 844), + DATO_TIDLIGERE_FNRDNR("datoTidlFnrDnr", DUMMY_DATO, 79, 8, 845, 852), + NYTT_FNR("nyttFnr", DUMMY_IDENT, 80, 11, 853, 863), + DATO_NYTT_FNR("datoNyttFnr", DUMMY_DATO, 81, 8, 864, 871), + LEVENDE_DOED("levendeDoed", " ", 82, 1, 872, 872), + KJOENN("kjoenn", " ", 83, 1, 873, 873), + TILDELINGSKODE("tildelingskode", " ", 84, 1, 874, 874), + FOEDSELSTYPE("foedselstype", " ", 85, 2, 875, 876), + MORS_SIVILSTAND("morsSivilstand", " ", 86, 1, 877, 877), + EKTESKAP_PARTNERSKAP_NUMMER("ekteskapPartnerskapNr", " ", 87, 1, 878, 878), + EKTEFELLE_EKTESKAP_PARTNERSKAP_NUMMER("ektefelleEkteskapPartnerskapNr", " ", 88, 1, 879, 879), + VIGSELSTYPE("vigselstype", " ", 89, 1, 880, 880), + FORS_BYRDE("forsByrde", " ", 90, 2, 881, 882), + DOMBEVILLING("dombevilling", " ", 91, 1, 883, 883), + ANTALL_BARN("antallBarn", " ", 92, 2, 884, 885), + TIDLIGERE_SIVILSTAND("tidligereSivilstand", " ", 93, 1, 886, 886), + EKTEFELLE_TIDLIGERE_SIVILSTAND("ektefelleTidligereSivilstand", " ", 94, 1, 887, 887), + HJEMMEL("hjemmel", " ", 95, 1, 888, 888), + FYLKE("fylke", " ", 96, 2, 889, 890), + VIGSELSKOMMUNE("vigselskommune", "0000", 97, 4, 891, 894), + TIDL_SEP_DOM_BEV("tidlSepDomBev", " ", 98, 1, 895, 895), + BEGJERT_AV("begjertAv", " ", 99, 1, 896, 896), + REGISTRERINGSGRUNNLAG("registrGrunnlag", " ", 100, 1, 897, 897), + DOEDSSTED("doedssted", " ", 101, 4, 898, 901), + TYPE_DOEDSSTED("typeDoedssted", " ", 102, 1, 902, 902), + VIGSELSDATO("vigselsdato", DUMMY_DATO, 103, 8, 903, 910), + MEDLEM_KIRKEN("medlKirken", " ", 104, 1, 911, 911), + SEKVENS_NR("sekvensnr", SIX_OES, 105, 6, 912, 917), + BOLIG_NR("bolignr", " ", 106, 5, 918, 922), + DUF_ID("dufId", "000000000000", 107, 12, 923, 934), + BRUKERIDENT("brukerident", " ", 108, 8, 935, 942), + SKOLERETS("skolerets", "0000", 109, 4, 943, 946), + TK_NR("tkNr", "0000", 110, 4, 947, 950), + DNR_HJEMLANDSADRESSE1("dnrHjemlandsadresse1", WHITESPACE_40_STK, 111, 40, 951, 990), + DNR_HJEMLANDSADRESSE2("dnrHjemlandsadresse2", WHITESPACE_40_STK, 112, 40, 991, 1030), + DNR_HJEMLANDSADRESSE3("dnrHjemlandsadresse3", WHITESPACE_40_STK, 113, 40, 1031, 1070), + DNR_HJEMLAND_LANDKODE("dnrHjemlandLandkode", "000", 114, 3, 1071, 1073), + DNR_HJEMLAND_REGDATO("dnrHjemlandRegDato", DUMMY_DATO, 115, 8, 1074, 1081), + DNR_ID_KONTROLL("dnrIdKontroll", " ", 116, 1, 1082, 1082), + POSTADRESSE_REGDATO("postadrRegDato", DUMMY_DATO, 117, 8, 1083, 1090), + UTVANDRINGSTYPE("utvandringstype", " ", 118, 1, 1091, 1091), + GRUNNKRETS("grunnkrets", "0000", 119, 4, 1092, 1095), + STATSBORGERSKAP2("statsborgerskap2", "000", 120, 3, 1096, 1098), + REGDATO_STATSB2("regdatoStatsb2", DUMMY_DATO, 121, 8, 1099, 1106), + STATSBORGERSKAP3("statsborgerskap3", "000", 122, 3, 1107, 1109), + REGDATO_STATSB3("regdatoStatsb3", DUMMY_DATO, 123, 8, 1110, 1117), + STATSBORGERSKAP4("statsborgerskap4", "000", 124, 3, 1118, 1120), + REGDATO_STATSB4("regdatoStatsb4", DUMMY_DATO, 125, 8, 1121, 1128), + STATSBORGERSKAP5("statsborgerskap5", "000", 126, 3, 1129, 1131), + REGDATO_STATSB5("regdatoStatsb5", DUMMY_DATO, 127, 8, 1132, 1139), + STATSBORGERSKAP6("statsborgerskap6", "000", 128, 3, 1140, 1142), + REGDATO_STATSB6("regdatoStatsb6", DUMMY_DATO, 129, 8, 1143, 1150), + STATSBORGERSKAP7("statsborgerskap7", "000", 130, 3, 1151, 1153), + REGDATO_STATSB7("regdatoStatsb7", DUMMY_DATO, 131, 8, 1154, 1161), + STATSBORGERSKAP8("statsborgerskap8", "000", 132, 3, 1162, 1164), + REGDATO_STATSB8("regdatoStatsb8", DUMMY_DATO, 132, 8, 1165, 1172), + STATSBORGERSKAP9("statsborgerskap9", "000", 133, 3, 1173, 1175), + REGDATO_STATSB9("regdatoStatsb9", DUMMY_DATO, 134, 8, 1176, 1183), + STATSBORGERSKAP10("statsborgerskap10", "000", 135, 3, 1184, 1186), + REGDATO_STATSB10("regdatoStatsb10", DUMMY_DATO, 136, 8, 1187, 1194), + BIBEHOLD("bibehold", " ", 137, 1, 1195, 1195), + REGDATO_BIBEHOLD("regdatoBibehold", DUMMY_DATO, 138, 8, 1196, 1203), + SAKSID("saksid", "0000000", 139, 7, 1204, 1210), + EMBETE("embete", " ", 140, 4, 1211, 1214), + SAKSTYPE("sakstype", " ", 141, 3, 1215, 1217), + VEDTAKSDATO("vedtaksdato", " ", 142, 8, 1218, 1225), + INTERN_VERGE_ID("internVergeid", "0000000", 143, 7, 1226, 1232), + VERGE_FNR_DNR("vergeFnrDnr", DUMMY_IDENT, 144, 11, 1233, 1243), + VERGETYPE("vergetype", " ", 145, 3, 1244, 1246), + MANDATTYPE("mandattype", " ", 146, 3, 1247, 1249), + MANDAT_TEKST("mandatTekst", WHITESPACE_100_STK, 147, 100, 1250, 1349), + RESERVER_FRAMTIDIG_BRUK("reserverFramtidigBruk", WHITESPACE_100_STK + WHITESPACE_50_STK + " ", 148, 151, 1350, 1500); + + private String variabelNavn; + private String defaultVerdi; + private int idRekkefolge; + private int antallBytesAvsatt; + private int fraByte; + private int tilByte; + private boolean isValueLastInSkdField = false; + + public static final int TRANSTYPE_START_POSITION = 25; + public static final int TRANSTYPE_END_POSITION = 26; + + SkdFeltDefinisjonerTrans1(String variabelnavn, String defaultVerdi, int idRekkefolge, int antallBytesAvsatt, int fraByte, int tilByte, boolean isValueLastInSkdField) { + this.variabelNavn = variabelnavn; + this.defaultVerdi = defaultVerdi; + this.idRekkefolge = idRekkefolge; + this.antallBytesAvsatt = antallBytesAvsatt; + this.fraByte = fraByte; + this.tilByte = tilByte; + this.isValueLastInSkdField = isValueLastInSkdField; + } + + SkdFeltDefinisjonerTrans1(String variabelnavn, String defaultVerdi, int idRekkefolge, int antallBytesAvsatt, + int fraByte, int tilByte) { + this.variabelNavn = variabelnavn; + this.defaultVerdi = defaultVerdi; + this.idRekkefolge = idRekkefolge; + this.antallBytesAvsatt = antallBytesAvsatt; + this.fraByte = fraByte; + this.tilByte = tilByte; + } + + public static List getAllFeltDefinisjonerInSortedList() { + return new ArrayList<>(Arrays.stream(SkdFeltDefinisjonerTrans1.values()) + .sorted(Comparator.comparingInt(SkdFeltDefinisjonerTrans1::getIdRekkefolge)) + .toList()); + } + + public String extractMeldingsfeltverdiFromString(String skdMeldingUtenHeader) { + String extractedValue = skdMeldingUtenHeader.substring(this.getFraByte() - 1, this.getTilByte()); + return extractedValue.equals(this.getDefaultVerdi()) ? null : extractedValue.trim(); + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdMeldingTrans1.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdMeldingTrans1.java new file mode 100644 index 00000000000..0599afbc98d --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdMeldingTrans1.java @@ -0,0 +1,207 @@ +package no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpStatus; +import org.springframework.web.server.ResponseStatusException; + +import java.lang.reflect.InvocationTargetException; + +import static java.lang.Math.min; + +/** + * Java-representasjon av skdmeldingen. Objektet bærer verdiene til de utfylte elementene i skd-meldingen. + */ +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class SkdMeldingTrans1 { + private static final int MELDINGSLENGDE_UTEN_HEADER = 1500; + + private String header; + private String fodselsdato; + private String personnummer; + private String maskindato; + private String maskintid; + private String transtype; + private String aarsakskode; + private String regDato; + private String statuskode; + private String datoDoed; + private String slektsnavn; + private String fornavn; + private String mellomnavn; + private String slektsnavnUgift; + private String forkortetNavn; + private String regDatoNavn; + private String foedekommLand; + private String foedested; + private String statsborgerskap; + private String regdatoStatsb; + private String familienummer; + private String regdatoFamnr; + private String personkode; + private String spesRegType; + private String datoSpesRegType; + private String sivilstand; + private String regdatoSivilstand; + private String ektefellePartnerFoedselsdato; + private String ektefellePartnerPersonnr; + private String ektefellePartnerNavn; + private String ektefellePartnerStatsb; + private String regdatoAdr; + private String flyttedatoAdr; + private String kommunenummer; + private String gateGaard; + private String husBruk; + private String bokstavFestenr; + private String undernr; + private String adressenavn; + private String adressetype; + private String tilleggsadresse; + private String postnummer; + private String valgkrets; + private String postadresse1; + private String postadresse2; + private String postadresse3; + private String postadresseLand; + private String innvandretFraLand; + private String fraLandRegdato; + private String fraLandFlyttedato; + private String fraKommune; + private String fraKommRegdato; + private String fraKommFlyttedato; + private String utvandretTilLand; + private String tilLandRegdato; + private String tilLandFlyttedato; + private String samemanntall; + private String datoSamemanntall; + private String umyndiggjort; + private String datoUmyndiggjort; + private String foreldreansvar; + private String datoForeldreansvar; + private String arbeidstillatelse; + private String datoArbeidstillatelse; + private String fremkonnummer; + private String morsFodselsdato; + private String morsPersonnummer; + private String morsNavn; + private String morsStatsbSkap; + private String farsFodselsdato; + private String farsPersonnummer; + private String farsNavn; + private String farsStatsbSkap; + private String tidligereFnrDnr; + private String datoTidlFnrDnr; + private String nyttFnr; + private String datoNyttFnr; + private String levendeDoed; + private String kjoenn; + private String tildelingskode; + private String foedselstype; + private String morsSivilstand; + private String ekteskapPartnerskapNr; + private String ektefelleEkteskapPartnerskapNr; + private String vigselstype; + private String forsByrde; + private String dombevilling; + private String antallBarn; + private String tidligereSivilstand; + private String ektefelleTidligereSivilstand; + private String hjemmel; + private String fylke; + private String vigselskommune; + private String tidlSepDomBev; + private String begjertAv; + private String registrGrunnlag; + private String doedssted; + private String typeDoedssted; + private String vigselsdato; + private String medlKirken; + private String sekvensnr; + private String bolignr; + private String dufId; + private String brukerident; + private String skolerets; + private String tkNr; + private String dnrHjemlandsadresse1; + private String dnrHjemlandsadresse2; + private String dnrHjemlandsadresse3; + private String dnrHjemlandLandkode; + private String dnrHjemlandRegDato; + private String dnrIdKontroll; + private String postadrRegDato; + private String utvandringstype; + private String grunnkrets; + private String statsborgerskap2; + private String regdatoStatsb2; + private String statsborgerskap3; + private String regdatoStatsb3; + private String statsborgerskap4; + private String regdatoStatsb4; + private String statsborgerskap5; + private String regdatoStatsb5; + private String statsborgerskap6; + private String regdatoStatsb6; + private String statsborgerskap7; + private String regdatoStatsb7; + private String statsborgerskap8; + private String regdatoStatsb8; + private String statsborgerskap9; + private String regdatoStatsb9; + private String statsborgerskap10; + private String regdatoStatsb10; + private String bibehold; + private String regdatoBibehold; + private String saksid; + private String embete; + private String sakstype; + private String vedtaksdato; + private String internVergeid; + private String vergeFnrDnr; + private String vergetype; + private String mandattype; + private String mandatTekst; + private String reserverFramtidigBruk; + + @Override + public String toString() { + StringBuilder skdMelding = new StringBuilder(); + if (header != null) { + skdMelding.append(header); + } + + SkdFeltDefinisjonerTrans1.getAllFeltDefinisjonerInSortedList().forEach(skdFeltDefinisjon -> { + String parameterverdien = getMeldingsverdien(skdFeltDefinisjon); + skdMelding.append(parameterverdien == null ? + skdFeltDefinisjon.getDefaultVerdi() : addDefaultValueToEndOfString(parameterverdien, skdFeltDefinisjon)); + }); + + return skdMelding.toString(); + } + + private String addDefaultValueToEndOfString(String parameterverdien, SkdFeltDefinisjonerTrans1 skdFeltDefinisjon) { + if (!skdFeltDefinisjon.isValueLastInSkdField()) { + return parameterverdien.substring(0, min(parameterverdien.length(), skdFeltDefinisjon.getAntallBytesAvsatt())) + + skdFeltDefinisjon.getDefaultVerdi().substring(min(skdFeltDefinisjon.getAntallBytesAvsatt(), parameterverdien.length())); + } else { + return skdFeltDefinisjon.getDefaultVerdi().substring(0, + (skdFeltDefinisjon.getDefaultVerdi().length() - parameterverdien.length())) + parameterverdien; + } + } + + public String getMeldingsverdien(SkdFeltDefinisjonerTrans1 skdFeltDefinisjon) { + try { + return ((String) getClass().getMethod("get" + StringUtils.capitalize(skdFeltDefinisjon.getVariabelNavn())) + .invoke(this)); + } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { + throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, e.getMessage(), e); + } + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdMeldingsheader.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdMeldingsheader.java new file mode 100644 index 00000000000..a086d58bc06 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/SkdMeldingsheader.java @@ -0,0 +1,51 @@ +package no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger; + +import lombok.experimental.UtilityClass; + +@UtilityClass +public class SkdMeldingsheader { + + private static final String KJORE_NUMMER = "000004421"; + private static final String KODE_SYSTEM = "TPSF"; + private static final String MQ_HANDLE = "000000000"; + private static final String SKD_REFERANSE = WhitespaceConstants.WHITESPACE_20_STK; + + private static final int INDEX_START_TILDELINGSKODE = 873; + private static final int INDEX_SLUTT_TILDELINGSKODE = 874; + + private static final int INDEX_START_AARSAKSKODE = 26; + private static final int INDEX_SLUTT_AARSAKSKODE = 28; + + private static final int INDEX_START_TRANSTYPE = 25; + private static final int INDEX_SLUTT_TRANSTYPE = 26; + + public String appendHeader(String skdMelding) { + + var aarsakskode = extractAArsakskode(skdMelding); + var transType = extractTranstype(skdMelding); + var tildelingsKode = extractTildelingskode(skdMelding); + + return new StringBuilder() + .append(MQ_HANDLE) + .append(KODE_SYSTEM) + .append(KJORE_NUMMER) + .append(aarsakskode) + .append(transType) + .append(tildelingsKode) + .append(SKD_REFERANSE) + .append(skdMelding) + .toString(); + } + + private String extractAArsakskode(String skdMelding) { + return skdMelding.length() > INDEX_SLUTT_AARSAKSKODE ? skdMelding.substring(INDEX_START_AARSAKSKODE, INDEX_SLUTT_AARSAKSKODE) : " "; + } + + private String extractTranstype(String skdMelding) { + return skdMelding.length() > INDEX_SLUTT_TRANSTYPE ? skdMelding.substring(INDEX_START_TRANSTYPE, INDEX_SLUTT_TRANSTYPE) : " "; + } + + private String extractTildelingskode(String skdMelding) { + return skdMelding.length() > INDEX_SLUTT_TILDELINGSKODE ? skdMelding.substring(INDEX_START_TILDELINGSKODE, INDEX_SLUTT_TILDELINGSKODE) : "0"; + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/WhitespaceConstants.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/WhitespaceConstants.java new file mode 100644 index 00000000000..ebf9421ca8e --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/endringsmeldinger/WhitespaceConstants.java @@ -0,0 +1,21 @@ +package no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger; + +import lombok.experimental.UtilityClass; + +@UtilityClass +public final class WhitespaceConstants { + + public static final String WHITESPACE_5_STK = " "; + public static final String WHITESPACE_10_STK = WHITESPACE_5_STK + WHITESPACE_5_STK; + public static final String WHITESPACE_20_STK = WHITESPACE_10_STK + WHITESPACE_10_STK; + public static final String WHITESPACE_25_STK = WHITESPACE_5_STK + WHITESPACE_20_STK; + public static final String WHITESPACE_40_STK = WHITESPACE_20_STK + WHITESPACE_20_STK; + public static final String WHITESPACE_30_STK = WHITESPACE_5_STK + WHITESPACE_25_STK; + public static final String WHITESPACE_50_STK = WHITESPACE_25_STK + WHITESPACE_25_STK; + public static final String WHITESPACE_100_STK = WHITESPACE_50_STK + WHITESPACE_50_STK; + + public static final String FIVE_OES = "00000"; + public static final String SIX_OES = "000000"; + public static final String DUMMY_DATO = "00000000"; + public static final String DUMMY_IDENT = "00000000000"; +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java index dcd08fd69ec..bc2309a2c91 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java @@ -17,8 +17,6 @@ import java.time.LocalDateTime; import static java.util.Objects.nonNull; -import static no.nav.testnav.libs.data.tpsmessagingservice.v1.AdresseDTO.Adressetype.GATE; -import static no.nav.testnav.libs.data.tpsmessagingservice.v1.AdresseDTO.Adressetype.MATR; @Component public class AdresseMappingStrategy implements MappingStrategy { @@ -70,7 +68,6 @@ public void mapAtoB(BoAdresseType source, GateadresseDTO target, MappingContext target.setHusnummer(skipLeadZeros(source.getOffAdresse().getHusnr())); target.setGatekode(source.getOffAdresse().getGatekode()); target.setFlyttedato(getDate(source.getDatoFom())); - target.setAdressetype(GATE); } }) .byDefault() @@ -87,7 +84,6 @@ public void mapAtoB(BoAdresseType source, MatrikkeladresseDTO target, MappingCon target.setFestenr(skipLeadZeros(source.getMatrAdresse().getFestenr())); target.setUndernr(skipLeadZeros(source.getMatrAdresse().getUndernr())); target.setFlyttedato(getDate(source.getDatoFom())); - target.setAdressetype(MATR); } }) .byDefault() diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/LocalDateCustomMapping.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/LocalDateCustomMapping.java new file mode 100644 index 00000000000..a3dbe79577d --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/LocalDateCustomMapping.java @@ -0,0 +1,30 @@ +package no.nav.testnav.apps.tpsmessagingservice.mapper; + +import lombok.extern.slf4j.Slf4j; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.converter.BidirectionalConverter; +import ma.glasnost.orika.metadata.Type; +import org.springframework.stereotype.Component; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +import static java.util.Objects.nonNull; +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +@Slf4j +@Component +public class LocalDateCustomMapping extends BidirectionalConverter { + + @Override + public LocalDate convertTo(String localDate, Type type, MappingContext mappingContext) { + + return isNotBlank(localDate) ? LocalDate.parse(localDate) : null; + } + + @Override + public String convertFrom(LocalDate localDate, Type type, MappingContext mappingContext) { + + return nonNull(localDate) ? localDate.format(DateTimeFormatter.ISO_LOCAL_DATE) : null; + } +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/LocalDateTimeCustomMapping.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/LocalDateTimeCustomMapping.java new file mode 100644 index 00000000000..4ce8f381e6a --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/LocalDateTimeCustomMapping.java @@ -0,0 +1,37 @@ +package no.nav.testnav.apps.tpsmessagingservice.mapper; + +import lombok.extern.slf4j.Slf4j; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.converter.BidirectionalConverter; +import ma.glasnost.orika.metadata.Type; +import org.springframework.stereotype.Component; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +import static java.util.Objects.nonNull; +import static org.apache.commons.lang3.StringUtils.isBlank; + +@Slf4j +@Component +public class LocalDateTimeCustomMapping extends BidirectionalConverter { + + @Override + public LocalDateTime convertTo(String localDateTime, Type type, MappingContext mappingContext) { + + if (isBlank(localDateTime)) { + return null; + } + + return localDateTime.length() == 10 ? + LocalDate.parse(localDateTime).atStartOfDay() : + LocalDateTime.parse(localDateTime); + } + + @Override + public String convertFrom(LocalDateTime localDateTime, Type type, MappingContext mappingContext) { + + return nonNull(localDateTime) ? localDateTime.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME) : null; + } +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/provider/v1/PersonController.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/provider/v1/PersonController.java index 12f77f44f1c..db20e8fe24f 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/provider/v1/PersonController.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/provider/v1/PersonController.java @@ -2,13 +2,23 @@ import lombok.RequiredArgsConstructor; import no.nav.testnav.apps.tpsmessagingservice.dto.TpsMeldingResponse; +import no.nav.testnav.apps.tpsmessagingservice.service.AdressehistorikkService; import no.nav.testnav.apps.tpsmessagingservice.service.BankkontoNorskService; import no.nav.testnav.apps.tpsmessagingservice.service.BankkontoUtlandService; +import no.nav.testnav.apps.tpsmessagingservice.service.DoedsmeldingService; import no.nav.testnav.apps.tpsmessagingservice.service.EgenansattService; +import no.nav.testnav.apps.tpsmessagingservice.service.FoedselsmeldingService; import no.nav.testnav.apps.tpsmessagingservice.service.PersonService; import no.nav.testnav.apps.tpsmessagingservice.service.SpraakService; import no.nav.testnav.libs.data.kontoregister.v1.BankkontonrNorskDTO; import no.nav.testnav.libs.data.kontoregister.v1.BankkontonrUtlandDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonMiljoeDTO; import no.nav.testnav.libs.data.tpsmessagingservice.v1.SpraakDTO; import no.nav.testnav.libs.data.tpsmessagingservice.v1.TpsMeldingResponseDTO; @@ -27,6 +37,7 @@ import java.util.Map; import static java.util.Collections.emptyList; +import static java.util.Objects.isNull; import static java.util.Objects.nonNull; @RestController @@ -39,6 +50,9 @@ public class PersonController { private final SpraakService spraakService; private final BankkontoUtlandService bankkontoUtlandService; private final BankkontoNorskService bankkontoNorskService; + private final AdressehistorikkService adressehistorikkService; + private final FoedselsmeldingService foedselsmeldingService; + private final DoedsmeldingService doedsmeldingService; private static List convert(Map tpsMeldingDTO) { @@ -113,5 +127,33 @@ public List opphoerBankkontonrUtland(@PathVariable String return convert(bankkontoUtlandService.opphoerBankkontonrUtland(ident, miljoer)); } + + @PostMapping("/adressehistorikk") + public List personhistorikk(@RequestBody AdressehistorikkRequest request, + @RequestParam(required = false) List miljoer) { + + return adressehistorikkService.hentHistorikk(request, isNull(miljoer) ? emptyList() : miljoer); + } + + @PostMapping("/foedselsmelding") + public FoedselsmeldingResponse sendFoedselsmelding(@RequestParam(required = false) List miljoer, + @RequestBody FoedselsmeldingRequest persondata) { + + return foedselsmeldingService.sendFoedselsmelding(persondata, isNull(miljoer) ? emptyList() : miljoer); + } + + @PostMapping("/doedsmelding") + public DoedsmeldingResponse sendDoedsmelding(@RequestBody DoedsmeldingRequest request, + @RequestParam(required = false) List miljoer) { + + return doedsmeldingService.sendDoedsmelding(request, isNull(miljoer) ? emptyList() : miljoer); + } + + @DeleteMapping("/doedsmelding") + public DoedsmeldingResponse annulerDoedsmelding(@RequestParam(required = false) List miljoer, + @RequestBody PersonDTO persondata) { + + return doedsmeldingService.annulerDoedsmelding(persondata, isNull(miljoer) ? emptyList() : miljoer); + } } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/AdressehistorikkService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/AdressehistorikkService.java new file mode 100644 index 00000000000..894b4418dd6 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/AdressehistorikkService.java @@ -0,0 +1,130 @@ +package no.nav.testnav.apps.tpsmessagingservice.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import ma.glasnost.orika.MapperFacade; +import no.nav.testnav.apps.tpsmessagingservice.consumer.ServicerutineConsumer; +import no.nav.testnav.apps.tpsmessagingservice.consumer.TestmiljoerServiceConsumer; +import no.nav.testnav.apps.tpsmessagingservice.consumer.command.TpsMeldingCommand; +import no.nav.testnav.apps.tpsmessagingservice.dto.TpsServicerutineAksjonsdatoRequest; +import no.nav.testnav.apps.tpsmessagingservice.dto.TpsServicerutineS018Response; +import no.nav.testnav.apps.tpsmessagingservice.utils.EndringsmeldingUtil; +import no.nav.testnav.apps.tpsmessagingservice.utils.ResponseStatus; +import no.nav.testnav.apps.tpsmessagingservice.utils.ServiceRutineUtil; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdressehistorikkRequest; +import no.nav.tps.xjc.ctg.domain.s018.S018PersonType; +import no.nav.tps.xjc.ctg.domain.s018.SRnavnType; +import org.json.XML; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static java.util.Objects.nonNull; + +@Slf4j +@Service +public class AdressehistorikkService { + + private final TestmiljoerServiceConsumer testmiljoerServiceConsumer; + private final JAXBContext requestContext; + private final ServicerutineConsumer servicerutineConsumer; + private final MapperFacade mapperFacade; + private final ObjectMapper objectMapper; + + public AdressehistorikkService(TestmiljoerServiceConsumer testmiljoerServiceConsumer, + ServicerutineConsumer servicerutineConsumer, + MapperFacade mapperFacade, + ObjectMapper objectMapper) throws JAXBException { + + this.testmiljoerServiceConsumer = testmiljoerServiceConsumer; + this.requestContext = JAXBContext.newInstance(TpsServicerutineAksjonsdatoRequest.class); + this.servicerutineConsumer = servicerutineConsumer; + this.mapperFacade = mapperFacade; + this.objectMapper = objectMapper; + } + + public List hentHistorikk(AdressehistorikkRequest request, List miljoer) { + + if (miljoer.isEmpty()) { + miljoer = testmiljoerServiceConsumer.getMiljoer(); + } + + var tpsPersoner = readFromTps(request.getIdent(), + nonNull(request.getAksjonsdato()) ? request.getAksjonsdato() : LocalDate.now(), + miljoer); + + return tpsPersoner.entrySet().stream() + .map(entry -> { + var status = ResponseStatus.decodeStatus(nonNull(entry.getValue()) && + nonNull(entry.getValue().getTpsPersonData()) ? + entry.getValue().getTpsPersonData().getTpsSvar().getSvarStatus() : null); + return AdressehistorikkDTO.builder() + .miljoe(entry.getKey()) + .status(mapperFacade.map(status, AdressehistorikkDTO.TpsMeldingResponse.class)) + .persondata("OK".equals(status.getReturStatus()) ? + mapAdressehistorikk(request.getIdent(), + entry.getValue().getTpsPersonData().getTpsSvar().getPersonDataS018()) : + null) + .build(); + }) + .toList(); + } + + private AdressehistorikkDTO.PersonData mapAdressehistorikk(String ident, S018PersonType persondataS18) { + + var persondata = mapperFacade.map(persondataS18, AdressehistorikkDTO.PersonData.class); + persondata.setIdent(ident); + return persondata; + } + + private Map readFromTps(String ident, LocalDate foedselsdato, List miljoer) { + + var request = TpsServicerutineAksjonsdatoRequest.builder() + .tpsServiceRutine(TpsServicerutineAksjonsdatoRequest.TpsServiceRutineMedAksjonsdato.builder() + .serviceRutinenavn(SRnavnType.FS_03_FDNUMMER_PADRHIST_O.value()) + .fnr(ident) + .aksjonsKode("A") + .aksjonsKode2("0") + .aksjonsDato(foedselsdato.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + .build()) + .build(); + + var xmlRequest = ServiceRutineUtil.marshallToXML(requestContext, request); + + var miljoerResponse = servicerutineConsumer.sendMessage(xmlRequest, miljoer); + + miljoerResponse.forEach((key, value) -> log.info("Miljø: {} XML: {}", key, value)); + + return miljoerResponse.entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, + entry -> unmarshallFromXml(entry.getValue()))); + } + + @SneakyThrows + private TpsServicerutineS018Response unmarshallFromXml(String endringsmeldingResponse) { + + if (TpsMeldingCommand.NO_RESPONSE.equals(endringsmeldingResponse)) { + + return TpsServicerutineS018Response.builder() + .tpsPersonData(TpsServicerutineS018Response.TpsPersonData.builder() + .tpsSvar(TpsServicerutineS018Response.TpsSvar.builder() + .svarStatus(EndringsmeldingUtil.getNoAnswerStatus()) + .build()) + .build()) + .build(); + + } else { + + var jsonRoot = XML.toJSONObject(endringsmeldingResponse); + return objectMapper.readValue(jsonRoot.toString(), TpsServicerutineS018Response.class); + } + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/DoedsmeldingService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/DoedsmeldingService.java new file mode 100644 index 00000000000..2c6c68133c5 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/DoedsmeldingService.java @@ -0,0 +1,68 @@ +package no.nav.testnav.apps.tpsmessagingservice.service; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.testnav.apps.tpsmessagingservice.consumer.TestmiljoerServiceConsumer; +import no.nav.testnav.apps.tpsmessagingservice.service.skd.DoedsmeldingAnnulleringBuilderService; +import no.nav.testnav.apps.tpsmessagingservice.service.skd.DoedsmeldingBuilderService; +import no.nav.testnav.apps.tpsmessagingservice.service.skd.SendSkdMeldinger; +import no.nav.testnav.apps.tpsmessagingservice.utils.ResponseStatus; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingResponse; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Slf4j +@Service +@RequiredArgsConstructor +public class DoedsmeldingService { + + private final SendSkdMeldinger sendSkdMeldinger; + private final DoedsmeldingBuilderService doedsmeldingBuilderService; + private final DoedsmeldingAnnulleringBuilderService doedsmeldingAnnulleringBuilderService; + private final TestmiljoerServiceConsumer testmiljoerServiceConsumer; + + public DoedsmeldingResponse sendDoedsmelding(DoedsmeldingRequest request, List miljoer) { + + if (miljoer.isEmpty()) { + miljoer = testmiljoerServiceConsumer.getMiljoer(); + } + + var skdMelding = doedsmeldingBuilderService.build(request); + + var miljoerStatus = sendSkdMeldinger.sendMeldinger(skdMelding.toString(), miljoer); + prepareStatus(miljoerStatus); + + return DoedsmeldingResponse.builder() + .ident(request.getIdent()) + .miljoStatus(miljoerStatus) + .build(); + } + + public DoedsmeldingResponse annulerDoedsmelding(PersonDTO person, List miljoer) { + + if (miljoer.isEmpty()) { + miljoer = testmiljoerServiceConsumer.getMiljoer(); + } + + var skdMelding = doedsmeldingAnnulleringBuilderService.execute(person); + + var miljoerStatus = sendSkdMeldinger.sendMeldinger(skdMelding.toString(), miljoer); + prepareStatus(miljoerStatus); + + return DoedsmeldingResponse.builder() + .ident(person.getIdent()) + .miljoStatus(miljoerStatus) + .build(); + } + + private void prepareStatus(Map sentStatus) { + + sentStatus.forEach((env, status) -> log.info("Doedsmelding i miljø {} status {} ", env, status)); + + sentStatus.replaceAll((env, status) -> status.matches("^00.*") ? "OK" : ResponseStatus.extract(status)); + } +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/FoedselsmeldingService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/FoedselsmeldingService.java new file mode 100644 index 00000000000..d29c5cf2b3b --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/FoedselsmeldingService.java @@ -0,0 +1,44 @@ +package no.nav.testnav.apps.tpsmessagingservice.service; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.apps.tpsmessagingservice.consumer.TestmiljoerServiceConsumer; +import no.nav.testnav.apps.tpsmessagingservice.service.skd.FoedselsmeldingBuilderService; +import no.nav.testnav.apps.tpsmessagingservice.service.skd.SendSkdMeldinger; +import no.nav.testnav.apps.tpsmessagingservice.utils.ResponseStatus; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingResponse; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +@RequiredArgsConstructor +public class FoedselsmeldingService { + + private final SendSkdMeldinger sendSkdMeldinger; + private final FoedselsmeldingBuilderService foedselsmeldingBuilderService; + private final TestmiljoerServiceConsumer testmiljoerServiceConsumer; + + public FoedselsmeldingResponse sendFoedselsmelding(FoedselsmeldingRequest persondata, List miljoer) { + + if (miljoer.isEmpty()) { + miljoer = testmiljoerServiceConsumer.getMiljoer(); + } + + var skdMelding = foedselsmeldingBuilderService.build(persondata); + + var miljoerStatus = sendSkdMeldinger.sendMeldinger(skdMelding.toString(), miljoer); + prepareStatus(miljoerStatus); + + return FoedselsmeldingResponse.builder() + .ident(persondata.getBarn().getIdent()) + .miljoStatus(miljoerStatus) + .build(); + } + + private void prepareStatus(Map sentStatus) { + + sentStatus.replaceAll((env, status) -> status.matches("^00.*") ? "OK" : ResponseStatus.extract(status)); + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java index 01ca63330be..ea4dfcb36d3 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java @@ -94,11 +94,11 @@ private Map readFromTps(List ident var xmlRequest = prepareRequest(identer, isProd); - log.trace("M201 request: {}", xmlRequest); + log.info("M201 request: {}", xmlRequest); var miljoerResponse = servicerutineConsumer.sendMessage(xmlRequest, miljoer); - miljoerResponse.forEach((key, value) -> log.trace("Miljø: {} XML: {}", key, value)); + miljoerResponse.forEach((key, value) -> log.info("Miljø: {} XML: {}", key, value)); return miljoerResponse.entrySet().parallelStream() .collect(Collectors.toMap(Map.Entry::getKey, @@ -130,9 +130,9 @@ private String prepareRequest(List identer, boolean isProd) { "A" + "%s%s%s" .formatted(isProd ? "2" : "0", - Integer.toString(identer.size()), - identer.stream() - .map("%s"::formatted) - .collect(Collectors.joining())); + Integer.toString(identer.size()), + identer.stream() + .map("%s"::formatted) + .collect(Collectors.joining())); } } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java index feb02f5a0bf..469fdad6989 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java @@ -14,7 +14,6 @@ import no.nav.testnav.apps.tpsmessagingservice.consumer.TestmiljoerServiceConsumer; import no.nav.testnav.apps.tpsmessagingservice.consumer.command.TpsMeldingCommand; import no.nav.testnav.apps.tpsmessagingservice.dto.TpsMeldingResponse; -import no.nav.testnav.apps.tpsmessagingservice.dto.TpsServiceRutine; import no.nav.testnav.apps.tpsmessagingservice.dto.TpsServicerutineRequest; import no.nav.testnav.apps.tpsmessagingservice.dto.TpsServicerutineS610Response; import no.nav.testnav.apps.tpsmessagingservice.utils.EndringsmeldingUtil; @@ -57,8 +56,11 @@ public class PersonService { private final ObjectMapper objectMapper; private final MapperFacade mapperFacade; - public PersonService(ServicerutineConsumer servicerutineConsumer, ObjectMapper objectMapper, - MapperFacade mapperFacade, TestmiljoerServiceConsumer testmiljoerServiceConsumer) throws JAXBException { + public PersonService(ServicerutineConsumer servicerutineConsumer, + ObjectMapper objectMapper, + MapperFacade mapperFacade, + TestmiljoerServiceConsumer testmiljoerServiceConsumer) throws JAXBException { + this.servicerutineConsumer = servicerutineConsumer; this.objectMapper = objectMapper; this.mapperFacade = mapperFacade; @@ -165,7 +167,7 @@ public TpsServicerutineS610Response unmarshallFromXml(String endringsmeldingResp private Map readFromTps(String ident, List miljoer) { var request = TpsServicerutineRequest.builder() - .tpsServiceRutine(TpsServiceRutine.builder() + .tpsServiceRutine(TpsServicerutineRequest.TpsServiceRutine.builder() .serviceRutinenavn(PERSON_KERNINFO_SERVICE_ROUTINE) .fnr(ident) .aksjonsKode("D") @@ -204,6 +206,7 @@ public List getPerson(String ident, List miljoer) { var personerMedRelasjoner = buildMiljoePersonWithRelasjon(relasjoner).entrySet().stream() .map(entry -> PersonMiljoeDTO.builder() + .ident(ident) .miljoe(entry.getKey()) .status("OK") .person(entry.getValue()) diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/AdresseAppenderService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/AdresseAppenderService.java new file mode 100644 index 00000000000..3eed3029390 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/AdresseAppenderService.java @@ -0,0 +1,107 @@ +package no.nav.testnav.apps.tpsmessagingservice.service.skd; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.SkdMeldingTrans1; +import no.nav.testnav.apps.tpsmessagingservice.utils.ConvertDateToStringUtility; +import no.nav.testnav.apps.tpsmessagingservice.utils.HentDatoFraIdentUtility; +import no.nav.testnav.apps.tpsmessagingservice.utils.HusbokstavEncoder; +import no.nav.testnav.apps.tpsmessagingservice.utils.LandkodeEncoder; +import no.nav.testnav.apps.tpsmessagingservice.utils.NullcheckUtil; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.AdresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.GateadresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.MatrikkeladresseDTO; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.regex.Pattern; + +import static java.lang.String.format; +import static java.util.Objects.nonNull; +import static no.nav.testnav.apps.tpsmessagingservice.utils.HentDatoFraIdentUtility.enforceValidTpsDate; +import static org.apache.commons.lang3.StringUtils.isNotBlank; + +@Service +@RequiredArgsConstructor +public class AdresseAppenderService { + + private static final Pattern HUSNUMMER_PATTERN = Pattern.compile("(\\d+)"); + private static final Pattern HUSBOKSTAV_PATTERN = Pattern.compile("([A-ZÆØÅÁ])"); + + public void execute(SkdMeldingTrans1 skdMeldingTrans1, PersonDTO person) { + + /* Boadresse */ + if (nonNull(person.getBoadresse())) { + + if (AdresseDTO.Adressetype.GATE == person.getBoadresse().getAdressetype()) { + + var gateadresse = (GateadresseDTO) person.getBoadresse(); + skdMeldingTrans1.setAdressetype("O"); + skdMeldingTrans1.setGateGaard(fixGatekode(gateadresse.getGatekode())); + addHusBrukAndBokstavFestenr(skdMeldingTrans1, gateadresse); + skdMeldingTrans1.setAdressenavn(StringUtils.abbreviate(gateadresse.getAdresse(), 25)); + skdMeldingTrans1.setKommunenummer(gateadresse.getKommunenr()); + skdMeldingTrans1.setPostnummer(gateadresse.getPostnr()); + skdMeldingTrans1.setTilleggsadresse(gateadresse.getTilleggsadresse()); + skdMeldingTrans1.setFlyttedatoAdr(ConvertDateToStringUtility.yyyyMMdd( + enforceValidTpsDate(NullcheckUtil.nullcheckSetDefaultValue(gateadresse.getFlyttedato(), + HentDatoFraIdentUtility.extract(person.getIdent()))))); + + } else if (AdresseDTO.Adressetype.MATR == person.getBoadresse().getAdressetype()) { + + var matrikkeladresse = (MatrikkeladresseDTO) person.getBoadresse(); + skdMeldingTrans1.setAdressetype("M"); + skdMeldingTrans1.setGateGaard(prepad(matrikkeladresse.getGardsnr(), 5)); + skdMeldingTrans1.setHusBruk(prepad(matrikkeladresse.getBruksnr(), 4)); + skdMeldingTrans1.setAdressenavn(matrikkeladresse.getMellomnavn()); + skdMeldingTrans1.setKommunenummer(matrikkeladresse.getKommunenr()); + skdMeldingTrans1.setPostnummer(matrikkeladresse.getPostnr()); + skdMeldingTrans1.setTilleggsadresse(matrikkeladresse.getTilleggsadresse()); + skdMeldingTrans1.setFlyttedatoAdr(ConvertDateToStringUtility.yyyyMMdd( + enforceValidTpsDate(NullcheckUtil.nullcheckSetDefaultValue(matrikkeladresse.getFlyttedato(), + HentDatoFraIdentUtility.extract(person.getIdent()))))); + } + + } else { + skdMeldingTrans1.setFlyttedatoAdr(ConvertDateToStringUtility.yyyyMMdd(enforceValidTpsDate( + HentDatoFraIdentUtility.extract(person.getIdent())))); + } + + /* Postadresse */ + if (nonNull(person.getPostadresse())) { + + var postadresse = person.getPostadresse(); + skdMeldingTrans1.setPostadresse1(postadresse.getPostLinje1()); + skdMeldingTrans1.setPostadresse2(postadresse.getPostLinje2()); + skdMeldingTrans1.setPostadresse3(postadresse.getPostLinje3()); + skdMeldingTrans1.setPostadresseLand(LandkodeEncoder.encode(postadresse.getPostLand())); + } + } + + private static String fixGatekode(String gatekode) { + + return format("%05d", isNotBlank(gatekode) ? Integer.parseInt(gatekode) : 0); + } + + private static String prepad(String value, int length) { + + var formatter = "%1$" + length + 's'; + return format(formatter, nonNull(value) ? value : '0').replace(' ', '0'); + } + + private void addHusBrukAndBokstavFestenr(SkdMeldingTrans1 skdMeldingTrans1, GateadresseDTO gateadresse) { + + if (isNotBlank(gateadresse.getHusnummer())) { + + var husbokstavMatcher = HUSBOKSTAV_PATTERN.matcher(gateadresse.getHusnummer()); + var husnummerMatcher = HUSNUMMER_PATTERN.matcher(gateadresse.getHusnummer()); + + if (husbokstavMatcher.find()) { + skdMeldingTrans1.setBokstavFestenr(HusbokstavEncoder.encode(husbokstavMatcher.group(1))); + } + if (husnummerMatcher.find()) { + skdMeldingTrans1.setHusBruk(husnummerMatcher.group(1)); + } + } + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/DoedsmeldingAnnulleringBuilderService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/DoedsmeldingAnnulleringBuilderService.java new file mode 100644 index 00000000000..780b7ff4cff --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/DoedsmeldingAnnulleringBuilderService.java @@ -0,0 +1,54 @@ +package no.nav.testnav.apps.tpsmessagingservice.service.skd; + +import no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.SkdMeldingTrans1; +import no.nav.testnav.apps.tpsmessagingservice.utils.ConvertDateToStringUtility; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +public class DoedsmeldingAnnulleringBuilderService { + + private static final String AARSAKS_KO_DE_FOR_DOEDSMELDING = "45"; + private static final String TRANSTYPE_FOR_DOEDSMELDING = "1"; + private static final String STATUS_KO_DE_FOR_DOEDSMELDING = "1"; + private static final String TILDELINGS_KO_DE_DOEDSMELDING_ANNULERING = "0"; + + @Autowired + private AdresseAppenderService adresseAppenderService; + + public SkdMeldingTrans1 execute(PersonDTO person) { + + var skdMeldingTrans1 = new SkdMeldingTrans1(); + skdMeldingTrans1.setTildelingskode(TILDELINGS_KO_DE_DOEDSMELDING_ANNULERING); + + addSkdParametersExtractedFromPerson(skdMeldingTrans1, person); + adresseAppenderService.execute(skdMeldingTrans1, person); + addDefaultParam(skdMeldingTrans1); + + return skdMeldingTrans1; + } + + private void addSkdParametersExtractedFromPerson(SkdMeldingTrans1 skdMeldingTrans1, PersonDTO person) { + + skdMeldingTrans1.setFodselsdato(person.getIdent().substring(0, 6)); + skdMeldingTrans1.setPersonnummer(person.getIdent().substring(6, 11)); + + var yyyyMMdd = ConvertDateToStringUtility.yyyyMMdd(LocalDateTime.now()); + var hhMMss = ConvertDateToStringUtility.hhMMss(LocalDateTime.now()); + + skdMeldingTrans1.setMaskintid(hhMMss); + skdMeldingTrans1.setMaskindato(yyyyMMdd); + + skdMeldingTrans1.setRegDato(yyyyMMdd); + } + + private void addDefaultParam(SkdMeldingTrans1 skdMeldingTrans1) { + + skdMeldingTrans1.setAarsakskode(AARSAKS_KO_DE_FOR_DOEDSMELDING); + skdMeldingTrans1.setTranstype(TRANSTYPE_FOR_DOEDSMELDING); + skdMeldingTrans1.setStatuskode(STATUS_KO_DE_FOR_DOEDSMELDING); + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/DoedsmeldingBuilderService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/DoedsmeldingBuilderService.java new file mode 100644 index 00000000000..9021c61b7ee --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/DoedsmeldingBuilderService.java @@ -0,0 +1,52 @@ +package no.nav.testnav.apps.tpsmessagingservice.service.skd; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.SkdMeldingTrans1; +import no.nav.testnav.apps.tpsmessagingservice.utils.ConvertDateToStringUtility; +import no.nav.testnav.apps.tpsmessagingservice.utils.IdenttypeFraIdentUtility; +import no.nav.testnav.libs.data.pdlforvalter.v1.Identtype; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.DoedsmeldingRequest; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +@RequiredArgsConstructor +public class DoedsmeldingBuilderService { + + private static final String AARSAKSKODE_FOR_DOEDSMELDING = "43"; + private static final String TRANSTYPE_FOR_DOEDSMELDING = "1"; + private static final String STATUSKODE_FNR = "5"; + private static final String STATUSKODE_DNR = "2"; + private static final String TILDELINGSKODE_DOEDSMELDING = "0"; + + public SkdMeldingTrans1 build(DoedsmeldingRequest request) { + + var skdMeldingTrans1 = new SkdMeldingTrans1(); + skdMeldingTrans1.setTildelingskode(TILDELINGSKODE_DOEDSMELDING); + + addSkdParametersExtractedFromPerson(skdMeldingTrans1, request); + + return skdMeldingTrans1; + } + + private void addSkdParametersExtractedFromPerson(SkdMeldingTrans1 skdMeldingTrans1, DoedsmeldingRequest request) { + + skdMeldingTrans1.setFodselsdato(request.getIdent().substring(0, 6)); + skdMeldingTrans1.setPersonnummer(request.getIdent().substring(6, 11)); + + var datoDoed = ConvertDateToStringUtility.yyyyMMdd(request.getDoedsdato().atStartOfDay()); + + skdMeldingTrans1.setMaskintid(ConvertDateToStringUtility.hhMMss(LocalDateTime.now())); + skdMeldingTrans1.setMaskindato(ConvertDateToStringUtility.yyyyMMdd(LocalDateTime.now())); + + // The specification for doedsmelding says reg-dato should be doedsdato + skdMeldingTrans1.setRegDato(datoDoed); + skdMeldingTrans1.setDatoDoed(datoDoed); + + skdMeldingTrans1.setAarsakskode(AARSAKSKODE_FOR_DOEDSMELDING); + skdMeldingTrans1.setStatuskode(Identtype.FNR == IdenttypeFraIdentUtility.getIdenttype(request.getIdent()) ? + STATUSKODE_FNR : STATUSKODE_DNR); + skdMeldingTrans1.setTranstype(TRANSTYPE_FOR_DOEDSMELDING); + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/FoedselsmeldingBuilderService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/FoedselsmeldingBuilderService.java new file mode 100644 index 00000000000..a6bb9a98566 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/FoedselsmeldingBuilderService.java @@ -0,0 +1,107 @@ +package no.nav.testnav.apps.tpsmessagingservice.service.skd; + +import lombok.RequiredArgsConstructor; +import no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.SkdMeldingTrans1; +import no.nav.testnav.apps.tpsmessagingservice.utils.ConvertDateToStringUtility; +import no.nav.testnav.apps.tpsmessagingservice.utils.HentDatoFraIdentUtility; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.FoedselsmeldingRequest; +import no.nav.testnav.libs.data.tpsmessagingservice.v1.PersonDTO; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ResponseStatusException; + +import java.time.LocalDateTime; + +import static java.util.Objects.isNull; +import static java.util.Objects.nonNull; + +@Service +@RequiredArgsConstructor +public class FoedselsmeldingBuilderService { + + private static final String AARSAKSKODE_FOR_FOEDSELSMELDING = "01"; + private static final String TILDELINGSKODE_FOEDSELSMELDING = "0"; + + private final AdresseAppenderService adresseAppenderService; + + public SkdMeldingTrans1 build(FoedselsmeldingRequest request) { + + var skdMeldingTrans1 = new SkdMeldingTrans1(); + skdMeldingTrans1.setTildelingskode(TILDELINGSKODE_FOEDSELSMELDING); + + addSkdParametersExtractedFromPerson(skdMeldingTrans1, request.getBarn()); + addSkdParametersExtractedFromForeldre(skdMeldingTrans1, request); + addDefaultParam(skdMeldingTrans1); + + return skdMeldingTrans1; + } + + private void addSkdParametersExtractedFromPerson(SkdMeldingTrans1 skdMeldingTrans1, PersonDTO barn) { + + var regdato = ConvertDateToStringUtility.yyyyMMdd(HentDatoFraIdentUtility.extract(barn.getIdent())); + + skdMeldingTrans1.setFodselsdato(getDato(barn)); + skdMeldingTrans1.setPersonnummer(getPersonnr(barn)); + + skdMeldingTrans1.setMaskintid("000000"); + skdMeldingTrans1.setMaskindato(ConvertDateToStringUtility.yyyyMMdd(LocalDateTime.now())); + skdMeldingTrans1.setRegDato(regdato); + + skdMeldingTrans1.setFoedekommLand("0301"); + skdMeldingTrans1.setFoedested("Sykehus"); + + skdMeldingTrans1.setFornavn(barn.getFornavn()); + skdMeldingTrans1.setSlektsnavn(barn.getEtternavn()); + skdMeldingTrans1.setKjoenn(barn.getKjonn()); + + skdMeldingTrans1.setRegdatoAdr(regdato); + skdMeldingTrans1.setPersonkode("3"); + skdMeldingTrans1.setLevendeDoed("1"); + skdMeldingTrans1.setStatuskode("1"); + + skdMeldingTrans1.setSpesRegType(barn.getSpesreg()); + skdMeldingTrans1.setDatoSpesRegType(regdato); + } + + private void addSkdParametersExtractedFromForeldre(SkdMeldingTrans1 skdMeldingTrans1, FoedselsmeldingRequest request) { + + if (isNull(request.getMor())) { + throw new ResponseStatusException(HttpStatus.BAD_REQUEST, request.getBarn().getIdent() + " mangler en mor i fødselsmeldingen."); + } + + skdMeldingTrans1.setMorsFodselsdato(getDato(request.getMor())); + skdMeldingTrans1.setMorsPersonnummer(getPersonnr(request.getMor())); + skdMeldingTrans1.setSlektsnavn(request.getBarn().getEtternavn()); + skdMeldingTrans1.setFamilienummer(request.getMor().getIdent()); + skdMeldingTrans1.setRegdatoFamnr( + ConvertDateToStringUtility.yyyyMMdd(HentDatoFraIdentUtility.extract(request.getBarn().getIdent()))); + + if (nonNull(request.getFar())) { + skdMeldingTrans1.setForeldreansvar("D"); + skdMeldingTrans1.setFarsFodselsdato(getDato(request.getFar())); + skdMeldingTrans1.setFarsPersonnummer(getPersonnr(request.getFar())); + } else { + skdMeldingTrans1.setForeldreansvar("M"); + } + skdMeldingTrans1.setDatoForeldreansvar( + ConvertDateToStringUtility.yyyyMMdd(HentDatoFraIdentUtility.extract(request.getBarn().getIdent()))); + + adresseAppenderService.execute(skdMeldingTrans1, request.getBarn()); + } + + private void addDefaultParam(SkdMeldingTrans1 skdMeldingTrans1) { + skdMeldingTrans1.setSivilstand("1"); + skdMeldingTrans1.setTranstype("1"); + skdMeldingTrans1.setAarsakskode(AARSAKSKODE_FOR_FOEDSELSMELDING); + } + + private String getPersonnr(PersonDTO person) { + + return person.getIdent().substring(6, 11); + } + + private static String getDato(PersonDTO person) { + + return person.getIdent().substring(0, 6); + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/SendSkdMeldinger.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/SendSkdMeldinger.java new file mode 100644 index 00000000000..1255eb6cf73 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/skd/SendSkdMeldinger.java @@ -0,0 +1,40 @@ +package no.nav.testnav.apps.tpsmessagingservice.service.skd; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.testnav.apps.tpsmessagingservice.consumer.EndringsmeldingConsumer; +import no.nav.testnav.apps.tpsmessagingservice.consumer.command.TpsMeldingCommand; +import no.nav.testnav.apps.tpsmessagingservice.dto.endringsmeldinger.SkdMeldingsheader; +import org.springframework.http.HttpStatus; +import org.springframework.jms.JmsException; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ResponseStatusException; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Service +@RequiredArgsConstructor +public class SendSkdMeldinger { + + private final EndringsmeldingConsumer endringsmeldingConsumer; + + public Map sendMeldinger(String skdMelding, List environments) { + + try { + var skdMeldingMedHeader = SkdMeldingsheader.appendHeader(skdMelding); + log.info("SKD-melding til miljøer {} {}", environments, skdMeldingMedHeader); + + return endringsmeldingConsumer.sendMessage(skdMeldingMedHeader, environments) + .entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, respone -> respone.getValue() + .replace(TpsMeldingCommand.NO_RESPONSE, "FEIL: TPS svarer ikke"))); + + } catch (JmsException jmsException) { + log.error(jmsException.getMessage(), jmsException); + throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, jmsException.getMessage()); + } + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ConvertDateToStringUtility.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ConvertDateToStringUtility.java new file mode 100644 index 00000000000..fd043e40321 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ConvertDateToStringUtility.java @@ -0,0 +1,25 @@ +package no.nav.testnav.apps.tpsmessagingservice.utils; + +import lombok.experimental.UtilityClass; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +import static java.util.Objects.nonNull; + +@UtilityClass +public final class ConvertDateToStringUtility { + + private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyyMMdd"); + private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("HHmmss"); + + public static String yyyyMMdd(LocalDateTime localDateTime) { + + return nonNull(localDateTime) ? localDateTime.format(DATE_FORMAT) : null; + } + + public static String hhMMss(LocalDateTime localDateTime) { + + return nonNull(localDateTime) ? localDateTime.format(TIME_FORMAT) : null; + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/HentDatoFraIdentUtility.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/HentDatoFraIdentUtility.java new file mode 100644 index 00000000000..b7235aac145 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/HentDatoFraIdentUtility.java @@ -0,0 +1,63 @@ +package no.nav.testnav.apps.tpsmessagingservice.utils; + +import lombok.experimental.UtilityClass; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +import static java.lang.Integer.parseInt; +import static java.time.LocalDateTime.of; +import static java.util.Objects.isNull; + +/** + * INDIVID(POS 7-9) 500-749 OG ÅR > 54 => ÅRHUNDRE = 1800 + * INDIVID(POS 7-9) 000-499 => ÅRHUNDRE = 1900 + * INDIVID(POS 7-9) 900-999 OG ÅR > 39 => ÅRHUNDRE = 1900 + * INDIVID(POS 7-9) 500-999 OG ÅR < 40 => ÅRHUNDRE = 2000 + */ +@UtilityClass +public class HentDatoFraIdentUtility { + + private static final LocalDateTime TPS_MIN_REG_DATE = of(1900, 1, 1, 0, 0); + + public static LocalDateTime extract(String ident) { + + int year = parseInt(ident.substring(4, 6)); + int individ = parseInt(ident.substring(6, 9)); + + // Find century + int century; + if (parseInt(ident.substring(6, 10)) == 0) { + century = year <= LocalDate.now().getYear() % 100 ? 2000 : 1900; + } else if (individ < 500 || (individ >= 900 && year > 39)) { + century = 1900; + } else if (individ >= 500 && year < 40) { + century = 2000; + } else if (individ >= 500 && individ < 750 && year > 54) { + century = 1800; + } else { + century = 2000; + } + + return LocalDateTime.of(century + year, getMonth(ident), getDay(ident), 0, 0); + } + + public static LocalDateTime enforceValidTpsDate(LocalDateTime date) { + + if (isNull(date)) { + return null; + } else { + return date.isBefore(TPS_MIN_REG_DATE) ? TPS_MIN_REG_DATE : date; + } + } + + private int getDay(String ident) { + + return parseInt(ident.substring(0, 2)) % 40; + } + + private int getMonth(String ident) { + + return parseInt(ident.substring(2, 4)) % 20; + } +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/HusbokstavEncoder.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/HusbokstavEncoder.java new file mode 100644 index 00000000000..de77844c525 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/HusbokstavEncoder.java @@ -0,0 +1,50 @@ +package no.nav.testnav.apps.tpsmessagingservice.utils; + +import lombok.experimental.UtilityClass; + +import java.util.HashMap; +import java.util.Map; + +@UtilityClass +public class HusbokstavEncoder { + + private static final Map encodingMap; + static { + encodingMap = new HashMap<>(); + encodingMap.put("A", "9901"); + encodingMap.put("B", "9902"); + encodingMap.put("C", "9903"); + encodingMap.put("D", "9904"); + encodingMap.put("E", "9905"); + encodingMap.put("F", "9906"); + encodingMap.put("G", "9907"); + encodingMap.put("H", "9908"); + encodingMap.put("I", "9909"); + encodingMap.put("J", "9910"); + encodingMap.put("K", "9911"); + encodingMap.put("L", "9912"); + encodingMap.put("M", "9913"); + encodingMap.put("N", "9914"); + encodingMap.put("O", "9915"); + encodingMap.put("P", "9916"); + encodingMap.put("Q", "9917"); + encodingMap.put("R", "9918"); + encodingMap.put("S", "9919"); + encodingMap.put("T", "9920"); + encodingMap.put("U", "9921"); + encodingMap.put("V", "9922"); + encodingMap.put("W", "9923"); + encodingMap.put("X", "9924"); + encodingMap.put("Y", "9925"); + encodingMap.put("Z", "9926"); + encodingMap.put("Æ", "9927"); + encodingMap.put("Ø", "9928"); + encodingMap.put("Å", "9929"); + encodingMap.put("Á", "9930"); + } + + public static String encode(String husbokstav) { + return encodingMap.get(husbokstav); + } + +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/IdenttypeFraIdentUtility.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/IdenttypeFraIdentUtility.java new file mode 100644 index 00000000000..34a489158ec --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/IdenttypeFraIdentUtility.java @@ -0,0 +1,24 @@ +package no.nav.testnav.apps.tpsmessagingservice.utils; + +import lombok.experimental.UtilityClass; +import no.nav.testnav.libs.data.pdlforvalter.v1.Identtype; + +import static java.lang.Integer.parseInt; +import static no.nav.testnav.libs.data.pdlforvalter.v1.Identtype.DNR; +import static no.nav.testnav.libs.data.pdlforvalter.v1.Identtype.FNR; +import static no.nav.testnav.libs.data.pdlforvalter.v1.Identtype.NPID; + +@UtilityClass +public class IdenttypeFraIdentUtility { + + public static Identtype getIdenttype(String ident) { + + if (parseInt(ident.substring(2, 3)) % 4 >= 2) { + return NPID; + } else if (parseInt(ident.substring(0, 1)) >= 4) { + return DNR; + } else { + return FNR; + } + } +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/LandkodeEncoder.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/LandkodeEncoder.java new file mode 100644 index 00000000000..e30b0473319 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/LandkodeEncoder.java @@ -0,0 +1,302 @@ +package no.nav.testnav.apps.tpsmessagingservice.utils; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.UtilityClass; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + +import static java.time.LocalDateTime.of; + +@UtilityClass +public class LandkodeEncoder { + + private static final LocalDateTime START_OF_ERA = of(1800, 1, 1, 0, 0); + private static final LocalDateTime FORESEEABLE_FUTURE = of(9999, 12, 31, 0, 0); + + private static final Map landkoderMap = new HashMap<>(); + + private static final LandDetails DEFAULT = new LandDetails("990", START_OF_ERA, FORESEEABLE_FUTURE); + + static { //NOSONAR + landkoderMap.put("???", DEFAULT); + landkoderMap.put("ABW", new LandDetails("657", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("AFG", new LandDetails("404", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("AGO", new LandDetails("204", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("AIA", new LandDetails("660", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ALB", new LandDetails("111", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("AND", new LandDetails("114", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ANT", new LandDetails("656", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ARE", new LandDetails("426", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ARG", new LandDetails("705", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ARM", new LandDetails("406", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ASM", new LandDetails("802", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ATF", new LandDetails("628", START_OF_ERA, of(2000, 1, 1, 0, 0))); + landkoderMap.put("ATG", new LandDetails("603", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("AUS", new LandDetails("805", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("AUT", new LandDetails("153", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("AZE", new LandDetails("407", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BDI", new LandDetails("216", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BEL", new LandDetails("112", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BEN", new LandDetails("229", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BES", new LandDetails("659", of(2011, 12, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("BFA", new LandDetails("393", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BGD", new LandDetails("410", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BGR", new LandDetails("113", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BHR", new LandDetails("409", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BHS", new LandDetails("605", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BIH", new LandDetails("155", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BLM", new LandDetails("687", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BLR", new LandDetails("120", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BLZ", new LandDetails("604", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BMU", new LandDetails("606", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BOL", new LandDetails("710", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BRA", new LandDetails("715", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BRB", new LandDetails("602", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BRN", new LandDetails("416", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BTN", new LandDetails("412", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BVT", new LandDetails("875", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("BWA", new LandDetails("205", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CAF", new LandDetails("337", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CAN", new LandDetails("612", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CCK", new LandDetails("808", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CHE", new LandDetails("141", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CHL", new LandDetails("725", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CHN", new LandDetails("484", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CIV", new LandDetails("239", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CMR", new LandDetails("270", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("COD", new LandDetails("279", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("COG", new LandDetails("278", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("COK", new LandDetails("809", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("COL", new LandDetails("730", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("COM", new LandDetails("220", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CPV", new LandDetails("273", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CRI", new LandDetails("616", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CSK", new LandDetails("142", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CUB", new LandDetails("620", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CUW", new LandDetails("661", of(2011, 12, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("CXR", new LandDetails("807", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CYM", new LandDetails("613", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CYP", new LandDetails("500", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("CZE", new LandDetails("158", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("DDR", new LandDetails("151", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("DEU", new LandDetails("144", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("DJI", new LandDetails("250", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("DMA", new LandDetails("622", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("DNK", new LandDetails("101", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("DOM", new LandDetails("624", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("DZA", new LandDetails("203", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ECU", new LandDetails("735", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("EGY", new LandDetails("249", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ERI", new LandDetails("241", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ESH", new LandDetails("304", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ESP", new LandDetails("137", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("EST", new LandDetails("115", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ETH", new LandDetails("246", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("FIN", new LandDetails("103", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("FJI", new LandDetails("811", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("FLK", new LandDetails("740", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("FRA", new LandDetails("117", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("FRO", new LandDetails("104", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("FSM", new LandDetails("826", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GAB", new LandDetails("254", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GBR", new LandDetails("139", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GEO", new LandDetails("430", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GGY", new LandDetails("162", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GHA", new LandDetails("260", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GIB", new LandDetails("118", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GIN", new LandDetails("264", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GLP", new LandDetails("631", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GMB", new LandDetails("256", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GNB", new LandDetails("266", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GNQ", new LandDetails("235", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GRC", new LandDetails("119", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GRD", new LandDetails("629", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GRL", new LandDetails("102", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GTM", new LandDetails("632", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GUF", new LandDetails("745", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GUM", new LandDetails("817", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("GUY", new LandDetails("720", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("HKG", new LandDetails("436", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("HMD", new LandDetails("870", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("HND", new LandDetails("644", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("HRV", new LandDetails("122", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("HTI", new LandDetails("636", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("HUN", new LandDetails("152", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("IDN", new LandDetails("448", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("IMN", new LandDetails("164", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("IND", new LandDetails("444", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("IOT", new LandDetails("213", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("IRL", new LandDetails("121", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("IRN", new LandDetails("456", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("IRQ", new LandDetails("452", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ISL", new LandDetails("105", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ISR", new LandDetails("460", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ITA", new LandDetails("123", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("JAM", new LandDetails("648", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("JEY", new LandDetails("163", of(2011, 12, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("JOR", new LandDetails("476", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("JPN", new LandDetails("464", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KAZ", new LandDetails("480", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KEN", new LandDetails("276", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KGZ", new LandDetails("502", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KHM", new LandDetails("478", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KIR", new LandDetails("815", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KNA", new LandDetails("677", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KOR", new LandDetails("492", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("KWT", new LandDetails("496", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LAO", new LandDetails("504", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LBN", new LandDetails("508", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LBR", new LandDetails("283", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LBY", new LandDetails("286", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LCA", new LandDetails("678", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LIE", new LandDetails("128", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LKA", new LandDetails("424", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LSO", new LandDetails("281", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LTU", new LandDetails("136", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LUX", new LandDetails("129", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("LVA", new LandDetails("124", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MAC", new LandDetails("510", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MAF", new LandDetails("686", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MAR", new LandDetails("303", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MCO", new LandDetails("130", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MDA", new LandDetails("138", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MDG", new LandDetails("289", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MDV", new LandDetails("513", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MEX", new LandDetails("652", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MHL", new LandDetails("835", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MKD", new LandDetails("156", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MLI", new LandDetails("299", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MLT", new LandDetails("126", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MMR", new LandDetails("420", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MNE", new LandDetails("160", of(2006, 11, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("MNG", new LandDetails("516", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MNP", new LandDetails("840", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MOZ", new LandDetails("319", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MRT", new LandDetails("306", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MSR", new LandDetails("654", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MTQ", new LandDetails("650", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MUS", new LandDetails("307", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MWI", new LandDetails("296", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MYS", new LandDetails("512", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("MYT", new LandDetails("322", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NAM", new LandDetails("308", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NCL", new LandDetails("833", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NER", new LandDetails("309", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NFK", new LandDetails("822", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NGA", new LandDetails("313", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NIC", new LandDetails("664", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NIU", new LandDetails("821", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NLD", new LandDetails("127", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NOR", new LandDetails("000", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NPL", new LandDetails("528", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NRU", new LandDetails("818", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("NZL", new LandDetails("820", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("OMN", new LandDetails("520", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PAK", new LandDetails("534", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PAN", new LandDetails("668", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PCN", new LandDetails("828", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PER", new LandDetails("760", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PHL", new LandDetails("428", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PLW", new LandDetails("839", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PNG", new LandDetails("827", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("POL", new LandDetails("131", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PRI", new LandDetails("685", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PRK", new LandDetails("488", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PRT", new LandDetails("132", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PRY", new LandDetails("755", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PSE", new LandDetails("524", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("PYF", new LandDetails("814", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("QAT", new LandDetails("540", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("REU", new LandDetails("323", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ROU", new LandDetails("133", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("RUS", new LandDetails("140", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("RWA", new LandDetails("329", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SAU", new LandDetails("544", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SCG", new LandDetails("125", of(1994, 1, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("SDN", new LandDetails("356", of(2011, 12, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("SEN", new LandDetails("336", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SGP", new LandDetails("548", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SGS", new LandDetails("865", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SHN", new LandDetails("209", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SJM", new LandDetails("744", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SLB", new LandDetails("806", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SLE", new LandDetails("339", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SLV", new LandDetails("672", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SMR", new LandDetails("134", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SOM", new LandDetails("346", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SPM", new LandDetails("676", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SRB", new LandDetails("159", of(2006, 11, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("SSD", new LandDetails("355", of(2011,12,1,0,0), FORESEEABLE_FUTURE)); + landkoderMap.put("STP", new LandDetails("333", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SUN", new LandDetails("135", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SUR", new LandDetails("765", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SVK", new LandDetails("157", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SVN", new LandDetails("146", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SWE", new LandDetails("106", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SWZ", new LandDetails("357", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SXM", new LandDetails("658", of(2011, 12, 1, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("SYC", new LandDetails("338", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("SYR", new LandDetails("564", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TCA", new LandDetails("681", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TCD", new LandDetails("373", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TGO", new LandDetails("376", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("THA", new LandDetails("568", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TJK", new LandDetails("550", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TKL", new LandDetails("829", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TKM", new LandDetails("552", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TLS", new LandDetails("537", of(2002, 5, 20, 0, 0), FORESEEABLE_FUTURE)); + landkoderMap.put("TON", new LandDetails("813", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TTO", new LandDetails("680", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TUN", new LandDetails("379", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TUR", new LandDetails("143", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TUV", new LandDetails("816", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TWN", new LandDetails("432", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("TZA", new LandDetails("369", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("UGA", new LandDetails("386", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("UKR", new LandDetails("148", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("UMI", new LandDetails("819", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("URY", new LandDetails("770", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("USA", new LandDetails("684", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("UZB", new LandDetails("554", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("VAT", new LandDetails("154", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("VCT", new LandDetails("679", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("VEN", new LandDetails("775", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("VGB", new LandDetails("608", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("VIR", new LandDetails("601", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("VNM", new LandDetails("575", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("VUT", new LandDetails("812", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("WAK", new LandDetails("831", START_OF_ERA, of(2001, 1, 1, 0, 0))); + landkoderMap.put("WLF", new LandDetails("832", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("WSM", new LandDetails("830", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("XXK", new LandDetails("161", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("XXX", new LandDetails("980", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("YEM", new LandDetails("578", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("YUG", new LandDetails("925", of(1944, 1, 1, 0, 0), of(2003, 11, 30, 0, 0))); + landkoderMap.put("ZAF", new LandDetails("359", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ZMB", new LandDetails("389", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("ZWE", new LandDetails("326", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("349", new LandDetails("349", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("546", new LandDetails("546", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("556", new LandDetails("556", START_OF_ERA, FORESEEABLE_FUTURE)); + landkoderMap.put("669", new LandDetails("669", START_OF_ERA, FORESEEABLE_FUTURE)); + } + + public String encode(String statsborgerskap) { + return landkoderMap.getOrDefault(statsborgerskap, DEFAULT).getTpsCode(); + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + static class LandDetails { + private String tpsCode; + private LocalDateTime fom; + private LocalDateTime tom; + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/NullcheckUtil.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/NullcheckUtil.java new file mode 100644 index 00000000000..5d648969c98 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/NullcheckUtil.java @@ -0,0 +1,13 @@ +package no.nav.testnav.apps.tpsmessagingservice.utils; + +import lombok.experimental.UtilityClass; + +import static java.util.Objects.nonNull; + +@UtilityClass +public final class NullcheckUtil { + + public static T nullcheckSetDefaultValue(T value, T defaultValue) { + return nonNull(value) ? value : defaultValue; + } +} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ResponseStatus.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ResponseStatus.java new file mode 100644 index 00000000000..26982ecef2c --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ResponseStatus.java @@ -0,0 +1,37 @@ +package no.nav.testnav.apps.tpsmessagingservice.utils; + +import lombok.experimental.UtilityClass; +import no.nav.testnav.apps.tpsmessagingservice.dto.TpsMeldingResponse; + +import static java.lang.String.format; +import static java.util.Objects.nonNull; + +@UtilityClass +public final class ResponseStatus { + + public static String extract(String status) { + + if (nonNull(status) && status.contains("FEIL")) { + return status; + } else if (nonNull(status) && status.length() > 3) { + return format("FEIL: %s", status.substring(3).replaceAll("\\d*%[A-Z]\\d*%", "").replaceAll("%; *", "")); + } else { + return "STATUS: TIDSAVBRUDD"; + } + } + + public static TpsMeldingResponse decodeStatus(TpsMeldingResponse response) { + + return nonNull(response) ? + TpsMeldingResponse.builder() + .returStatus("00".equals(response.getReturStatus()) || "04".equals(response.getReturStatus()) ? "OK" : "FEIL") + .returMelding(response.getReturMelding()) + .utfyllendeMelding(response.getUtfyllendeMelding()) + .build() : + TpsMeldingResponse.builder() + .returStatus("FEIL") + .returMelding("Ingen data") + .utfyllendeMelding("Melding fra TPS er tom") + .build(); + } +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java index 5833499e2f0..185b689203f 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java @@ -1,22 +1,22 @@ package no.nav.testnav.apps.tpsmessagingservice.utils; +import jakarta.xml.bind.JAXBContext; import lombok.SneakyThrows; import lombok.experimental.UtilityClass; -import no.nav.testnav.apps.tpsmessagingservice.dto.TpsServicerutineRequest; +import no.nav.testnav.apps.tpsmessagingservice.dto.TpsRequest; -import jakarta.xml.bind.JAXBContext; import java.io.StringWriter; @UtilityClass public class ServiceRutineUtil { @SneakyThrows - public static String marshallToXML(JAXBContext requestContext, TpsServicerutineRequest endringsmelding) { + public static String marshallToXML(JAXBContext requestContext, TpsRequest melding) { var marshaller = requestContext.createMarshaller(); var writer = new StringWriter(); - marshaller.marshal(endringsmelding, writer); + marshaller.marshal(melding, writer); return writer.toString(); } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/TranslittereringUtil.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/TranslittereringUtil.java deleted file mode 100644 index 8e6383d5fbb..00000000000 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/TranslittereringUtil.java +++ /dev/null @@ -1,131 +0,0 @@ -package no.nav.testnav.apps.tpsmessagingservice.utils; - -import com.ibm.icu.text.Transliterator; -import lombok.experimental.UtilityClass; -import lombok.val; - -import java.text.Normalizer; -import java.util.Map; -import java.util.regex.Pattern; - -import static java.util.Map.Entry; -import static java.util.Map.entry; -import static java.util.Map.ofEntries; -import static java.util.Objects.isNull; - -@UtilityClass -public class TranslittereringUtil { - - private final String LATIN_CYRILLIC = "Latin-Russian/BGN"; - private final Transliterator cyrillicToLatinTrans = Transliterator.getInstance(LATIN_CYRILLIC).getInverse(); - - private final Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+"); - - private final Map PRINTABLE_BY_NON_PRINTABLE = ofEntries( - entry('å', '\u0001'), - entry('Å', '\u0002'), - entry('ä', '\u0003'), - entry('Ä', '\u0004'), - entry('é', '\u0005'), - entry('É', '\u0006'), - entry('è', '\u0007'), - entry('È', '\u0008'), - entry('ö', '\u000B'), - entry('Ö', '\u0010'), - entry('ü', '\u0011'), - entry('Ü', '\u0012') - ); - - /** - * Implementerer følgende regler: - *
    - *
  • {@code äöü éè æøå ÄÖÜ ÉÈ ÆØÅ} forblir uendret
  • - *
  • Folkeregisterets regler for translitterering mot DSF https://confluence.adeo.no/download/attachments/229949696/Regler%20for%20translitterering.docx
  • - *
  • DIFI sin erstatningstabell for samiske tegn https://www.difi.no/fagomrader-og-tjenester/digitalisering-og-samordning/standarder/forslag-og-utredninger/hvorfor-felles-tegnsett#Erstatningstabell
  • - *
  • Bokstavene i Unicode Basic Latin (ISO 8859-1) og noen enkeltbokstaver i Latin Extended-A og Extended-B
  • - *
- * Spesialregler for å håndtere tegn utover overstående regelsett blir laget for hvert enkelt tilfelle, se {@code convertKnownCharactersNotHandledByNormalization()}. - * Resten ignoreres/bevares. Se read-me for detaljer.
- */ - public String translitterer(String str) { - - if (isNull(str)) { - return null; - } - - final var prepared = preprocess(str); - final var normalized = pattern.matcher(Normalizer.normalize(prepared, Normalizer.Form.NFD)).replaceAll(""); - final var processed = postprocess(normalized); - String text = convertKnownCharactersNotHandledByNormalization(processed); - return cyrillicToLatinTrans.transliterate(text); - } - - private String preprocess(String str) { - // replace wanted characters with non-printable characters to save them from normalization - for (Entry entry : PRINTABLE_BY_NON_PRINTABLE.entrySet()) { - - var original = entry.getKey(); - var nonPrintable = entry.getValue(); - str = str.replace(nonPrintable.toString(), ""); - str = str.replace(original, nonPrintable); - } - return str; - } - - private String postprocess(String str) { - // replace non-printable characters with original characters after normalization - for (Entry entry : PRINTABLE_BY_NON_PRINTABLE.entrySet()) { - var original = entry.getKey(); - var nonPrintable = entry.getValue(); - str = str.replace(nonPrintable, original); - } - return str; - } - - private String convertKnownCharactersNotHandledByNormalization(String str) { - // replace characters not covered by normalization - return str - .replace('\u0189', 'D') // 'Ɖ' Afrikansk D - .replace('\u0256', 'd') // 'ɖ' Liten afrikansk d med hale - .replace('\u00D0', 'D') // 'Ð' Stor eth (islandsk) - .replace('\u00F0', 'd') // 'ð' Liten eth - .replace('\u0110', 'D') // 'Đ' Stor D med strek (samisk, slavisk, vietnamesisk, mf.) - .replace('\u0111', 'd') // 'đ' Liten d med strek - .replace('\u01E4', 'G') // 'Ǥ' Stor G med strek (samisk) - .replace('\u01E5', 'g') // Liten g med strek (samisk) - .replace('ı', 'i') // LATIN SMALL LETTER DOTLESS I U+0131 - .replace('Ł', 'L') - .replace('ł', 'l') - .replace('Ŋ', 'N') - .replace('ŋ', 'n') - .replace('Ŧ', 'T') - .replace('ŧ', 't') - .replace('Ɓ', 'B') // B med krok - .replace('ɓ', 'b') // b med krok - .replace('\u0187', 'C') // C med krok - .replace('\u0188', 'c') // c med krok - .replace('Ɗ', 'D') // D med krok - .replace('ɗ', 'd') // d med krok - .replace('Ɠ', 'G') // G med krok - .replace('ɠ', 'g') // g med krok - .replace('Ƙ', 'K') // K med krok - .replace('ƙ', 'k') // k med krok - .replace('Ƥ', 'P') // P med krok - .replace('ƥ', 'p') // p med krok - .replace('Ƭ', 'T') // T med krok - .replace('ƭ', 't') // t med krok - .replace('\u01B3', 'Y') // 'Ƴ', Y med krok U+01B3 - .replace('\u01B4', 'y') // 'ƴ', y med krok U+01B4 - .replace("Þ", "TH") - .replace("þ", "th") - .replace("ß", "ss") - .replace("⁰", "") - .replace("Ԉ", "(komi lje)") - .replace("Б", "be") // cyrillisk Komi Lje - .replace("\u001A", " ") // "substitute" control char (ascii 26) - - // strek symboler, finnes mange fler men tar en så lenge bare de vi har sett (https://en.wikipedia.org/wiki/Dash#Unicode) - .replace("–", "-") // Kort Tankestrek til Bindestrek - .replace("—", "-"); // Lang Tankestrek til Bindestrek - } -} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/resources/application-prod.yaml b/apps/tps-messaging-service/src/main/resources/application-prod.yaml new file mode 100644 index 00000000000..896466cec53 --- /dev/null +++ b/apps/tps-messaging-service/src/main/resources/application-prod.yaml @@ -0,0 +1,9 @@ + +spring: + security: + oauth2: + resourceserver: + tokenx: + issuer-uri: ${TOKEN_X_ISSUER} + jwk-set-uri: ${TOKEN_X_JWKS_URI} + accepted-audience: ${TOKEN_X_CLIENT_ID} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/resources/application.yaml b/apps/tps-messaging-service/src/main/resources/application.yaml index d55c85176d4..d0c77894e46 100644 --- a/apps/tps-messaging-service/src/main/resources/application.yaml +++ b/apps/tps-messaging-service/src/main/resources/application.yaml @@ -3,6 +3,9 @@ AAD_ISSUER_URI: https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535 spring: application: name: testnav-tps-messaging-service + cloud: + vault: + enabled: false flyway: enabled: false security: @@ -12,13 +15,6 @@ spring: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} - tokenx: - issuer-uri: ${TOKEN_X_ISSUER} - jwk-set-uri: ${TOKEN_X_JWKS_URI} - accepted-audience: ${TOKEN_X_CLIENT_ID} - cloud: - vault: - enabled: false springdoc: swagger-ui: @@ -68,7 +64,10 @@ management: metrics: export: enabled: true + server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java b/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java index bdd45254bf4..a2835984b37 100644 --- a/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java +++ b/apps/tps-messaging-service/src/test/java/no/nav/testnav/apps/tpsmessagingservice/ApplicationContextTest.java @@ -25,4 +25,4 @@ void load_app_context() { assertThat(true).isTrue(); } -} +} \ No newline at end of file diff --git a/apps/udi-stub/src/main/resources/application.yml b/apps/udi-stub/src/main/resources/application.yml index 84004ebefe6..01a94b41a53 100644 --- a/apps/udi-stub/src/main/resources/application.yml +++ b/apps/udi-stub/src/main/resources/application.yml @@ -48,4 +48,6 @@ server: servlet: encoding: charset: UTF-8 + error: + include-message: always diff --git a/apps/varslinger-service/src/main/resources/application.yml b/apps/varslinger-service/src/main/resources/application.yml index 11ce8b758f9..8a78f09871b 100644 --- a/apps/varslinger-service/src/main/resources/application.yml +++ b/apps/varslinger-service/src/main/resources/application.yml @@ -42,4 +42,6 @@ management: server: servlet: encoding: - charset: UTF-8 \ No newline at end of file + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v1/FoedselsmeldingDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v1/FoedselsmeldingDTO.java index b489d637b77..f3ba9c037fe 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v1/FoedselsmeldingDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v1/FoedselsmeldingDTO.java @@ -12,6 +12,7 @@ @AllArgsConstructor @NoArgsConstructor(force = true) public class FoedselsmeldingDTO { + String identFar; String identMor; String identtype; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/AdresseFra.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/AdresseFra.java new file mode 100644 index 00000000000..43b8d22c0f8 --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/AdresseFra.java @@ -0,0 +1,7 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +public enum AdresseFra { + LAG_NY_ADRESSE, + ARV_FRA_MORS, + ARV_FRA_FARS +} diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/DoedsmeldingDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/DoedsmeldingDTO.java new file mode 100644 index 00000000000..83b879d2492 --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/DoedsmeldingDTO.java @@ -0,0 +1,18 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; +import lombok.Value; + +import java.time.LocalDate; + +@Value +@Builder +@AllArgsConstructor +@NoArgsConstructor(force = true) +public class DoedsmeldingDTO { + + String ident; + LocalDate doedsdato; +} diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/DoedsmeldingResponseDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/DoedsmeldingResponseDTO.java new file mode 100644 index 00000000000..7d729a22168 --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/DoedsmeldingResponseDTO.java @@ -0,0 +1,20 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DoedsmeldingResponseDTO { + + private String ident; + private Map miljoStatus; + + private String error; +} \ No newline at end of file diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/FoedselsmeldingDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/FoedselsmeldingDTO.java new file mode 100644 index 00000000000..2b7ede29057 --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/FoedselsmeldingDTO.java @@ -0,0 +1,22 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; +import lombok.Value; + +import java.time.LocalDate; + +@Value +@Builder +@AllArgsConstructor +@NoArgsConstructor(force = true) +public class FoedselsmeldingDTO { + + String identFar; + String identMor; + Identtype identtype; + LocalDate foedselsdato; + Kjoenn kjoenn; + AdresseFra adresseFra; +} diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/FoedselsmeldingResponseDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/FoedselsmeldingResponseDTO.java new file mode 100644 index 00000000000..c61fce4c5c0 --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/FoedselsmeldingResponseDTO.java @@ -0,0 +1,20 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FoedselsmeldingResponseDTO { + + private String ident; + private Map miljoStatus; + + private String error; +} \ No newline at end of file diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/Identtype.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/Identtype.java new file mode 100644 index 00000000000..326333c2de5 --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/Identtype.java @@ -0,0 +1,8 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +public enum Identtype { + + FNR, + DNR, + BOST +} diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/KansellerDoedsmeldingDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/KansellerDoedsmeldingDTO.java new file mode 100644 index 00000000000..cd76040f29e --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/KansellerDoedsmeldingDTO.java @@ -0,0 +1,15 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; +import lombok.Value; + +@Value +@Builder +@AllArgsConstructor +@NoArgsConstructor(force = true) +public class KansellerDoedsmeldingDTO { + + String ident; +} diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/Kjoenn.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/Kjoenn.java new file mode 100644 index 00000000000..975a8ffd376 --- /dev/null +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/endringsmelding/v2/Kjoenn.java @@ -0,0 +1,7 @@ +package no.nav.testnav.libs.dto.endringsmelding.v2; + +public enum Kjoenn { + GUTT, + JENTE, + UKJENT +} diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdresseDTO.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdresseDTO.java index 9e941f3622e..b2ae6fd4b22 100644 --- a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdresseDTO.java +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdresseDTO.java @@ -5,10 +5,12 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import lombok.Data; import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; import java.time.LocalDateTime; @Data +@SuperBuilder @NoArgsConstructor @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "adressetype") @JsonSubTypes({ @@ -19,14 +21,16 @@ public abstract class AdresseDTO { private String kommunenr; + private String kommuneNavn; private LocalDateTime flyttedato; private LocalDateTime gyldigTilDato; private String postnr; + private String poststed; private String tilleggsadresse; private String bolignr; private Boolean deltAdresse; private String matrikkelId; - private Adressetype adressetype; + public abstract Adressetype getAdressetype(); public enum Adressetype {GATE, MATR} } diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdressehistorikkDTO.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdressehistorikkDTO.java new file mode 100644 index 00000000000..0948d9874d9 --- /dev/null +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdressehistorikkDTO.java @@ -0,0 +1,227 @@ +package no.nav.testnav.libs.data.tpsmessagingservice.v1; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +import static java.util.Objects.isNull; +import static java.util.Objects.nonNull; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AdressehistorikkDTO { + + public enum PersonStatus { + ABNR, + ADNR, + BOSA, + DØD, + DØDD, + FØDR, + FOSV, + UREG, + UTPE, + UTAN, + UFUL, + UTVA + } + + private String miljoe; + private TpsMeldingResponse status; + private PersonData persondata; + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class PersonData { + private String Ident; + private String identType; + private List personStatus; + private List bostedsAdresse; + private List postAdresse; + private List tilleggAdresseNAV; + + public List getPersonStatus() { + + if (isNull(personStatus)) { + personStatus = new ArrayList<>(); + } + return personStatus; + } + + public List getBostedsAdresse() { + + if (isNull(bostedsAdresse)) { + bostedsAdresse = new ArrayList<>(); + } + return bostedsAdresse; + } + + public List getPostAdresse() { + + if (isNull(postAdresse)) { + postAdresse = new ArrayList<>(); + } + return postAdresse; + } + + public List getTilleggAdresseNAV() { + + if (isNull(tilleggAdresseNAV)) { + tilleggAdresseNAV = new ArrayList<>(); + } + return tilleggAdresseNAV; + } + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class PersonstatusType { + + protected LocalDate datoFom; + protected LocalDate datoTom; + protected PersonStatus kodePersonstatus; + protected LocalDateTime tidspunktReg; + protected String system; + protected String saksbehandler; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class BoAdresseType { + private LocalDate datoFom; + private LocalDate datoTom; + private String adresse1; + private String adresse2; + private String tilleggsAdresseSKD; + private String kommunenr; + private String kommuneNavn; + private String bolignr; + private String postnr; + private String poststed; + private String landKode; + private String land; + private String adresseType; + private String beskrAdrType; + private LOffAdrType offAdresse; + private LMatrAdrType matrAdresse; + private LocalDateTime tidspunktReg; + private String system; + private String saksbehandler; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class PostAdresseType { + + private LocalDate datoFom; + private LocalDate datoTom; + private String landKode; + private String land; + private String adresseType; + private String beskrAdrType; + private String adresse1; + private String adresse2; + private String adresse3; + private String postnr; + private String poststed; + private LocalDateTime tidspunktReg; + private String system; + private String saksbehandler; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class NavTilleggType { + + private LocalDate datoFom; + private LocalDate datoTom; + private String adresseType; + private String beskrAdrType; + private String typeAdresseNavNorge; + private String beskrTypeAdresseNavNorge; + private String typeTilleggsLinje; + private String beskrTypeTilleggsLinje; + private String tilleggsLinje; + private String kommunenr; + private String kommuneNavn; + private String gatekode; + private String gatenavn; + private String husnr; + private String husbokstav; + private String eiendomsnavn; + private String bolignr; + private String postboksnr; + private String postboksAnlegg; + private String postnr; + private String poststed; + private String landKode; + private String land; + private String adresse1; + private String adresse2; + private String adresse3; + private LocalDateTime tidspunktReg; + private String system; + private String saksbehandler; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class LOffAdrType { + + private String gatekode; + private String gateNavn; + private String husnr; + private String bokstav; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class LMatrAdrType { + + protected String mellomAdresse; + protected String gardsnr; + protected String bruksnr; + protected String festenr; + protected String undernr; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public static class TpsMeldingResponse { + + private String returStatus; + private String returMelding; + private String utfyllendeMelding; + } + + public boolean isOk() { + + return nonNull(status) && "OK".equals(status.getReturStatus()); + } +} diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdressehistorikkRequest.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdressehistorikkRequest.java new file mode 100644 index 00000000000..cc03d94cf36 --- /dev/null +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/AdressehistorikkRequest.java @@ -0,0 +1,18 @@ +package no.nav.testnav.libs.data.tpsmessagingservice.v1; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AdressehistorikkRequest { + + private String ident; + private LocalDate aksjonsdato; +} diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/DoedsmeldingRequest.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/DoedsmeldingRequest.java new file mode 100644 index 00000000000..14a81480d20 --- /dev/null +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/DoedsmeldingRequest.java @@ -0,0 +1,18 @@ +package no.nav.testnav.libs.data.tpsmessagingservice.v1; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DoedsmeldingRequest { + + private String ident; + private LocalDate doedsdato; +} diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/DoedsmeldingResponse.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/DoedsmeldingResponse.java new file mode 100644 index 00000000000..1cc4f590840 --- /dev/null +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/DoedsmeldingResponse.java @@ -0,0 +1,18 @@ +package no.nav.testnav.libs.data.tpsmessagingservice.v1; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DoedsmeldingResponse { + + private String ident; + private Map miljoStatus; +} diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/FoedselsmeldingRequest.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/FoedselsmeldingRequest.java new file mode 100644 index 00000000000..cc8a798d610 --- /dev/null +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/FoedselsmeldingRequest.java @@ -0,0 +1,17 @@ +package no.nav.testnav.libs.data.tpsmessagingservice.v1; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FoedselsmeldingRequest { + + private PersonDTO barn; + private PersonDTO mor; + private PersonDTO far; +} diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/FoedselsmeldingResponse.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/FoedselsmeldingResponse.java new file mode 100644 index 00000000000..9b055c124fb --- /dev/null +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/FoedselsmeldingResponse.java @@ -0,0 +1,18 @@ +package no.nav.testnav.libs.data.tpsmessagingservice.v1; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FoedselsmeldingResponse { + + private String ident; + private Map miljoStatus; +} diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/GateadresseDTO.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/GateadresseDTO.java index d9ce3d70123..47179d98b40 100644 --- a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/GateadresseDTO.java +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/GateadresseDTO.java @@ -2,13 +2,15 @@ import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.SuperBuilder; @Data -@Builder +@ToString(callSuper = true) +@SuperBuilder @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @AllArgsConstructor @@ -19,5 +21,12 @@ public class GateadresseDTO extends AdresseDTO { private String husnummer; + private String husbokstav; + private String gatekode; + + @Override + public Adressetype getAdressetype() { + return Adressetype.GATE; + } } diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/IdentMiljoeDTO.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/IdentMiljoeDTO.java new file mode 100644 index 00000000000..d6b71aef34f --- /dev/null +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/IdentMiljoeDTO.java @@ -0,0 +1,31 @@ +package no.nav.testnav.libs.data.tpsmessagingservice.v1; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.HashSet; +import java.util.Set; + +import static java.util.Objects.isNull; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class IdentMiljoeDTO { + + private String ident; + private Set miljoer; + + public Set getMiljoer() { + + if (isNull(miljoer)) { + miljoer = new HashSet<>(); + } + return miljoer; + } +} \ No newline at end of file diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/MatrikkeladresseDTO.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/MatrikkeladresseDTO.java index 360c6e67fb0..26ede8186a0 100644 --- a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/MatrikkeladresseDTO.java +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/MatrikkeladresseDTO.java @@ -2,13 +2,15 @@ import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.SuperBuilder; @Data -@Builder +@ToString(callSuper = true) +@SuperBuilder @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @AllArgsConstructor @@ -24,4 +26,9 @@ public class MatrikkeladresseDTO extends AdresseDTO { private String festenr; private String undernr; + + @Override + public Adressetype getAdressetype() { + return Adressetype.MATR; + } } diff --git a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/PersonDTO.java b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/PersonDTO.java index bfad5551584..5e7930b1f28 100644 --- a/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/PersonDTO.java +++ b/libs/data-transfer-search-objects/src/main/java/no/nav/testnav/libs/data/tpsmessagingservice/v1/PersonDTO.java @@ -13,6 +13,7 @@ import java.util.List; import static java.util.Objects.isNull; +import static java.util.Objects.nonNull; @Data @Builder @@ -105,4 +106,9 @@ public List getTelefonnumre() { } return telefonnumre; } + + public boolean isDoed() { + + return nonNull(doedsdato); + } } diff --git a/navikt/dolly-komponenter/package-lock.json b/navikt/dolly-komponenter/package-lock.json index ce880e78523..9e75d61b4ae 100644 --- a/navikt/dolly-komponenter/package-lock.json +++ b/navikt/dolly-komponenter/package-lock.json @@ -1,12 +1,12 @@ { "name": "@navikt/dolly-komponenter", - "version": "1.3.34", + "version": "1.3.35", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@navikt/dolly-komponenter", - "version": "1.3.34", + "version": "1.3.35", "license": "MIT", "dependencies": { "@navikt/dolly-assets": "^1.2.9", @@ -7429,13 +7429,13 @@ } }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "dev": true, "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -7443,7 +7443,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.1", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -8106,9 +8106,9 @@ "dev": true }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true, "engines": { "node": ">= 0.6" @@ -9286,17 +9286,17 @@ } }, "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -13435,9 +13435,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, "dependencies": { "bytes": "3.1.2", diff --git a/proxies/aareg-proxy/src/main/resources/application.yaml b/proxies/aareg-proxy/src/main/resources/application.yaml index 581167fdfe9..a66a8f59855 100644 --- a/proxies/aareg-proxy/src/main/resources/application.yaml +++ b/proxies/aareg-proxy/src/main/resources/application.yaml @@ -28,6 +28,13 @@ springdoc: disable-swagger-default-url: true url: /v3/api-docs +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: aareg-services: name: aareg-services-nais-{env} diff --git a/proxies/aareg-synt-services-proxy/src/main/resources/application.yml b/proxies/aareg-synt-services-proxy/src/main/resources/application.yml index c071ceed37d..075c3c04e6b 100644 --- a/proxies/aareg-synt-services-proxy/src/main/resources/application.yml +++ b/proxies/aareg-synt-services-proxy/src/main/resources/application.yml @@ -20,4 +20,11 @@ spring: httpclient: response-timeout: 600s vault: - enabled: false \ No newline at end of file + enabled: false + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/arbeidsplassencv-proxy/src/main/resources/application.yml b/proxies/arbeidsplassencv-proxy/src/main/resources/application.yml index e9ee116ac3c..6d226f14d87 100644 --- a/proxies/arbeidsplassencv-proxy/src/main/resources/application.yml +++ b/proxies/arbeidsplassencv-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: arbeidsplassencv: name: pam-cv-api-gcp diff --git a/proxies/arena-forvalteren-proxy/src/main/resources/application.yml b/proxies/arena-forvalteren-proxy/src/main/resources/application.yml index 0ce1e194fba..0de10a6f643 100644 --- a/proxies/arena-forvalteren-proxy/src/main/resources/application.yml +++ b/proxies/arena-forvalteren-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: arena-services: name: arena-services-MILJOE diff --git a/proxies/batch-adeo-proxy/src/main/resources/application.yml b/proxies/batch-adeo-proxy/src/main/resources/application.yml index 2254c5bf0bf..cfdde3eaad8 100644 --- a/proxies/batch-adeo-proxy/src/main/resources/application.yml +++ b/proxies/batch-adeo-proxy/src/main/resources/application.yml @@ -20,4 +20,11 @@ spring: httpclient: response-timeout: 30s vault: - enabled: false \ No newline at end of file + enabled: false + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/brregstub-proxy/src/main/resources/application.yml b/proxies/brregstub-proxy/src/main/resources/application.yml index 65a307c0448..b2925a062a0 100644 --- a/proxies/brregstub-proxy/src/main/resources/application.yml +++ b/proxies/brregstub-proxy/src/main/resources/application.yml @@ -20,4 +20,11 @@ spring: httpclient: response-timeout: 30s vault: - enabled: false \ No newline at end of file + enabled: false + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/dokarkiv-proxy/src/main/resources/application.yml b/proxies/dokarkiv-proxy/src/main/resources/application.yml index f7ffec35e2d..4fbaeda098b 100644 --- a/proxies/dokarkiv-proxy/src/main/resources/application.yml +++ b/proxies/dokarkiv-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: dokarkiv: url: http://dokarkiv-MILJOE.teamdokumenthandtering.svc.nais.local diff --git a/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java b/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java index 4ec7582870a..b5f7b4f5d37 100644 --- a/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java +++ b/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java @@ -12,6 +12,7 @@ import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; +import org.springframework.http.HttpHeaders; import java.util.function.Function; @@ -29,8 +30,6 @@ public RouteLocator customRouteLocator(RouteLocatorBuilder builder) { .route(createRoute("q1")) .route(createRoute("q2")) .route(createRoute("q4")) - .route(createRoute("q5")) - .route(createRoute("t3")) .build(); } @@ -43,6 +42,7 @@ private Function> createRoute(String miljo) { .path("/api/" + miljo + "/**") .filters(filterSpec -> filterSpec .rewritePath("/api/" + miljo + "/(?.*)", "/${segment}") + .removeRequestHeader(HttpHeaders.AUTHORIZATION) ).uri("https://ereg-services-" + miljo + ".dev.intern.nav.no/"); } } diff --git a/proxies/ereg-proxy/src/main/resources/application.yml b/proxies/ereg-proxy/src/main/resources/application.yml index 7f2ae7279b8..2e7fe7f93e8 100644 --- a/proxies/ereg-proxy/src/main/resources/application.yml +++ b/proxies/ereg-proxy/src/main/resources/application.yml @@ -19,3 +19,10 @@ spring: gateway: httpclient: response-timeout: 120s + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/histark-proxy/src/main/resources/application.yml b/proxies/histark-proxy/src/main/resources/application.yml index 38fd86cbaf9..c57132d143a 100644 --- a/proxies/histark-proxy/src/main/resources/application.yml +++ b/proxies/histark-proxy/src/main/resources/application.yml @@ -20,4 +20,11 @@ spring: httpclient: response-timeout: 600s vault: - enabled: false \ No newline at end of file + enabled: false + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/inntektstub-proxy/src/main/resources/application.yml b/proxies/inntektstub-proxy/src/main/resources/application.yml index d341f86a4e5..d887142145a 100644 --- a/proxies/inntektstub-proxy/src/main/resources/application.yml +++ b/proxies/inntektstub-proxy/src/main/resources/application.yml @@ -20,4 +20,11 @@ spring: httpclient: response-timeout: 600s vault: - enabled: false \ No newline at end of file + enabled: false + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/inst-proxy/src/main/resources/application.yml b/proxies/inst-proxy/src/main/resources/application.yml index 838ce3ffad1..01dd5bd794a 100644 --- a/proxies/inst-proxy/src/main/resources/application.yml +++ b/proxies/inst-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: httpclient: response-timeout: 180s +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: inst: name: opphold-testdata diff --git a/proxies/kontoregister-person-proxy/src/main/resources/application.yml b/proxies/kontoregister-person-proxy/src/main/resources/application.yml index da810748166..9e6cd97e0d9 100644 --- a/proxies/kontoregister-person-proxy/src/main/resources/application.yml +++ b/proxies/kontoregister-person-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: kontoregister: name: sokos-kontoregister-person diff --git a/proxies/krrstub-proxy/src/main/resources/application.yml b/proxies/krrstub-proxy/src/main/resources/application.yml index ff8220fce27..8a784650e62 100644 --- a/proxies/krrstub-proxy/src/main/resources/application.yml +++ b/proxies/krrstub-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: krrstub: name: digdir-krr-stub diff --git a/proxies/medl-proxy/src/main/resources/application.yml b/proxies/medl-proxy/src/main/resources/application.yml index 83dedfa1672..fdbf0b0c264 100644 --- a/proxies/medl-proxy/src/main/resources/application.yml +++ b/proxies/medl-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: medlstub: name: medlemskap-medl-testdata diff --git a/proxies/modapp-ereg-proxy/Dockerfile b/proxies/modapp-ereg-proxy/Dockerfile new file mode 100644 index 00000000000..4a36f93546f --- /dev/null +++ b/proxies/modapp-ereg-proxy/Dockerfile @@ -0,0 +1,8 @@ +FROM ghcr.io/navikt/baseimages/temurin:21 +LABEL maintainer="Team Dolly" + +ENV JAVA_OPTS="-Dspring.profiles.active=prod" + +ADD /build/libs/app.jar /app/app.jar + +EXPOSE 8080 diff --git a/proxies/modapp-ereg-proxy/build.gradle b/proxies/modapp-ereg-proxy/build.gradle new file mode 100644 index 00000000000..5f8425ba179 --- /dev/null +++ b/proxies/modapp-ereg-proxy/build.gradle @@ -0,0 +1,71 @@ +plugins { + id 'java' + id "org.sonarqube" version "4.4.1.3373" + id 'org.springframework.boot' version "3.2.1" + id 'io.spring.dependency-management' version "1.1.4" + id "jacoco" +} + +test { + useJUnitPlatform() +} + +sonarqube { + properties { + property "sonar.dynamicAnalysis", "reuseReports" + property "sonar.host.url", "https://sonarcloud.io" + property "sonar.java.coveragePlugin", "jacoco" + property "sonar.language", "java" + property "sonar.token", System.getenv("SONAR_TOKEN") + property "sonar.organization", "navikt" + property "sonar.project.monorepo.enabled", true + property "sonar.projectKey", "testnav-modapp-ereg-proxy" + property "sonar.projectName", "testnav-modapp-ereg-proxy" + property "sonar.sourceEncoding", "UTF-8" + } +} +bootJar { + archiveFileName = "app.jar" +} + +dependencyManagement { + applyMavenExclusions = false + imports { + mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0' + } +} + +repositories { + mavenCentral() + mavenLocal() +} + +dependencies { + + implementation 'no.nav.testnav.libs:security-core' + implementation 'no.nav.testnav.libs:reactive-core' + implementation 'no.nav.testnav.libs:reactive-proxy' + implementation 'no.nav.testnav.libs:reactive-security' + + implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + implementation 'org.springframework.boot:spring-boot-starter-webflux' + + implementation 'org.springframework.cloud:spring-cloud-starter-vault-config' + implementation 'org.springframework.cloud:spring-cloud-starter-gateway' + + + implementation 'net.logstash.logback:logstash-logback-encoder:7.4' + implementation 'org.hibernate.validator:hibernate-validator' + + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + + annotationProcessor 'org.projectlombok:lombok' + implementation 'org.projectlombok:lombok' + testAnnotationProcessor 'org.projectlombok:lombok' +} +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } +} diff --git a/proxies/modapp-ereg-proxy/config.yml b/proxies/modapp-ereg-proxy/config.yml new file mode 100644 index 00000000000..be0933c0b8c --- /dev/null +++ b/proxies/modapp-ereg-proxy/config.yml @@ -0,0 +1,66 @@ +--- +apiVersion: nais.io/v1 +kind: AzureAdApplication +metadata: + name: testnav-modapp-ereg-proxy-trygdeetaten + namespace: dolly + labels: + team: dolly +spec: + secretName: azure-trygdeetaten-testnav-modapp-ereg-proxy-trygdeetaten + secretKeyPrefix: "AZURE_TRYGDEETATEN" + tenant: trygdeetaten.no +--- +apiVersion: "nais.io/v1alpha1" +kind: "Application" +metadata: + name: testnav-modapp-ereg-proxy + namespace: dolly + labels: + team: dolly +spec: + image: "{{image}}" + port: 8080 + webproxy: true + tokenx: + enabled: true + azure: + application: + allowAllUsers: true + enabled: true + tenant: nav.no + accessPolicy: + inbound: + rules: + - application: team-dolly-lokal-app + cluster: dev-gcp + - application: testnav-oversikt-frontend + cluster: dev-gcp + - application: ereg-batch-status-service + cluster: dev-gcp + - application: app-1 + namespace: plattformsikkerhet + cluster: dev-gcp + liveness: + path: /internal/isAlive + initialDelay: 4 + periodSeconds: 5 + failureThreshold: 500 + readiness: + path: /internal/isReady + initialDelay: 4 + periodSeconds: 5 + failureThreshold: 500 + replicas: + min: 1 + max: 1 + resources: + requests: + cpu: 200m + memory: 1025Mi + limits: + memory: 2048Mi + envFrom: + - secret: azure-trygdeetaten-testnav-modapp-ereg-proxy-trygdeetaten + ingresses: + - "https://testnav-modapp-ereg-proxy.dev-fss-pub.nais.io" diff --git a/proxies/modapp-ereg-proxy/gradle/wrapper/gradle-wrapper.jar b/proxies/modapp-ereg-proxy/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..7454180f2ae Binary files /dev/null and b/proxies/modapp-ereg-proxy/gradle/wrapper/gradle-wrapper.jar differ diff --git a/proxies/modapp-ereg-proxy/gradle/wrapper/gradle-wrapper.properties b/proxies/modapp-ereg-proxy/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..a5952066425 --- /dev/null +++ b/proxies/modapp-ereg-proxy/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/proxies/modapp-ereg-proxy/gradlew b/proxies/modapp-ereg-proxy/gradlew new file mode 100755 index 00000000000..3da45c161b0 --- /dev/null +++ b/proxies/modapp-ereg-proxy/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright ? 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?, +# ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?; +# * compound commands having a testable exit status, especially ?case?; +# * various built-in commands including ?command?, ?set?, and ?ulimit?. +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/proxies/modapp-ereg-proxy/gradlew.bat b/proxies/modapp-ereg-proxy/gradlew.bat new file mode 100644 index 00000000000..107acd32c4e --- /dev/null +++ b/proxies/modapp-ereg-proxy/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/proxies/modapp-ereg-proxy/gradlewUpdate.sh b/proxies/modapp-ereg-proxy/gradlewUpdate.sh new file mode 100755 index 00000000000..e5ee6361152 --- /dev/null +++ b/proxies/modapp-ereg-proxy/gradlewUpdate.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +gradle wrapper \ No newline at end of file diff --git a/proxies/modapp-ereg-proxy/settings.gradle b/proxies/modapp-ereg-proxy/settings.gradle new file mode 100644 index 00000000000..ef5b8a957cb --- /dev/null +++ b/proxies/modapp-ereg-proxy/settings.gradle @@ -0,0 +1,18 @@ +plugins { + id "com.gradle.enterprise" version "3.12.3" +} + +rootProject.name = 'modapp-ereg-proxy' + + +includeBuild '../../libs/reactive-core' +includeBuild '../../libs/reactive-proxy' +includeBuild '../../libs/security-core' +includeBuild '../../libs/reactive-security' + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + } +} diff --git a/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/Consumers.java b/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/Consumers.java new file mode 100644 index 00000000000..32e25c534b9 --- /dev/null +++ b/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/Consumers.java @@ -0,0 +1,29 @@ +package no.nav.testnav.proxies.modapperegproxy; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import no.nav.testnav.libs.securitycore.domain.ServerProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import static lombok.AccessLevel.PACKAGE; + +/** + * Samler alle placeholders for ulike {@code consumers.*}-konfigurasjon her, dvs. subklasser av {@code ServerProperties}. + *

+ * Husk at Spring Boot bruker relaxed binding + * mellom configuration properties og field names. + * + * @see ServerProperties + */ +@Configuration +@ConfigurationProperties(prefix = "consumers") +@NoArgsConstructor(access = PACKAGE) +@Getter +@Setter(PACKAGE) +public class Consumers { + + private ServerProperties eregAura; + +} diff --git a/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/ModappEregProxyApplicationStarter.java b/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/ModappEregProxyApplicationStarter.java new file mode 100644 index 00000000000..4e3b05118bd --- /dev/null +++ b/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/ModappEregProxyApplicationStarter.java @@ -0,0 +1,73 @@ +package no.nav.testnav.proxies.modapperegproxy; + +import no.nav.testnav.libs.reactivecore.config.CoreConfig; +import no.nav.testnav.libs.reactiveproxy.config.DevConfig; +import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; +import no.nav.testnav.libs.securitycore.domain.ServerProperties; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.gateway.route.Route; +import org.springframework.cloud.gateway.route.RouteLocator; +import org.springframework.cloud.gateway.route.builder.Buildable; +import org.springframework.cloud.gateway.route.builder.PredicateSpec; +import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Import; + +import java.util.Arrays; +import java.util.Map; +import java.util.function.Function; + +@Import({ + CoreConfig.class, + DevConfig.class, + SecurityConfig.class +}) +@SpringBootApplication +public class ModappEregProxyApplicationStarter { + + private static final String[] miljoer = new String[]{ "q1", "q2", "q4" }; + private static final Map miljoeUrlSegment = Map.of( + "q1", "05", + "q2", "10", + "q4", "09" + ); + + @Bean + public RouteLocator customRouteLocator( + RouteLocatorBuilder builder, + Consumers consumers + ) { + var routes = builder.routes(); + Arrays + .asList(miljoer) + .forEach( + miljoe -> { + var properties = forEnvironment(consumers.getEregAura(), miljoeUrlSegment.get(miljoe)); + routes + .route(createRoute(miljoe, properties.getUrl())); + }); + return routes.build(); + } + + public static void main(String[] args) { + SpringApplication.run(ModappEregProxyApplicationStarter.class, args); + } + + private Function> createRoute(String miljo, String url) { + return spec -> spec + .path("/" + miljo + "/**") + .filters(filterSpec -> filterSpec + .rewritePath("/" + miljo + "/(?.*)", "/${segment}") + ).uri(url); + } + + private static ServerProperties forEnvironment(ServerProperties original, String urlSegment) { + return ServerProperties.of( + original.getCluster(), + original.getNamespace(), + original.getName(), + original.getUrl().replace("-MILJOE", urlSegment) + ); + } +} \ No newline at end of file diff --git a/proxies/modapp-ereg-proxy/src/main/resources/application.yml b/proxies/modapp-ereg-proxy/src/main/resources/application.yml new file mode 100644 index 00000000000..4842e668d2b --- /dev/null +++ b/proxies/modapp-ereg-proxy/src/main/resources/application.yml @@ -0,0 +1,30 @@ +AAD_ISSUER_URI: https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535279d0b + +spring: + application: + name: testnav-modapp-ereg-proxy + desciption: Proxy for ereg appen i modapp som legger på sikkerhet og redirecter til riktig miljø. + security: + oauth2: + resourceserver: + aad: + issuer-uri: ${AAD_ISSUER_URI}/v2.0 + jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys + accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + tokenx: + issuer-uri: ${TOKEN_X_ISSUER} + jwk-set-uri: ${TOKEN_X_JWKS_URI} + accepted-audience: ${TOKEN_X_CLIENT_ID} + cloud: + gateway: + httpclient: + response-timeout: 1200s + vault: + enabled: false + +consumers: + ereg-aura: + name: ereg-aura + namespace: arbeidsforhold + url: https://b27jbsl016-MILJOE.preprod.local:8443 + cluster: dev-fss \ No newline at end of file diff --git a/proxies/modapp-ereg-proxy/src/main/resources/logback-spring.xml b/proxies/modapp-ereg-proxy/src/main/resources/logback-spring.xml new file mode 100644 index 00000000000..52c15597b3c --- /dev/null +++ b/proxies/modapp-ereg-proxy/src/main/resources/logback-spring.xml @@ -0,0 +1,40 @@ + + + + + + + true + 256 + 10280 + 20 + ^sun\.reflect\..*\.invoke + ^net\.sf\.cglib\.proxy\.MethodProxy\.invoke + java\.util\.concurrent\..* + org\.apache\.catalina\..* + org\.apache\.coyote\..* + org\.apache\.tomcat\..* + + + + + + + + + + + + + %d{HH:mm:ss.SSS} | %5p | %logger{25} | %m%n + + utf8 + + + + + + + + + \ No newline at end of file diff --git a/proxies/modapp-ereg-proxy/src/test/java/no/nav/testnav/proxies/modapperegproxy/ApplicationContextTest.java b/proxies/modapp-ereg-proxy/src/test/java/no/nav/testnav/proxies/modapperegproxy/ApplicationContextTest.java new file mode 100644 index 00000000000..315981c5591 --- /dev/null +++ b/proxies/modapp-ereg-proxy/src/test/java/no/nav/testnav/proxies/modapperegproxy/ApplicationContextTest.java @@ -0,0 +1,20 @@ +package no.nav.testnav.proxies.modapperegproxy; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; +import org.springframework.test.context.ActiveProfiles; + +@SpringBootTest +@ActiveProfiles("test") +class ApplicationContextTest { + + @MockBean + public ReactiveJwtDecoder reactiveJwtDecoder; + + @Test + @SuppressWarnings("java:S2699") + void load_app_context() { + } +} diff --git a/proxies/modapp-ereg-proxy/src/test/resources/application-test.yml b/proxies/modapp-ereg-proxy/src/test/resources/application-test.yml new file mode 100644 index 00000000000..905697c5bae --- /dev/null +++ b/proxies/modapp-ereg-proxy/src/test/resources/application-test.yml @@ -0,0 +1,11 @@ +TOKEN_X_ISSUER: dummy +consumers: + ereg-aura: + url: http://ereg-dummy.dummy.no + cluster: dev-fss + name: ereg-dummy + namespace: dummy +spring: + cloud: + vault: + enabled: false diff --git a/proxies/norg2-proxy/src/main/resources/application.yml b/proxies/norg2-proxy/src/main/resources/application.yml index 656cb23834e..824d19c8596 100644 --- a/proxies/norg2-proxy/src/main/resources/application.yml +++ b/proxies/norg2-proxy/src/main/resources/application.yml @@ -18,4 +18,11 @@ spring: cloud: gateway: httpclient: - response-timeout: 600s \ No newline at end of file + response-timeout: 600s + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/pdl-proxy/src/main/resources/application.yml b/proxies/pdl-proxy/src/main/resources/application.yml index 0a99cca928d..e26237f80f4 100644 --- a/proxies/pdl-proxy/src/main/resources/application.yml +++ b/proxies/pdl-proxy/src/main/resources/application.yml @@ -25,6 +25,13 @@ sts: provider: url: https://security-token-service.dev.adeo.no/rest/v1/sts/token +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: pdl-testdata: url: http://pdl-testdata.pdl.svc.nais.local diff --git a/proxies/pensjon-testdata-facade-proxy/src/main/resources/application.yml b/proxies/pensjon-testdata-facade-proxy/src/main/resources/application.yml index a39776feb28..80815dce95e 100644 --- a/proxies/pensjon-testdata-facade-proxy/src/main/resources/application.yml +++ b/proxies/pensjon-testdata-facade-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: samboer-testdata: name: pensjon-samboerforhold-backend-MILJOE diff --git a/proxies/saf-proxy/src/main/resources/application.yml b/proxies/saf-proxy/src/main/resources/application.yml index c7952e5627b..5ad17d622f3 100644 --- a/proxies/saf-proxy/src/main/resources/application.yml +++ b/proxies/saf-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: saf: url: http://saf-MILJOE.teamdokumenthandtering.svc.nais.local diff --git a/proxies/sigrunstub-proxy/src/main/resources/application.yml b/proxies/sigrunstub-proxy/src/main/resources/application.yml index f2667f033bc..7276fd556ff 100644 --- a/proxies/sigrunstub-proxy/src/main/resources/application.yml +++ b/proxies/sigrunstub-proxy/src/main/resources/application.yml @@ -20,4 +20,11 @@ spring: httpclient: response-timeout: 600s vault: - enabled: false \ No newline at end of file + enabled: false + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/skjermingsregister-proxy/src/main/resources/application.yml b/proxies/skjermingsregister-proxy/src/main/resources/application.yml index 7ab17a5a1c7..675b5454381 100644 --- a/proxies/skjermingsregister-proxy/src/main/resources/application.yml +++ b/proxies/skjermingsregister-proxy/src/main/resources/application.yml @@ -22,6 +22,13 @@ spring: httpclient: response-timeout: 30s +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: skjermingsregister: name: skjermede-personer diff --git a/proxies/synthdata-meldekort-proxy/src/main/resources/application.yml b/proxies/synthdata-meldekort-proxy/src/main/resources/application.yml index 8bea364b981..9e4e5fcdf42 100644 --- a/proxies/synthdata-meldekort-proxy/src/main/resources/application.yml +++ b/proxies/synthdata-meldekort-proxy/src/main/resources/application.yml @@ -15,6 +15,13 @@ spring: vault: enabled: false +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: synt-meldekort: url: https://synthdata-arena-meldekort.intern.dev.nav.no diff --git a/proxies/tps-forvalteren-proxy/src/main/resources/application.yml b/proxies/tps-forvalteren-proxy/src/main/resources/application.yml index 87ce883e8a1..7fd9e27269a 100644 --- a/proxies/tps-forvalteren-proxy/src/main/resources/application.yml +++ b/proxies/tps-forvalteren-proxy/src/main/resources/application.yml @@ -19,3 +19,10 @@ spring: gateway: httpclient: response-timeout: 1200s + +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always \ No newline at end of file diff --git a/proxies/udistub-proxy/src/main/resources/application.yml b/proxies/udistub-proxy/src/main/resources/application.yml index 06c736b4f2c..c3d6f395292 100644 --- a/proxies/udistub-proxy/src/main/resources/application.yml +++ b/proxies/udistub-proxy/src/main/resources/application.yml @@ -20,6 +20,13 @@ spring: httpclient: response-timeout: 1200s +server: + servlet: + encoding: + charset: UTF-8 + error: + include-message: always + consumers: testnav-udistub: url: http://testnav-udi-stub.dolly.svc.nais.local diff --git a/settings.gradle b/settings.gradle index 1a3d42dbd11..c1a87b24977 100644 --- a/settings.gradle +++ b/settings.gradle @@ -25,6 +25,7 @@ includeBuild './proxies/udistub-proxy' includeBuild './proxies/skjermingsregister-proxy' includeBuild './proxies/batch-adeo-proxy' includeBuild './proxies/saf-proxy' +includeBuild './proxies/modapp-ereg-proxy' includeBuild './proxies/dokarkiv-proxy' includeBuild './proxies/tps-forvalteren-proxy' includeBuild './proxies/aareg-synt-services-proxy'