Skip to content

Commit

Permalink
Merge branch 'master' into feature/pensjon-oppdaterte-endepunkter
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Aug 28, 2024
2 parents da271a5 + e381a84 commit 0531110
Show file tree
Hide file tree
Showing 380 changed files with 21,965 additions and 15,800 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/app.levende-arbeidsforhold-ansettelse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: levende-arbeidsforhold-ansettelse

on:
push:
paths:
- libs/commands/**
- libs/data-transfer-objects/**
- libs/security-core/**
- libs/servlet-core/**
- libs/servlet-security/**
- libs/servlet-insecure-security/**
- apps/levende-arbeidsforhold-ansettelse/**
- .github/workflows/app.levende-arbeidsforhold-ansettelse.yml


jobs:
workflow:
uses: ./.github/workflows/common.workflow.backend.yml
with:
working-directory: "apps/levende-arbeidsforhold-ansettelse"
deploy-tag: "#deploy-levende-arbeidsforhold-ansettelse"
sonar-enabled: false
permissions:
contents: read
id-token: write
secrets: inherit
25 changes: 25 additions & 0 deletions .github/workflows/app.levende-arbeidsforhold-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: levende-arbeidsforhold-scheduler

on:
push:
paths:
- libs/commands/**
- libs/data-transfer-objects/**
- libs/security-core/**
- libs/servlet-core/**
- libs/servlet-security/**
- apps/levende-arbeidsforhold-scheduler/**
- .github/workflows/app.levende-arbeidsforhold-scheduler.yml


jobs:
workflow:
uses: ./.github/workflows/common.workflow.backend.yml
with:
working-directory: "apps/levende-arbeidsforhold-scheduler"
deploy-tag: "#deploy-levende-arbeidsforhold-scheduler"
sonar-enabled: false
permissions:
contents: read
id-token: write
secrets: inherit
24 changes: 24 additions & 0 deletions .github/workflows/app.levende-arbeidsforhold-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: levende-arbeidsforhold-service

on:
push:
paths:
- libs/kafka-config/**
- libs/avro-schema/**
- libs/security-core/**
- libs/servlet-core/**
- libs/servlet-insecure-security/**
- libs/reactive-core/**
- apps/levende-arbeidsforhold-service/**
- .github/workflows/app.levende-arbeidsforhold-service.yml

jobs:
workflow:
uses: ./.github/workflows/common.workflow.backend.yml
with:
working-directory: "apps/levende-arbeidsforhold-service"
deploy-tag: "#deploy-levende-arbeidsforhold-service"
permissions:
contents: read
id-token: write
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/common.integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: ./gradlew assemble --scan
- name: "Start docker containers"
run: |
JWK=$(cat ./mocks/jwk.json) docker-compose up -d --build
JWK=$(cat ./mocks/jwk.json) docker compose up --build --detach
- name: "Health check"
timeout-minutes: 5
run: |
Expand All @@ -52,4 +52,4 @@ jobs:
run: ./gradlew iTest --scan
- name: "Stop docker containers"
run: |
docker-compose down -v --remove-orphans
docker compose down --remove-orphans --volumes
1 change: 0 additions & 1 deletion .github/workflows/common.workflow.backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ jobs:
team: dolly
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
dockerfile: ${{ inputs.working-directory }}/Dockerfile
docker_context: ${{ inputs.working-directory }}
image_suffix: ${{ inputs.image-suffix }}
outputs:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/common.workflow.frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ jobs:
team: dolly
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
dockerfile: ${{ inputs.working-directory }}/Dockerfile
docker_context: ${{ inputs.working-directory }}
image_suffix: ${{ inputs.image-suffix }}
outputs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Eller kjør:
Kjør kommandoen:

```
JWK=$(cat ./mocks/jwk.json) docker-compose up --build
JWK=$(cat ./mocks/jwk.json) docker compose up --build
```

Deretter kan itegrasjonstester kjøres med kommandoen:
Expand Down
1 change: 1 addition & 0 deletions apps/app-tilgang-analyse-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {
implementation 'io.r2dbc:r2dbc-h2'
implementation 'org.postgresql:r2dbc-postgresql'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-database-postgresql'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'

implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc"
Expand Down
1 change: 1 addition & 0 deletions apps/app-tilgang-analyse-service/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
gcp:
sqlInstances:
- type: POSTGRES_12
tier: db-custom-1-3840
databases:
- name: testnav-app-tilgang-analyse-service-db
liveness:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ consumers:
namespace: dolly
url: https://testnav-aareg-proxy.dev-fss-pub.nais.io
cluster: dev-fss

spec:
azure:
application:
enabled: true
management:
endpoints:
enabled-by-default: true
Expand Down
1 change: 1 addition & 0 deletions apps/brreg-stub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
implementation 'com.zaxxer:HikariCP'

implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-database-postgresql'
implementation 'com.h2database:h2'

implementation 'wsdl4j:wsdl4j'
Expand Down
1 change: 1 addition & 0 deletions apps/bruker-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies {
implementation 'io.r2dbc:r2dbc-h2'
implementation 'org.postgresql:r2dbc-postgresql'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-database-postgresql'

runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'com.h2database:h2'
Expand Down
1 change: 1 addition & 0 deletions apps/bruker-service/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ spec:
gcp:
sqlInstances:
- type: POSTGRES_12
tier: db-custom-1-3840
databases:
- name: testnav-bruker-service-dev-db
resources:
Expand Down
1 change: 1 addition & 0 deletions apps/bruker-service/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
gcp:
sqlInstances:
- type: POSTGRES_12
tier: db-custom-1-3840
databases:
- name: testnav-bruker-service-db
envFrom:
Expand Down
2 changes: 2 additions & 0 deletions apps/dolly-backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ dependencies {

implementation 'org.postgresql:postgresql'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-database-postgresql'

implementation "ma.glasnost.orika:orika-core:$versions.orika"
implementation 'org.codehaus.jettison:jettison:1.5.4'
implementation "org.apache.poi:poi:$versions.apachePoi"
Expand Down
4 changes: 3 additions & 1 deletion apps/dolly-backend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:
- application: testnav-organisasjon-service
- application: testnav-pdl-forvalter-dev
- application: testnav-person-service
- application: testnav-skattekort-service
- application: testnav-sykemelding-api
- application: testnav-synt-sykemelding-api
- application: testnav-tps-messaging-service
Expand Down Expand Up @@ -104,7 +105,8 @@ spec:
gcp:
sqlInstances:
- type: POSTGRES_14
tier: db-custom-1-3840
name: testnav-dolly-backend-dev
databases:
- name: testnav-dolly-backend-dev
autoBackupHour: 3
autoBackupHour: 3
2 changes: 1 addition & 1 deletion apps/dolly-backend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ spec:
gcp:
sqlInstances:
- type: POSTGRES_14
tier: db-custom-2-7680
name: testnav-dolly-backend
databases:
- name: testnav-dolly-backend
tier: db-custom-2-3840
autoBackupHour: 2
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ public Flux<ClientFuture> gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly
return Flux.empty();
}

@Override
public void release(List<String> identer) {

// Sletting av arbeidsforhold er pt ikke støttet
}

private ClientFuture futurePersist(BestillingProgress progress, String status) {

return () -> {
Expand All @@ -97,12 +103,6 @@ private ClientFuture futurePersist(BestillingProgress progress, String status) {
};
}

@Override
public void release(List<String> identer) {

// Sletting av arbeidsforhold er pt ikke støttet
}

private Mono<String> sendArbeidsforhold(RsDollyUtvidetBestilling bestilling, DollyPerson dollyPerson,
Set<String> miljoer, boolean isOpprettEndre) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ public void mapAtoB(RsInntektsmelding rsInntektsmelding,
public void mapAtoB(RsInntektsmelding.Inntektsmelding rsInntektsmelding,
RsInntektsmeldingRequest inntektsmelding, MappingContext context) {

inntektsmelding.setAarsakTilInnsending(
nullcheckSetDefaultValue(inntektsmelding.getAarsakTilInnsending(), AarsakInnsendingKodeListe.NY));
inntektsmelding.setAarsakTilInnsending(nonNull(rsInntektsmelding.getAarsakTilInnsending()) ?
mapperFacade.map(rsInntektsmelding.getAarsakTilInnsending(), AarsakInnsendingKodeListe.class) :
AarsakInnsendingKodeListe.NY);

if (nonNull(rsInntektsmelding.getArbeidsgiver())) {

Expand Down Expand Up @@ -254,4 +255,4 @@ private static LocalDateTime toLocalDateTime(LocalDate localDate) {

return nonNull(localDate) ? localDate.atStartOfDay() : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import no.nav.dolly.bestilling.pensjonforvalter.domain.AlderspensjonSoknadRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.AlderspensjonVedtakRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPersonRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppGenerertInntektRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppInntektRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonSamboerRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonSamboerResponse;
Expand All @@ -21,6 +22,7 @@
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonTpYtelseRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonUforetrygdRequest;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonforvalterResponse;
import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonsavtaleRequest;
import no.nav.dolly.bestilling.personservice.PersonServiceConsumer;
import no.nav.dolly.consumer.norg2.Norg2Consumer;
import no.nav.dolly.consumer.norg2.dto.Norg2EnhetResponse;
Expand Down Expand Up @@ -83,6 +85,7 @@ public class PensjonforvalterClient implements ClientRegister {
private static final String TP_FORHOLD = "TpForhold#";
private static final String PEN_ALDERSPENSJON = "AP#";
private static final String PEN_UFORETRYGD = "Ufoer#";
private static final String PEN_PENSJONSAVTALE = "Pensjonsavtale#";
private static final String PERIODE = "/periode/";

private final PensjonforvalterConsumer pensjonforvalterConsumer;
Expand Down Expand Up @@ -153,8 +156,15 @@ public Flux<ClientFuture> gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly
dollyPerson.getIdent(), bestilteMiljoer.get())
.map(response -> POPP_INNTEKTSREGISTER + decodeStatus(response, dollyPerson.getIdent())),

lagreGenerertInntekt(pensjon,
dollyPerson.getIdent(), bestilteMiljoer.get())
.map(response -> POPP_INNTEKTSREGISTER + decodeStatus(response, dollyPerson.getIdent())),

lagreTpForhold(pensjon, dollyPerson.getIdent(), bestilteMiljoer.get())
.map(response -> TP_FORHOLD + decodeStatus(response, dollyPerson.getIdent()))
.map(response -> TP_FORHOLD + decodeStatus(response, dollyPerson.getIdent())),

lagrePensjonsavtale(pensjon, dollyPerson.getIdent(), bestilteMiljoer.get())
.map(response -> PEN_PENSJONSAVTALE + decodeStatus(response, dollyPerson.getIdent()))
)
.collectList()
.doOnNext(statusResultat::addAll)
Expand Down Expand Up @@ -197,9 +207,10 @@ public Flux<ClientFuture> gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly
@Override
public void release(List<String> identer) {

// Pensjonforvalter / POPP støtter pt ikke sletting
// Pensjonforvalter / POPP, AP, UT støtter pt ikke sletting

pensjonforvalterConsumer.sletteTpForhold(identer);
pensjonforvalterConsumer.slettePensjonsavtale(identer);
}

public static PensjonforvalterResponse mergePensjonforvalterResponses(List<PensjonforvalterResponse> responser) {
Expand Down Expand Up @@ -458,6 +469,22 @@ private Flux<PensjonforvalterResponse> lagreInntekt(PensjonData pensjonData, Str
}));
}

private Flux<PensjonforvalterResponse> lagreGenerertInntekt(PensjonData pensjonData, String ident,
Set<String> miljoer) {

return Flux.just(pensjonData)
.filter(PensjonData::hasGenerertInntekt)
.map(PensjonData::getGenerertInntekt)
.flatMap(generertInntekt -> Flux.fromIterable(miljoer)
.flatMap(miljoe -> {

var request = mapperFacade.map(generertInntekt, PensjonPoppGenerertInntektRequest.class);
request.setFnr(ident);
request.setMiljoer(List.of(miljoe));
return pensjonforvalterConsumer.lagreGenererteInntekter(request);
}));
}

private Mono<PensjonforvalterResponse> lagreTpForhold(PensjonData pensjonData, String
ident, Set<String> miljoer) {

Expand Down Expand Up @@ -490,6 +517,23 @@ private Mono<PensjonforvalterResponse> lagreTpForhold(PensjonData pensjonData, S
.map(PensjonforvalterClient::mergePensjonforvalterResponses);
}

private Flux<PensjonforvalterResponse> lagrePensjonsavtale(PensjonData pensjon, String ident, Set<String> miljoer) {

return Flux.just(pensjon)
.filter(PensjonData::hasPensjonsavtale)
.map(PensjonData::getPensjonsavtale)
.flatMap(pensjonsavtaler -> Flux.fromIterable(pensjonsavtaler)
.flatMap(pensjonsavtale -> {

var context = MappingContextUtils.getMappingContext();
context.setProperty(IDENT, ident);
context.setProperty(MILJOER, miljoer);

var pensjonsavtaleRequest = mapperFacade.map(pensjonsavtale, PensjonsavtaleRequest.class, context);
return pensjonforvalterConsumer.lagrePensjonsavtale(pensjonsavtaleRequest);
}));
}

private String decodeStatus(PensjonforvalterResponse response, String ident) {

log.info("Mottatt status på {} fra Pensjon-Testdata-Facade: {}", ident, response);
Expand Down
Loading

0 comments on commit 0531110

Please sign in to comment.