Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AudunSorheim committed Oct 25, 2023
1 parent 05569cb commit 643e463
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import no.nav.syfo.api.dto.Aktivitetsplikt
import no.nav.syfo.api.dto.AktivitetspliktStatus
import org.springframework.jdbc.core.RowMapper
import java.sql.ResultSet
import java.time.LocalDateTime
import java.sql.Timestamp

class AktivitetspliktRowMapper : RowMapper<Aktivitetsplikt> {
override fun mapRow(rs: ResultSet, rowNum: Int): Aktivitetsplikt {
val status: String = rs.getString("status")
val arsaker: String? = rs.getString("arsaker")
val sistVurdert: String? = rs.getString("sist_vurdert")
val fristDato: String? = rs.getString("frist")
val sistVurdert: Timestamp? = rs.getTimestamp("sist_vurdert")
val fristDato: Timestamp? = rs.getTimestamp("frist")
val journalpostId: String? = rs.getString("journalpost_id")

return Aktivitetsplikt(
status = AktivitetspliktStatus.valueOf(status),
arsaker = arsaker?.toList() ?: emptyList(),
sistVurdert = sistVurdert.let { LocalDateTime.parse(sistVurdert) },
fristDato = sistVurdert.let { LocalDateTime.parse(fristDato) },
sistVurdert = sistVurdert?.toLocalDateTime(),
fristDato = fristDato?.toLocalDateTime(),
journalpostId = journalpostId,
)
}
Expand Down

0 comments on commit 643e463

Please sign in to comment.