-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skal erstatte FagsakApi på sikt.
- Loading branch information
Showing
16 changed files
with
256 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/no/nav/k9/los/integrasjon/pdl/PersonPdlResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package no.nav.k9.los.integrasjon.pdl | ||
|
||
class PersonPdlResponse( | ||
data class PersonPdlResponse( | ||
val ikkeTilgang: Boolean, | ||
val person: PersonPdl? | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/no/nav/k9/los/nyoppgavestyring/søkeboks/SøkQuery.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package no.nav.k9.los.nyoppgavestyring.søkeboks | ||
|
||
data class SøkQuery ( | ||
val searchString: String | ||
) |
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/no/nav/k9/los/nyoppgavestyring/søkeboks/SøkeboksApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package no.nav.k9.los.nyoppgavestyring.søkeboks | ||
|
||
import io.github.smiley4.ktorswaggerui.dsl.routing.post | ||
import io.ktor.http.* | ||
import io.ktor.server.application.* | ||
import io.ktor.server.request.* | ||
import io.ktor.server.response.* | ||
import io.ktor.server.routing.* | ||
import no.nav.k9.los.integrasjon.rest.RequestContextService | ||
import org.koin.ktor.ext.inject | ||
|
||
|
||
fun Route.SøkeboksApi() { | ||
val requestContextService by inject<RequestContextService>() | ||
val søkeboksTjeneste by inject<SøkeboksTjeneste>() | ||
|
||
post( | ||
{ | ||
description = | ||
"Søk etter oppgaver og tilhørende person. Dersom input er på 9 tegn antas den som journalpostId, ved 11 tegn som fødselsnummer, og ellers som fagsaknummer." | ||
request { body<SøkQuery>() } | ||
response { | ||
HttpStatusCode.OK to { body<List<SøkeboksOppgaveDto>>() } | ||
} | ||
} | ||
) { | ||
val søkQuery = call.receive<SøkQuery>() | ||
requestContextService.withRequestContext(call) { | ||
call.respond(søkeboksTjeneste.finnOppgaver(søkQuery.searchString)) | ||
} | ||
} | ||
} |
Oops, something went wrong.