Skip to content

Commit

Permalink
Temporarily disable sak check in infotrygd in async context.
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvind-wedoe committed Nov 30, 2023
1 parent f9b7f68 commit 5d33529
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class KlageFssProxyClient(
private val secureLogger = getSecureLogger()
}

fun getSak(sakId: String): SakFromKlanke {
fun getSakWithSaksbehandlerAccess(sakId: String): SakFromKlanke {
return klageFssProxyWebClient.get()
.uri { it.path("/klanke/saker/{sakId}").build(sakId) }
.header(
Expand All @@ -32,7 +32,7 @@ class KlageFssProxyClient(
)
.retrieve()
.onStatus(HttpStatusCode::isError) { response ->
logErrorResponse(response, ::getSak.name, secureLogger)
logErrorResponse(response, ::getSakWithSaksbehandlerAccess.name, secureLogger)
}
.bodyToMono<SakFromKlanke>()
.block()
Expand All @@ -55,7 +55,7 @@ class KlageFssProxyClient(
.block()
}

fun setToFinished(sakId: String, input: SakFinishedInput) {
fun setToFinishedWithAppAccess(sakId: String, input: SakFinishedInput) {
klageFssProxyWebClient.post()
.uri { it.path("/klanke/saker/{sakId}/finished").build(sakId) }
.header(
Expand All @@ -65,7 +65,7 @@ class KlageFssProxyClient(
.bodyValue(input)
.retrieve()
.onStatus(HttpStatusCode::isError) { response ->
logErrorResponse(response, ::setToFinished.name, secureLogger)
logErrorResponse(response, ::setToFinishedWithAppAccess.name, secureLogger)
}
.bodyToMono<Unit>()
.block()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class KabinApiService(
vedtakDate = sourceBehandling.avsluttetAvSaksbehandler!!,
)
} else {
val klageInInfotrygd = klageFssProxyClient.getSak(sakId = ankebehandling.kildeReferanse)
val klageInInfotrygd = klageFssProxyClient.getSakWithSaksbehandlerAccess(sakId = ankebehandling.kildeReferanse)
getCreatedAnkebehandlingStatusForKabin(
ankebehandling = ankebehandling,
mottak = mottak,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class BehandlingAvslutningService(
//if fagsystem is Infotrygd also do this.
if (behandling.fagsystem == Fagsystem.IT01) {
logger.debug("Vi informerer Infotrygd om innstilling til Trygderetten.")
fssProxyClient.setToFinished(
fssProxyClient.setToFinishedWithAppAccess(
sakId = behandling.kildeReferanse,
SakFinishedInput(
status = SakFinishedInput.Status.VIDERESENDT_TR,
Expand Down Expand Up @@ -115,20 +115,20 @@ class BehandlingAvslutningService(
if (behandling.fagsystem == Fagsystem.IT01) {
logger.debug("Behandlingen som er avsluttet skal sendes tilbake til Infotrygd.")

val sakInKlanke = fssProxyClient.getSak(sakId = behandling.kildeReferanse)
val utfall = if (sakInKlanke.sakstype != null && sakInKlanke.sakstype == "KLAGE_TILBAKEBETALING") {
klageTilbakebetalingutfallToInfotrygdutfall[behandling.utfall!!]!!
} else {
klageutfallToInfotrygdutfall[behandling.utfall!!]!!
}
// val sakInKlanke = fssProxyClient.getSakWithSaksbehandlerAccess(sakId = behandling.kildeReferanse)
// val utfall = if (sakInKlanke.sakstype != null && sakInKlanke.sakstype == "KLAGE_TILBAKEBETALING") {
// klageTilbakebetalingutfallToInfotrygdutfall[behandling.utfall!!]!!
// } else {
// klageutfallToInfotrygdutfall[behandling.utfall!!]!!
// }

fssProxyClient.setToFinished(
fssProxyClient.setToFinishedWithAppAccess(
sakId = behandling.kildeReferanse,
SakFinishedInput(
status = SakFinishedInput.Status.RETURNERT_TK,
nivaa = SakFinishedInput.Nivaa.KA,
typeResultat = SakFinishedInput.TypeResultat.RESULTAT,
utfall = SakFinishedInput.Utfall.valueOf(utfall),
utfall = SakFinishedInput.Utfall.valueOf(klageutfallToInfotrygdutfall[behandling.utfall!!]!!),
mottaker = SakFinishedInput.Mottaker.TRYGDEKONTOR,
saksbehandlerIdent = behandling.tildeling!!.saksbehandlerident!!
)
Expand Down

0 comments on commit 5d33529

Please sign in to comment.