Skip to content

Commit 3f17c1d

Browse files
committed
Add endpoint to finalize motebehov for arbeidstaker
1 parent 682b4a7 commit 3f17c1d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/main/kotlin/no/nav/syfo/motebehov/MotebehovOppfolgingstilfelleServiceV2.kt

+4
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ class MotebehovOppfolgingstilfelleServiceV2 @Inject constructor(
187187
}
188188
}
189189

190+
fun ferdigstillMotebehov(arbeidstakerFnr: String) {
191+
varselServiceV2.ferdigstillSvarMotebehovVarselForArbeidstaker(arbeidstakerFnr)
192+
}
193+
190194
private fun throwCreateMotebehovConflict(errorMessage: String) {
191195
log.warn(errorMessage)
192196
throw ConflictException()

src/main/kotlin/no/nav/syfo/motebehov/api/MotebehovArbeidstakerControllerV3.kt

+17
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,21 @@ class MotebehovArbeidstakerControllerV3 @Inject constructor(
131131
motebehovSvar,
132132
)
133133
}
134+
135+
@PostMapping(
136+
value = ["/motebehov/ferdigstill"],
137+
consumes = [MediaType.APPLICATION_JSON_VALUE],
138+
produces = [MediaType.APPLICATION_JSON_VALUE],
139+
)
140+
fun ferdigstillMotebehovArbeidstaker() {
141+
metric.tellEndepunktKall("call_endpoint_ferdigstill_motebehov_arbeidstaker")
142+
val arbeidstakerFnr = TokenXUtil.validateTokenXClaims(
143+
contextHolder,
144+
dialogmoteClientId,
145+
esyfoProxyClientId
146+
)
147+
.fnrFromIdportenTokenX()
148+
149+
motebehovOppfolgingstilfelleServiceV2.ferdigstillMotebehov(arbeidstakerFnr)
150+
}
134151
}

0 commit comments

Comments
 (0)