Skip to content

Commit

Permalink
Merge pull request #1242 from navikt/return_oppgave
Browse files Browse the repository at this point in the history
Save returninput when required.
  • Loading branch information
oyvind-wedoe authored Nov 3, 2024
2 parents 6cf80b4 + 5108aa0 commit 154cc64
Show file tree
Hide file tree
Showing 62 changed files with 1,281 additions and 583 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class BehandlingController(
@PathVariable("behandlingId") behandlingId: UUID,
//change value name after testing
@RequestParam(value = "nybehandling", required = false) nyBehandlingEtterTROpphevet: Boolean = false,
@RequestBody(required = false) input: ReturnOppgaveInput?
@RequestBody(required = false) gosysOppgaveInput: GosysOppgaveInput?,
): BehandlingFullfoertView {
logKlagebehandlingMethodDetails(
::fullfoerBehandling.name,
Expand All @@ -92,7 +92,7 @@ class BehandlingController(
return behandlingService.ferdigstillBehandling(
behandlingId = behandlingId,
innloggetIdent = innloggetSaksbehandlerService.getInnloggetIdent(),
returnOppgaveInput = input,
gosysOppgaveInput = gosysOppgaveInput,
nyBehandlingEtterTROpphevet = nyBehandlingEtterTROpphevet,
)
}
Expand Down Expand Up @@ -470,6 +470,25 @@ class BehandlingController(
)
}

@PutMapping("/{behandlingId}/gosysoppgaveid")
fun setGosysOppgaveId(
@PathVariable("behandlingId") behandlingId: UUID,
@RequestBody input: GosysOppgaveIdInput
): GosysOppgaveEditedView {
logBehandlingMethodDetails(
::setGosysOppgaveId.name,
innloggetSaksbehandlerService.getInnloggetIdent(),
behandlingId,
logger
)

return behandlingService.setGosysOppgaveId(
behandlingId = behandlingId,
gosysOppgaveId = input.gosysOppgaveId,
utfoerendeSaksbehandlerIdent = innloggetSaksbehandlerService.getInnloggetIdent()
)
}

@PutMapping("/{behandlingId}/resultat/utfall")
fun setUtfall(
@PathVariable("behandlingId") behandlingId: UUID,
Expand Down Expand Up @@ -583,4 +602,56 @@ class BehandlingController(
.sortedByDescending { it.mottattKlageinstans }.map { it.id },
)
}

@Operation(
summary = "Hent oppgaver i Gosys gjelder personen i behandlingen",
description = "Finner alle Gosys-oppgaver som gjelder personen behandlingen gjelder."
)
@GetMapping("/{behandlingId}/gosysoppgaver", produces = ["application/json"])
fun findGosysoppgaver(
@PathVariable("behandlingId") behandlingId: UUID,
): List<GosysOppgaveView> {
logMethodDetails(
::findGosysoppgaver.name,
innloggetSaksbehandlerService.getInnloggetIdent(),
logger
)

return behandlingService.findRelevantGosysOppgaver(
behandlingId = behandlingId
)
}

@Operation(
summary = "Hent gjeldende Gosys-oppgave for behandlingen",
description = "Henter en Gosys-oppgave."
)
@GetMapping("/{behandlingId}/gosysoppgave", produces = ["application/json"])
fun getGosysOppgave(
@PathVariable("behandlingId") behandlingId: UUID,
): GosysOppgaveView {
logMethodDetails(
::getGosysOppgave.name,
innloggetSaksbehandlerService.getInnloggetIdent(),
logger
)

return behandlingService.getGosysOppgave(
behandlingId = behandlingId,
)
}

@GetMapping("/{behandlingId}/fradelingreason")
fun getFradelingReason(
@PathVariable("behandlingId") behandlingId: UUID
): WithPrevious<TildelingEvent>? {
logBehandlingMethodDetails(
::getFradelingReason.name,
innloggetSaksbehandlerService.getInnloggetIdent(),
behandlingId,
logger
)

return behandlingService.getFradelingReason(behandlingId)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ package no.nav.klage.oppgave.api.controller
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.Parameter
import jakarta.validation.Valid
import no.nav.klage.kodeverk.Fagsystem
import no.nav.klage.oppgave.api.view.ExternalFeilregistreringInput
import no.nav.klage.oppgave.clients.klagefssproxy.KlageFssProxyClient
import no.nav.klage.oppgave.clients.klagefssproxy.domain.FeilregistrertInKabalInput
import no.nav.klage.oppgave.clients.klagefssproxy.domain.SakFromKlanke
import no.nav.klage.oppgave.service.AdminService
import no.nav.klage.oppgave.service.BehandlingService
import no.nav.klage.oppgave.util.TokenUtil
import no.nav.klage.oppgave.util.getLogger
import no.nav.security.token.support.core.api.Unprotected
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Profile
import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.*
Expand All @@ -20,6 +25,8 @@ class DevOnlyAdminController(
private val adminService: AdminService,
private val tokenUtil: TokenUtil,
private val behandlingService: BehandlingService,
private val klageFssProxyClient: KlageFssProxyClient,
@Value("\${SYSTEMBRUKER_IDENT}") private val systembrukerIdent: String,
) {

companion object {
Expand Down Expand Up @@ -126,13 +133,24 @@ class DevOnlyAdminController(
@Parameter(description = "Feilregistrering")
@Valid @RequestBody feilregistrering: ExternalFeilregistreringInput,
) {
behandlingService.feilregistrer(
val behandling = behandlingService.feilregistrer(
type = feilregistrering.type,
reason = feilregistrering.reason,
navIdent = feilregistrering.navIdent,
fagsystem = feilregistrering.fagsystem,
kildereferanse = feilregistrering.kildereferanse,
)

if (behandling.fagsystem == Fagsystem.IT01) {
logger.debug("Feilregistrering av behandling skal registreres i Infotrygd.")
klageFssProxyClient.setToFeilregistrertInKabal(
sakId = behandling.kildeReferanse,
input = FeilregistrertInKabalInput(
saksbehandlerIdent = systembrukerIdent,
)
)
logger.debug("Feilregistrering av behandling ble registrert i Infotrygd.")
}
}

@Unprotected
Expand All @@ -148,5 +166,15 @@ class DevOnlyAdminController(
}
}

@Unprotected
@GetMapping("/internal/infotrygdsaker/{id}")
fun getInfotrygdsak(
@PathVariable("id") id: String
): SakFromKlanke {
logger.debug("getInfotrygdsak is called in dev")

return adminService.getInfotrygdsak(id)
}

data class Fnr(val fnr: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ class KabinApiController(
}

@PostMapping("/oppgaveisduplicate")
fun oppgaveIsDuplicate(
@RequestBody input: OppgaveIsDuplicateInput
fun gosysOppgaveIsDuplicate(
@RequestBody input: GosysOppgaveIsDuplicateInput
): Boolean {
logMethodDetails(
methodName = ::oppgaveIsDuplicate.name,
methodName = ::gosysOppgaveIsDuplicate.name,
innloggetIdent = innloggetSaksbehandlerService.getInnloggetIdent(),
logger = logger
)
return behandlingService.oppgaveIsDuplicate(
oppgaveId = input.oppgaveId,
return behandlingService.gosysOppgaveIsDuplicate(
gosysOppgaveId = input.oppgaveId,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class MockDataController(
registreringsHjemmelSet = registreringsHjemmelSet,
ankebehandlingUtfall = ExternalUtfall.valueOf(utfallToTrygderetten.random().name),
previousSaksbehandlerident = null,
oppgaveId = null,
gosysOppgaveId = null,
tilbakekreving = false,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*
class SearchController(
private val innloggetSaksbehandlerService: InnloggetSaksbehandlerService,
private val partSearchService: PartSearchService,
private val oppgaveApiService: OppgaveApiService,
private val gosysOppgaveService: GosysOppgaveService,
private val oppgaveService: OppgaveService,
private val enhetService: EnhetService,
) {
Expand Down Expand Up @@ -73,17 +73,17 @@ class SearchController(
return partSearchService.searchPerson(input.identifikator)
}

@GetMapping("/search/oppgavemapper/{enhetsnr}")
fun searchOppgaveMapper(
@GetMapping("/search/gosysoppgavemapper/{enhetsnr}")
fun searchGosysOppgaveMapper(
@PathVariable("enhetsnr") enhetsnr: String,
): List<OppgaveApiMappeView> {
): List<GosysOppgaveApiMappeView> {
logMethodDetails(
::searchOppgaveMapper.name,
::searchGosysOppgaveMapper.name,
innloggetSaksbehandlerService.getInnloggetIdent(),
logger
)

return oppgaveApiService.getMapperForEnhet(enhetsnr = enhetsnr)
return gosysOppgaveService.getMapperForEnhet(enhetsnr = enhetsnr)
}

@GetMapping("/search/enheter")
Expand Down
Loading

0 comments on commit 154cc64

Please sign in to comment.