Fix BahnStationMapper

This commit is contained in:
Jim Martens 2023-10-26 21:00:57 +02:00
parent f7de1c2825
commit 26bb3e0654
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package de.twomartens.timetable.bahnApi.mapper
import de.twomartens.timetable.bahnApi.model.db.BahnStation
import de.twomartens.timetable.types.NonEmptyString
import org.mapstruct.*
@Mapper(
@ -13,5 +14,12 @@ interface BahnStationMapper {
@Mapping(target = "id", ignore = true)
@Mapping(target = "created", ignore = true)
@Mapping(target = "lastModified", ignore = true)
fun mapToDB(dto: de.twomartens.timetable.bahnApi.model.dto.BahnStation): BahnStation
fun mapToDB(dto: de.twomartens.timetable.bahnApi.model.dto.BahnStation): BahnStation {
return BahnStation(
dto.eva,
NonEmptyString(dto.name),
dto.ds100,
dto.db
)
}
}