Skip to content

Commit

Permalink
[KAIZEN-0] optional fom og tom dato til ytelser filter
Browse files Browse the repository at this point in the history
  • Loading branch information
abrhanav committed Sep 16, 2024
1 parent b622132 commit afa1cc9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package no.nav.modiapersonoversiktproxy.rest
import kotlinx.serialization.Serializable
import org.joda.time.format.DateTimeFormat
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder

@Serializable
data class RequestBodyContent(
Expand All @@ -14,10 +13,3 @@ data class RequestBodyContent(

val JODA_DATOFORMAT: org.joda.time.format.DateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd")
val DATOFORMAT: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE
val DATO_TID_FORMAT: DateTimeFormatter =
DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral("T")
.appendPattern("HH:mm:ss")
.appendOffsetId()
.toFormatter()
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ interface ArenaInfotrygdApi {

fun hentSykepenger(
fnr: String,
fom: String,
tom: String,
fom: String?,
tom: String?,
): Map<String, Any?>

fun hentForeldrepenger(
fnr: String,
fom: String,
tom: String,
fom: String?,
tom: String?,
): Map<String, Any?>

fun hentPleiepenger(
fnr: String,
fom: String,
tom: String,
fom: String?,
tom: String?,
): Map<String, Any?>

fun hentOppfolgingssakFraArena(fnr: String): JournalforingSak?
Expand Down Expand Up @@ -87,8 +87,8 @@ open class ArenaInfotrygdApiImpl(
@Cacheable(value = ["sykePengerCache"])
override fun hentSykepenger(
fnr: String,
fom: String,
tom: String,
fom: String?,
tom: String?,
): Map<String, Any?> {
val requestContent = Json.encodeToString(RequestBodyContent(fnr, fom, tom))
return sendRequest("sykepenger", requestContent) ?: mapOf()
Expand All @@ -97,8 +97,8 @@ open class ArenaInfotrygdApiImpl(
@Cacheable(value = ["foreldrePengerCache"])
override fun hentForeldrepenger(
fnr: String,
fom: String,
tom: String,
fom: String?,
tom: String?,
): Map<String, Any?> {
val requestContent = Json.encodeToString(RequestBodyContent(fnr, fom, tom))
return sendRequest("foreldrepenger", requestContent) ?: mapOf()
Expand All @@ -107,8 +107,8 @@ open class ArenaInfotrygdApiImpl(
@Cacheable(value = ["pleiePengerCache"])
override fun hentPleiepenger(
fnr: String,
fom: String,
tom: String,
fom: String?,
tom: String?,
): Map<String, Any?> {
val requestContent = Json.encodeToString(RequestBodyContent(fnr, fom, tom))
return sendRequest("pleiepenger", requestContent) ?: mapOf()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import org.springframework.cache.annotation.Cacheable
interface TiltakspengerService {
fun hentVedtakDetaljer(
fodselsnummer: Fnr,
fom: String,
tom: String,
fom: String?,
tom: String?,
): List<Vedtak>
}

Expand All @@ -27,8 +27,8 @@ open class TiltakspengerServiceImpl(
@Cacheable
override fun hentVedtakDetaljer(
fodselsnummer: Fnr,
fom: String,
tom: String,
fom: String?,
tom: String?,
): List<Vedtak> = tiltakspengerApi.vedtakDetaljerPost(vedtakReqDTO = VedtakReqDTO(ident = fodselsnummer.get(), fom, tom)).orEmpty()

override fun ping() =
Expand Down
10 changes: 0 additions & 10 deletions web/src/main/java/no/nav/modiapersonoversikt/rest/Utils.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
package no.nav.modiapersonoversikt.rest

import org.joda.time.format.DateTimeFormat
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder

val JODA_DATOFORMAT: org.joda.time.format.DateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd")
val DATOFORMAT: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE
val DATO_TID_FORMAT: DateTimeFormatter =
DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral("T")
.appendPattern("HH:mm:ss")
.appendOffsetId()
.toFormatter()
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ data class FnrRequest(

data class FnrDatoRangeRequest(
val fnr: String,
val fom: String,
val tom: String,
val fom: String? = null,
val tom: String? = null,
)

0 comments on commit afa1cc9

Please sign in to comment.