Fix BahnStationMapper

This commit is contained in:
2023-10-26 21:00:57 +02:00
parent f7de1c2825
commit 26bb3e0654
@@ -1,6 +1,7 @@
package de.twomartens.timetable.bahnApi.mapper package de.twomartens.timetable.bahnApi.mapper
import de.twomartens.timetable.bahnApi.model.db.BahnStation import de.twomartens.timetable.bahnApi.model.db.BahnStation
import de.twomartens.timetable.types.NonEmptyString
import org.mapstruct.* import org.mapstruct.*
@Mapper( @Mapper(
@@ -13,5 +14,12 @@ interface BahnStationMapper {
@Mapping(target = "id", ignore = true) @Mapping(target = "id", ignore = true)
@Mapping(target = "created", ignore = true) @Mapping(target = "created", ignore = true)
@Mapping(target = "lastModified", 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
)
}
} }