Skip to content

Commit

Permalink
fix: fix smtss response
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasDev committed Dec 10, 2024
1 parent 9a0166a commit 0f43240
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import no.nav.sykdig.applog
import no.nav.sykdig.digitalisering.exceptions.SykmelderNotFoundException
import no.nav.sykdig.digitalisering.helsenett.client.HelsenettClient
import no.nav.sykdig.digitalisering.helsenett.client.SmtssClient
import no.nav.sykdig.digitalisering.papirsykmelding.api.RegelClient
import no.nav.sykdig.digitalisering.papirsykmelding.api.model.Godkjenning
import no.nav.sykdig.digitalisering.papirsykmelding.api.model.Kode
import no.nav.sykdig.digitalisering.papirsykmelding.api.model.Sykmelder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ class SmtssClient(
smtssM2mRestTemplate.exchange(
"$smtssUrl/api/v1/samhandler/infotrygd",
HttpMethod.GET,
HttpEntity<Any>(headers),
String::class.java,
HttpEntity<TSSident>(headers),
TSSident::class.java,
)
if (response.statusCode.is2xxSuccessful) return response.body
if (response.statusCode.is2xxSuccessful) {
return response.body?.tssid ?: throw SykmelderNotFoundException("Samhandlerpraksis ikke funnet for samhandlerOrgname ${samhandlerOrgName}")
}
log.info(
"smtss responded with an error code {} for {}",
response.statusCode,
Expand All @@ -51,4 +53,8 @@ class SmtssClient(



}
}

data class TSSident(
val tssid: String,
)

0 comments on commit 0f43240

Please sign in to comment.