Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sykemelding forbedre status tilbakemelding #3681

Merged
merged 23 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cab02f9
Refactor exception handling and update sykemelding responses
krharum Nov 26, 2024
cdc2c4b
Refactor exception handling in SykemeldingConsumer
krharum Nov 26, 2024
51f0e60
Add test and prod configurations for sykemelding API #deploy-test-syk…
krharum Nov 26, 2024
b06788b
Rename config-test.yml to config.test.yml #deploy-test-sykemelding-api
krharum Nov 26, 2024
684217f
Add SPRING_PROFILES_ACTIVE env variable to configs #deploy-test-sykem…
krharum Nov 26, 2024
bcfe7df
Change profile annotation for LocalVaultConfig #deploy-test-sykemeldi…
krharum Nov 26, 2024
35ec44f
Refactor profiles and update URLs for local and dev environments …
krharum Nov 27, 2024
49369ab
Add new application to proxy config
krharum Nov 27, 2024
940ac5a
Add test environment configs for synt-sykemelding-api-dev
krharum Nov 27, 2024
7df9a90
Add testnav-synt-sykemelding-api-dev to config file #deploy-organisas…
krharum Nov 27, 2024
597bb00
Update logging config for dev and local profiles #deploy-test-sykemel…
krharum Nov 27, 2024
b518705
Update application-local.yaml with sykemelding API dev config
krharum Nov 27, 2024
4f5d27b
Refactor sykemelding classes and fix DTO typo #deploy-test-dolly-backend
krharum Nov 28, 2024
cd951f0
Remove unused logging and add new API configuration. #deploy-test-dol…
krharum Nov 28, 2024
441a2da
Deploy #deploy-arbeidsforhold-service #deploy-helsepersonell-service
krharum Nov 28, 2024
24a3804
Update dependencies and API URLs for dev environment #deploy-test-syk…
krharum Nov 28, 2024
eefe8d0
Remove Avro schema dependencies
krharum Nov 28, 2024
e752095
Add testnav-sykemelding-api-dev to config.test.yml
krharum Nov 28, 2024
23d7c26
Add sykemeldingId for tracking submissions. #deploy-test-frontend
krharum Nov 28, 2024
c8f2469
Merge branch 'master' into feature/sykemelding-forbedre-status-tilbak…
krharum Nov 28, 2024
85618d3
deploy
krharum Nov 28, 2024
f0655a5
Reorder error message checks and fix sykemelding config
krharum Nov 28, 2024
a351513
Refactor variable name for clarity in KodeverkGetCommand
krharum Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/app.sykemelding-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
cluster: "dev-gcp"
working-directory: "apps/sykemelding-api"
deploy-tag: "#deploy-sykemelding-api"
deploy-tag-test: "#deploy-test-sykemelding-api"
permissions:
contents: read
id-token: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/app.synt-sykemelding-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
working-directory: "apps/synt-sykemelding-api"
deploy-tag: "#deploy-synt-sykemelding-api"
deploy-tag-test: "#deploy-test-synt-sykemelding-api"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 2 additions & 0 deletions apps/arbeidsforhold-service/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ spec:
cluster: dev-gcp
- application: testnav-synt-sykemelding-api
cluster: dev-gcp
- application: testnav-synt-sykemelding-api-dev
cluster: dev-gcp
outbound:
external:
- host: testnav-aareg-proxy.dev-fss-pub.nais.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ public class ArbeidsforholdApiApplicationStarter {
public static void main(String[] args) {
SpringApplication.run(ArbeidsforholdApiApplicationStarter.class, args);
}
}
}
2 changes: 2 additions & 0 deletions apps/dolly-backend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ spec:
- application: testnav-person-service
- application: testnav-skattekort-service
- application: testnav-sykemelding-api
- application: testnav-sykemelding-api-dev
- application: testnav-synt-sykemelding-api
- application: testnav-synt-sykemelding-api-dev
- application: testnav-tps-messaging-service
- application: testnav-yrkesskade-proxy
- application: testnorge-profil-api-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public static void main(String[] args) {

SpringApplication.run(DollyBackendApplicationStarter.class, args);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private void saveTransaksjonId(SykemeldingResponse sykemelding, Long bestillingI

log.info("Lagrer transaksjon for {} i q1 ", sykemelding.getIdent());

sykemelding.getSykemeldingRequest().setSykemeldingId(sykemelding.getMsgId());
transaksjonMappingService.save(TransaksjonMapping.builder()
.ident(sykemelding.getIdent())
.bestillingId(bestillingId)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package no.nav.dolly.bestilling.sykemelding.command;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import no.nav.dolly.bestilling.sykemelding.domain.DetaljertSykemeldingRequest;
import no.nav.dolly.bestilling.sykemelding.dto.SykemeldingResponse;
import no.nav.testnav.libs.dto.sykemelding.v1.SykemeldingResponseDTO;
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
import no.nav.testnav.libs.securitycore.config.UserConstant;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;
Expand All @@ -16,6 +17,7 @@

import static no.nav.dolly.util.TokenXUtil.getUserJwt;

@Slf4j
@RequiredArgsConstructor
public class SykemeldingPostCommand implements Callable<Mono<SykemeldingResponse>> {

Expand All @@ -35,10 +37,10 @@ public Mono<SykemeldingResponse> call() {
.header(UserConstant.USER_HEADER_JWT, getUserJwt())
.bodyValue(request)
.retrieve()
.toBodilessEntity()
.timeout(Duration.ofMinutes(4))
.bodyToMono(SykemeldingResponseDTO.class)
.map(response -> SykemeldingResponse.builder()
.status(HttpStatus.valueOf(response.getStatusCode().value()))
.status(response.getStatus())
.msgId(response.getSykemeldingId())
.ident(request.getPasient().getIdent())
.sykemeldingRequest(SykemeldingResponse.SykemeldingRequest.builder()
.detaljertSykemeldingRequest(request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import lombok.RequiredArgsConstructor;
import no.nav.dolly.bestilling.sykemelding.domain.SyntSykemeldingRequest;
import no.nav.dolly.bestilling.sykemelding.dto.SykemeldingResponse;
import no.nav.testnav.libs.dto.sykemelding.v1.SykemeldingResponseDTO;
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
import no.nav.testnav.libs.securitycore.config.UserConstant;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;
Expand Down Expand Up @@ -34,10 +34,10 @@ public Mono<SykemeldingResponse> call() {
.header(UserConstant.USER_HEADER_JWT, getUserJwt())
.bodyValue(sykemeldingRequest)
.retrieve()
.toBodilessEntity()
.timeout(Duration.ofMinutes(4))
.bodyToMono(SykemeldingResponseDTO.class)
.map(response -> SykemeldingResponse.builder()
.status(HttpStatus.valueOf(response.getStatusCode().value()))
.status(response.getStatus())
.msgId(response.getSykemeldingId())
.ident(sykemeldingRequest.getIdent())
.sykemeldingRequest(SykemeldingResponse.SykemeldingRequest.builder()
.syntSykemeldingRequest(sykemeldingRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class SykemeldingResponse {
private HttpStatus status;
private String avvik;
private SykemeldingRequest sykemeldingRequest;
private String msgId;
private String ident;

@Data
Expand All @@ -27,6 +28,7 @@ public class SykemeldingResponse {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class SykemeldingRequest {

private String sykemeldingId;
private SyntSykemeldingRequest syntSykemeldingRequest;
private DetaljertSykemeldingRequest detaljertSykemeldingRequest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import no.nav.testnav.libs.dto.kodeverkservice.v1.KodeverkDTO;
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;
Expand Down Expand Up @@ -31,6 +32,10 @@ public Mono<KodeverkDTO> call() {
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token)
.retrieve()
.bodyToMono(KodeverkDTO.class)
.map(kodeverket -> {
kodeverket.setStatus(HttpStatus.OK);
return kodeverket;
})
.doOnError(WebClientFilter::logErrorMessage)
.onErrorResume(error -> Mono.just(KodeverkDTO.builder()
.kodeverknavn(kodeverk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ public String getStatusMessage(String json) {
if (json.contains("{")) {
try {
Map<String, Object> status = objectMapper.readValue(json, Map.class);
if (status.containsKey(ERROR) && isNotBlank((String) status.get(ERROR))) {
builder.append("error=").append(status.get(ERROR)).append("; ");
} else if (status.containsKey(MESSAGE) && isNotBlank((String) status.get(MESSAGE))) {
if (status.containsKey(MESSAGE) && isNotBlank((String) status.get(MESSAGE))) {
builder.append("message=").append(encodeStatus((String) status.get(MESSAGE))).append("; ");
} else if (status.containsKey(ERROR) && isNotBlank((String) status.get(ERROR))) {
builder.append("error=").append(status.get(ERROR)).append("; ");
} else if (status.containsKey(MELDING) && isNotBlank((String) status.get(MELDING))) {
builder.append(encodeStatus((String) status.get(MELDING)));
} else if (status.containsKey(DETAILS) && status.get(DETAILS) instanceof List) {
Expand Down
6 changes: 6 additions & 0 deletions apps/dolly-backend/src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ consumers:
testnav-pdl-forvalter:
name: testnav-pdl-forvalter-dev
url: http://testnav-pdl-forvalter-dev.dolly.svc.cluster.local
testnav-sykemelding-api:
name: testnav-sykemelding-api-dev
url: http://testnav-sykemelding-api-dev.dolly.svc.cluster.local
testnav-synt-sykemelding-api:
name: testnav-synt-sykemelding-api-dev
url: http://testnav-synt-sykemelding-api-dev.dolly.svc.cluster.local
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ consumers:
testnav-organisasjon-service:
url: https://testnav-organisasjon-service.intern.dev.nav.no
testnav-synt-sykemelding-api:
url: https://testnav-synt-sykemelding-api.intern.dev.nav.no
name: testnav-synt-sykemelding-api-dev
url: https://testnav-synt-sykemelding-api-dev.intern.dev.nav.no
testnav-sykemelding-api:
url: http://testnav-sykemelding-api.intern.dev.nav.no
name: testnav-sykemelding-api-dev
url: https://testnav-sykemelding-api-dev.intern.dev.nav.no
testnav-miljoer-service:
url: https://testnav-miljoer-service.intern.dev.nav.no
testnav-arbeidsplassencv-proxy:
Expand Down
Loading