Skip to content

Commit

Permalink
Korrigert trunkering av timestamp ved oppslag mot reservasjon
Browse files Browse the repository at this point in the history
  • Loading branch information
boerta committed Apr 12, 2024
1 parent 9182992 commit 9c5db80
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import kotliquery.queryOf
import no.nav.k9.los.domene.lager.oppgave.v2.TransactionalManager
import org.postgresql.util.PSQLException
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit

class ReservasjonV3Repository(
private val transactionalManager: TransactionalManager,
Expand Down Expand Up @@ -172,7 +173,7 @@ class ReservasjonV3Repository(
"reservertAv" to aktivReservasjon.reservertAv,
"reservasjonsnokkel" to aktivReservasjon.reservasjonsnøkkel,
"kommentar" to kommentar,
"now" to LocalDateTime.now(),
"now" to LocalDateTime.now().truncatedTo(ChronoUnit.MICROS),
)
)
)
Expand All @@ -194,7 +195,7 @@ class ReservasjonV3Repository(
""".trimIndent(),
mapOf(
"reservertAv" to saksbehandlerId,
"now" to LocalDateTime.now(),
"now" to LocalDateTime.now().truncatedTo(ChronoUnit.MICROS),
)
).map { row ->
ReservasjonV3(
Expand Down Expand Up @@ -222,7 +223,7 @@ class ReservasjonV3Repository(
and upper(r.gyldig_tidsrom) > :now
""".trimIndent(),
mapOf(
"now" to LocalDateTime.now(),
"now" to LocalDateTime.now().truncatedTo(ChronoUnit.MICROS),
)
).map { row ->
ReservasjonV3(
Expand Down Expand Up @@ -250,7 +251,7 @@ class ReservasjonV3Repository(
""".trimIndent(),
mapOf(
"nokkel" to nøkkel,
"now" to LocalDateTime.now(),
"now" to LocalDateTime.now().truncatedTo(ChronoUnit.MICROS),
)
).map { row ->
ReservasjonV3(
Expand Down Expand Up @@ -286,7 +287,7 @@ class ReservasjonV3Repository(
)
""".trimIndent(),
mapOf(
"now" to LocalDateTime.now(),
"now" to LocalDateTime.now().truncatedTo(ChronoUnit.MICROS),
)
).map { row ->
row.long("oppgaveId")
Expand Down

0 comments on commit 9c5db80

Please sign in to comment.