Skip to content

Commit

Permalink
Nytt endepunkt som bare gir det tallet saksbehandler trenger, slik at…
Browse files Browse the repository at this point in the history
… de får raskere kall. (#2726)
  • Loading branch information
mbolstad authored Nov 12, 2024
1 parent 4e4c4e0 commit 2ebf922
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package no.nav.k9.los.nyoppgavestyring.ko

data class AntallOppgaver(val antallUtenReserverte: Long)
18 changes: 18 additions & 0 deletions src/main/kotlin/no/nav/k9/los/nyoppgavestyring/ko/OppgaveKoApis.kt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ fun Route.OppgaveKoApis() {
}
}

get("/{id}/antall-uten-reserverte") {
requestContextService.withRequestContext(call) {
if (pepClient.harBasisTilgang()) {
val oppgavekøId = call.parameters["id"]!!

val antallUtenReserverte = OpentelemetrySpanUtil.span("OppgaveKoTjeneste.hentAntallOppgaverForKø") {
oppgaveKoTjeneste.hentAntallOppgaverForKø(
oppgavekøId.toLong(),
true
)
}
call.respond(AntallOppgaver(antallUtenReserverte))
} else {
call.respond(HttpStatusCode.Forbidden)
}
}
}

post("/{id}/fa-oppgave") {
requestContextService.withRequestContext(call) {
if (pepClient.harTilgangTilReserveringAvOppgaver()) {
Expand Down

0 comments on commit 2ebf922

Please sign in to comment.