Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/idporten-miljoevelger
Browse files Browse the repository at this point in the history
# Conflicts:
#	apps/dolly-frontend/src/main/js/package-lock.json
  • Loading branch information
stigus committed Apr 4, 2024
2 parents 513725c + 8c4dc7e commit 9d599b5
Show file tree
Hide file tree
Showing 170 changed files with 10,423 additions and 10,121 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/app.kodeverk-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: kodeverk-service

on:
push:
paths:
- libs/security-core
- libs/reactive-core
- libs/reactive-security
- libs/data-transfer-objects
- apps/kodeverk-service/**
- .github/workflows/app.kodeverk-service.yml

jobs:
workflow:
uses: ./.github/workflows/common.workflow.backend.yml
with:
working-directory: "apps/kodeverk-service"
deploy-tag: "#deploy-kodeverk-service"
permissions:
contents: read
id-token: write
secrets: inherit
21 changes: 21 additions & 0 deletions .github/workflows/app.team-dolly-lokal-app.yml
Original file line number Diff line number Diff line change
@@ -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
35 changes: 0 additions & 35 deletions .github/workflows/build.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Integration Tests
on:
push:
branches:
Expand Down
18 changes: 18 additions & 0 deletions .nais/team-dolly-lokal-app.yml
Original file line number Diff line number Diff line change
@@ -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: testnav-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
4 changes: 3 additions & 1 deletion apps/adresse-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ management:
server:
servlet:
encoding:
charset: UTF-8
charset: UTF-8
error:
include-message: always
4 changes: 3 additions & 1 deletion apps/amelding-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ management:
server:
servlet:
encoding:
charset: UTF-8
charset: UTF-8
error:
include-message: always
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ management:
server:
servlet:
encoding:
charset: UTF-8
charset: UTF-8
error:
include-message: always
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ management:
server:
servlet:
encoding:
charset: UTF-8
charset: UTF-8
error:
include-message: always
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ server:
servlet:
encoding:
charset: UTF-8
error:
include-message: always

consumers:
dolly-backend:
Expand Down
4 changes: 3 additions & 1 deletion apps/brreg-stub/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ management:
server:
servlet:
encoding:
charset: UTF-8
charset: UTF-8
error:
include-message: always
4 changes: 3 additions & 1 deletion apps/bruker-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ management:
server:
servlet:
encoding:
charset: UTF-8
charset: UTF-8
error:
include-message: always
7 changes: 7 additions & 0 deletions apps/budpro-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ consumers:
app:
security:
allow-api: true

server:
servlet:
encoding:
charset: UTF-8
error:
include-message: always
5 changes: 3 additions & 2 deletions apps/dolly-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ TESTCONTAINERS_RYUK_DISABLED=true
For å kjøre lokalt med elastic search:

```
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
```
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
```
Legg merke til passord `YLAgOm}rz#o6#Aq` (tilfeldig [generert](https://www.strongpasswordgenerator.org/), men må være "sterkt" ellers vil ikke OpenSearch starte).
Original file line number Diff line number Diff line change
Expand Up @@ -85,52 +85,59 @@ private ClientFuture futurePersist(BestillingProgress progress, String status) {
};
}

private Flux<String> postInntektsmelding(boolean isSendMelding,
InntektsmeldingRequest inntektsmeldingRequest, Long bestillingid) {

private Flux<String> postInntektsmelding(
boolean isSendMelding,
InntektsmeldingRequest inntektsmeldingRequest,
Long bestillingid
) {
final var miljoe = inntektsmeldingRequest.getMiljoe();
if (isSendMelding) {
return inntektsmeldingConsumer.postInntektsmelding(inntektsmeldingRequest)
return inntektsmeldingConsumer
.postInntektsmelding(inntektsmeldingRequest)
.map(response -> {
if (isBlank(response.getError())) {

transaksjonMappingService.saveAll(
response.getDokumenter().stream()
.map(dokument -> {
var gjeldendeInntektRequest = InntektsmeldingRequest.builder()
.arbeidstakerFnr(inntektsmeldingRequest.getArbeidstakerFnr())
.inntekter(singletonList(
inntektsmeldingRequest.getInntekter().get(response.getDokumenter().indexOf(dokument))))
.joarkMetadata(inntektsmeldingRequest.getJoarkMetadata())
.miljoe(inntektsmeldingRequest.getMiljoe())
.build();

return TransaksjonMapping.builder()
.ident(inntektsmeldingRequest.getArbeidstakerFnr())
.bestillingId(bestillingid)
.transaksjonId(toJson(TransaksjonMappingDTO.builder()
.request(gjeldendeInntektRequest)
.dokument(dokument)
.build()))
.datoEndret(LocalDateTime.now())
.miljoe(inntektsmeldingRequest.getMiljoe())
.system(INNTKMELD.name())
.build();
})
.toList());

return inntektsmeldingRequest.getMiljoe() + ":OK";
var entries = response
.getDokumenter()
.stream()
.map(dokument -> {
var gjeldendeInntektRequest = InntektsmeldingRequest
.builder()
.arbeidstakerFnr(inntektsmeldingRequest.getArbeidstakerFnr())
.inntekter(singletonList(inntektsmeldingRequest.getInntekter().get(response.getDokumenter().indexOf(dokument))))
.joarkMetadata(inntektsmeldingRequest.getJoarkMetadata())
.miljoe(miljoe)
.build();
var json = toJson(TransaksjonMappingDTO
.builder()
.request(gjeldendeInntektRequest)
.dokument(dokument)
.build());
return TransaksjonMapping
.builder()
.ident(inntektsmeldingRequest.getArbeidstakerFnr())
.bestillingId(bestillingid)
.transaksjonId(json)
.datoEndret(LocalDateTime.now())
.miljoe(miljoe)
.system(INNTKMELD.name())
.build();
})
.toList();
transaksjonMappingService.saveAll(entries);

return miljoe + ":OK";

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

return String.format(STATUS_FMT, inntektsmeldingRequest.getMiljoe(),
return String.format(STATUS_FMT, miljoe,
errorStatusDecoder.getErrorText(response.getStatus(), response.getError()));

}
});
} else {
return Flux.just(inntektsmeldingRequest.getMiljoe() + ":OK");
return Flux.just(miljoe + ":OK");
}
}

Expand Down
Loading

0 comments on commit 9d599b5

Please sign in to comment.