Skip to content

Commit

Permalink
Flytt ut utrullingslogikk til controller for Utkast
Browse files Browse the repository at this point in the history
  • Loading branch information
ingfo committed Feb 6, 2025
1 parent 482c8e5 commit ff0e28d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.tags.Tag
import no.nav.veilarbvedtaksstotte.controller.dto.VedtakUtkastDTO
import no.nav.veilarbvedtaksstotte.controller.v2.dto.UtkastRequest
import no.nav.veilarbvedtaksstotte.mapper.toVedtakUtkastDTO
import no.nav.veilarbvedtaksstotte.service.UtrullingService
import no.nav.veilarbvedtaksstotte.service.VedtakService
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
Expand All @@ -21,7 +22,8 @@ import org.springframework.web.bind.annotation.RestController
description = "Funksjonalitet knyttet til utkast til § 14 a-vedtak."
)
class UtkastV2Controller(
val vedtakService: VedtakService
val vedtakService: VedtakService,
val utrullingService: UtrullingService
) {
@PostMapping("/hent-utkast")
@Operation(
Expand All @@ -35,6 +37,7 @@ class UtkastV2Controller(
]
)
fun hentUtkast(@RequestBody utkastRequest: UtkastRequest): VedtakUtkastDTO {
utrullingService.sjekkAtVedtakslosningenErPaskruddForBrukerOgVeileder(utkastRequest.fnr)
return toVedtakUtkastDTO(vedtakService.hentUtkast(utkastRequest.fnr))
}

Expand All @@ -49,6 +52,7 @@ class UtkastV2Controller(
]
)
fun harUtkast(@RequestBody utkastRequest: UtkastRequest): Boolean {
utrullingService.sjekkAtVedtakslosningenErPaskruddForBrukerOgVeileder(utkastRequest.fnr)
return vedtakService.harUtkast(utkastRequest.fnr)
}
}

0 comments on commit ff0e28d

Please sign in to comment.