-
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.
TSFF-919: 'Ny inntekt' i ny gruppe 'Uttak' (#2688)
- Loading branch information
Showing
5 changed files
with
31 additions
and
38 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
37 changes: 13 additions & 24 deletions
37
src/main/kotlin/no/nav/k9/los/tjenester/kodeverk/HentKodeverkTjeneste.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,35 +1,24 @@ | ||
package no.nav.k9.los.tjenester.kodeverk | ||
|
||
import no.nav.k9.los.Configuration | ||
import no.nav.k9.los.domene.lager.oppgave.Kodeverdi | ||
import no.nav.k9.los.domene.modell.* | ||
import no.nav.k9.los.tjenester.avdelingsleder.nokkeltall.Venteårsak | ||
|
||
class HentKodeverkTjeneste( | ||
private val configuration: Configuration, | ||
) { | ||
fun hentGruppertKodeliste(): MutableMap<String, Collection<out Kodeverdi>> { | ||
return KODEVERK_ENUM | ||
} | ||
|
||
private var KODEVERK_ENUM = makeMap() | ||
|
||
private fun makeMap(): MutableMap<String, Collection<out Kodeverdi>> { | ||
val koder = mutableMapOf<String, Collection<out Kodeverdi>>() | ||
|
||
koder[BehandlingType::class.java.simpleName] = BehandlingType.values().asList() | ||
koder[FagsakYtelseType::class.java.simpleName] = FagsakYtelseType.values().asList() | ||
koder[KøSortering::class.java.simpleName] = KøSortering.values().asList() | ||
koder[FagsakStatus::class.java.simpleName] = FagsakStatus.values().asList() | ||
|
||
koder[AndreKriterierType::class.java.simpleName] = AndreKriterierType.values().asList() | ||
koder[BehandlingStatus::class.java.simpleName] = BehandlingStatus.values().asList() | ||
koder[Venteårsak::class.java.simpleName] = Venteårsak.values().asList() | ||
koder[KøKriterierType::class.java.simpleName] = KøKriterierType.values().asList() | ||
class HentKodeverkTjeneste { | ||
fun hentGruppertKodeliste(): MutableMap<String, Collection<Kodeverdi>> { | ||
val koder = mutableMapOf<String, Collection<Kodeverdi>>() | ||
koder[BehandlingType::class.java.simpleName] = BehandlingType.entries | ||
koder[FagsakYtelseType::class.java.simpleName] = FagsakYtelseType.entries | ||
koder[KøSortering::class.java.simpleName] = KøSortering.entries | ||
koder[FagsakStatus::class.java.simpleName] = FagsakStatus.entries | ||
koder[AndreKriterierType::class.java.simpleName] = AndreKriterierType.entries | ||
koder[BehandlingStatus::class.java.simpleName] = BehandlingStatus.entries | ||
koder[Venteårsak::class.java.simpleName] = Venteårsak.entries | ||
koder[KøKriterierType::class.java.simpleName] = KøKriterierType.entries | ||
.filterNot { it == KøKriterierType.BEHANDLINGTYPE } // ikke i bruk foreløpig | ||
koder[MerknadType::class.java.simpleName] = MerknadType.values().asList() | ||
koder[MerknadType::class.java.simpleName] = MerknadType.entries | ||
.filterNot { it == MerknadType.VANSKELIG } // ikke støttet foreløpig | ||
koder[OppgaveKode::class.java.simpleName] = OppgaveKode.values().asList() | ||
koder[OppgaveKode::class.java.simpleName] = OppgaveKode.entries | ||
return koder | ||
} | ||
} |
19 changes: 9 additions & 10 deletions
19
src/main/kotlin/no/nav/k9/los/tjenester/kodeverk/KodeverkApis.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,19 +1,18 @@ | ||
package no.nav.k9.los.tjenester.kodeverk | ||
|
||
import io.ktor.server.application.call | ||
import io.ktor.server.locations.Location | ||
import io.ktor.server.locations.get | ||
import io.ktor.server.response.respond | ||
import io.ktor.server.routing.Route | ||
import io.ktor.server.application.* | ||
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.KodeverkApis() { | ||
val kodeverkTjeneste by inject<HentKodeverkTjeneste>() | ||
val requestContextService by inject<RequestContextService>() | ||
|
||
@Location("/kodeverk") | ||
class hentGruppertKodeliste | ||
|
||
get { _: hentGruppertKodeliste -> | ||
kodeverkTjeneste.hentGruppertKodeliste().let { call.respond(it) } | ||
get { | ||
requestContextService.withRequestContext(call) { | ||
kodeverkTjeneste.hentGruppertKodeliste().let { call.respond(it) } | ||
} | ||
} | ||
} |