Skip to content

Commit

Permalink
chore: getting ferdigstilt sykmelding locally before going to smregis…
Browse files Browse the repository at this point in the history
…trering

Co-authored-by: Natalie Uranes <[email protected]>
  • Loading branch information
jaflaten and nuranes committed Dec 5, 2024
1 parent a83ba5a commit 5db579d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,23 @@ class NasjonalOppgaveController(
@PathVariable sykmeldingId: String,
@RequestHeader("Authorization") authorization: String,
): ResponseEntity<PapirManuellOppgave> {
val sykmelding = nasjonalOppgaveService.findBySykmeldingId(sykmeldingId)
if (sykmelding != null) {
log.info("papirsykmelding: henter sykmelding med id $sykmeldingId fra syk-dig-db")
return ResponseEntity.ok(nasjonalOppgaveService.mapFromDao(sykmelding))
}
log.info("papirsykmelding: henter ferdigstilt sykmelding med id $sykmeldingId gjennom syk-dig proxy")
val ferdigstiltSykmeldingRequest = smregistreringClient.getFerdigstiltSykmeldingRequest(authorization, sykmeldingId)
val papirManuellOppgave = ferdigstiltSykmeldingRequest.body
if (papirManuellOppgave != null) {
securelog.info("lagrer nasjonalOppgave i db $papirManuellOppgave")
nasjonalOppgaveService.lagreOppgave(papirManuellOppgave)
return ferdigstiltSykmeldingRequest
}
return ferdigstiltSykmeldingRequest
}



@PostMapping("/oppgave/{oppgaveId}/tilgosys")
fun sendOppgaveTilGosys(
@PathVariable oppgaveId: String,
Expand Down

0 comments on commit 5db579d

Please sign in to comment.