Skip to content

Commit d41de8b

Browse files
authored
Merge branch 'master' into feature/bytte-endepukter-til-kodeverk-service
2 parents f996357 + 57073c9 commit d41de8b

File tree

103 files changed

+10594
-10555
lines changed

Some content is hidden

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

103 files changed

+10594
-10555
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: kodeverk-service
2+
3+
on:
4+
push:
5+
paths:
6+
- libs/security-core
7+
- libs/reactive-core
8+
- libs/reactive-security
9+
- libs/data-transfer-objects
10+
- apps/kodeverk-service/**
11+
- .github/workflows/app.kodeverk-service.yml
12+
13+
jobs:
14+
workflow:
15+
uses: ./.github/workflows/common.workflow.backend.yml
16+
with:
17+
working-directory: "apps/kodeverk-service"
18+
deploy-tag: "#deploy-kodeverk-service"
19+
permissions:
20+
contents: read
21+
id-token: write
22+
secrets: inherit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: team-dolly-lokal-app
2+
3+
on:
4+
push:
5+
paths:
6+
- .nais/team-dolly-lokal-app.yml
7+
- .github/workflows/app.team-dolly-lokal-app.yml
8+
9+
jobs:
10+
deploy:
11+
name: Deploy team-dolly-lokal-app
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: nais/deploy/actions/deploy@v2
19+
env:
20+
CLUSTER: dev-gcp
21+
RESOURCE: .nais/team-dolly-lokal-app.yml

.github/workflows/build.yml

-35
This file was deleted.

.github/workflows/tests.yml .github/workflows/integration-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: Integration Tests
22
on:
33
push:
44
branches:

.nais/team-dolly-lokal-app.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: nais.io/v1
2+
kind: AzureAdApplication
3+
metadata:
4+
labels:
5+
team: dolly
6+
name: team-dolly-lokal-app
7+
namespace: dolly
8+
spec:
9+
allowAllUsers: true
10+
logoutUrl: https://localhost:8080/oauth2/logout
11+
preAuthorizedApplications:
12+
- application: testnav-oversikt-frontend
13+
cluster: dev-gcp
14+
namespace: dolly
15+
replyUrls:
16+
- url: http://localhost:8080/login/oauth2/code/aad
17+
secretName: azuread-team-dolly-lokal-app
18+
tenant: nav.no

apps/dolly-backend/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ TESTCONTAINERS_RYUK_DISABLED=true
4444
For å kjøre lokalt med elastic search:
4545

4646
```
47-
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "plugins.security.disabled=true" --name opensearch-node -d opensearchproject/opensearch:latest
48-
```
47+
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "plugins.security.disabled=true" -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD=YLAgOm}rz#o6#Aq" --name opensearch -d opensearchproject/opensearch:latest
48+
```
49+
Legg merke til passord `YLAgOm}rz#o6#Aq` (tilfeldig [generert](https://www.strongpasswordgenerator.org/), men må være "sterkt" ellers vil ikke OpenSearch starte).

apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/inntektsmelding/InntektsmeldingClient.java

+41-34
Original file line numberDiff line numberDiff line change
@@ -85,52 +85,59 @@ private ClientFuture futurePersist(BestillingProgress progress, String status) {
8585
};
8686
}
8787

88-
private Flux<String> postInntektsmelding(boolean isSendMelding,
89-
InntektsmeldingRequest inntektsmeldingRequest, Long bestillingid) {
90-
88+
private Flux<String> postInntektsmelding(
89+
boolean isSendMelding,
90+
InntektsmeldingRequest inntektsmeldingRequest,
91+
Long bestillingid
92+
) {
93+
final var miljoe = inntektsmeldingRequest.getMiljoe();
9194
if (isSendMelding) {
92-
return inntektsmeldingConsumer.postInntektsmelding(inntektsmeldingRequest)
95+
return inntektsmeldingConsumer
96+
.postInntektsmelding(inntektsmeldingRequest)
9397
.map(response -> {
9498
if (isBlank(response.getError())) {
95-
96-
transaksjonMappingService.saveAll(
97-
response.getDokumenter().stream()
98-
.map(dokument -> {
99-
var gjeldendeInntektRequest = InntektsmeldingRequest.builder()
100-
.arbeidstakerFnr(inntektsmeldingRequest.getArbeidstakerFnr())
101-
.inntekter(singletonList(
102-
inntektsmeldingRequest.getInntekter().get(response.getDokumenter().indexOf(dokument))))
103-
.joarkMetadata(inntektsmeldingRequest.getJoarkMetadata())
104-
.miljoe(inntektsmeldingRequest.getMiljoe())
105-
.build();
106-
107-
return TransaksjonMapping.builder()
108-
.ident(inntektsmeldingRequest.getArbeidstakerFnr())
109-
.bestillingId(bestillingid)
110-
.transaksjonId(toJson(TransaksjonMappingDTO.builder()
111-
.request(gjeldendeInntektRequest)
112-
.dokument(dokument)
113-
.build()))
114-
.datoEndret(LocalDateTime.now())
115-
.miljoe(inntektsmeldingRequest.getMiljoe())
116-
.system(INNTKMELD.name())
117-
.build();
118-
})
119-
.toList());
120-
121-
return inntektsmeldingRequest.getMiljoe() + ":OK";
99+
var entries = response
100+
.getDokumenter()
101+
.stream()
102+
.map(dokument -> {
103+
var gjeldendeInntektRequest = InntektsmeldingRequest
104+
.builder()
105+
.arbeidstakerFnr(inntektsmeldingRequest.getArbeidstakerFnr())
106+
.inntekter(singletonList(inntektsmeldingRequest.getInntekter().get(response.getDokumenter().indexOf(dokument))))
107+
.joarkMetadata(inntektsmeldingRequest.getJoarkMetadata())
108+
.miljoe(miljoe)
109+
.build();
110+
var json = toJson(TransaksjonMappingDTO
111+
.builder()
112+
.request(gjeldendeInntektRequest)
113+
.dokument(dokument)
114+
.build());
115+
return TransaksjonMapping
116+
.builder()
117+
.ident(inntektsmeldingRequest.getArbeidstakerFnr())
118+
.bestillingId(bestillingid)
119+
.transaksjonId(json)
120+
.datoEndret(LocalDateTime.now())
121+
.miljoe(miljoe)
122+
.system(INNTKMELD.name())
123+
.build();
124+
})
125+
.toList();
126+
transaksjonMappingService.saveAll(entries);
127+
128+
return miljoe + ":OK";
122129

123130
} else {
124131
log.error("Feilet å legge inn person: {} til Inntektsmelding miljø: {} feilmelding {}",
125-
inntektsmeldingRequest.getArbeidstakerFnr(), inntektsmeldingRequest.getMiljoe(), response.getError());
132+
inntektsmeldingRequest.getArbeidstakerFnr(), miljoe, response.getError());
126133

127-
return String.format(STATUS_FMT, inntektsmeldingRequest.getMiljoe(),
134+
return String.format(STATUS_FMT, miljoe,
128135
errorStatusDecoder.getErrorText(response.getStatus(), response.getError()));
129136

130137
}
131138
});
132139
} else {
133-
return Flux.just(inntektsmeldingRequest.getMiljoe() + ":OK");
140+
return Flux.just(miljoe + ":OK");
134141
}
135142
}
136143

0 commit comments

Comments
 (0)