Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import com.tickaroo.tikxml.TypeConverter
internal class FareClassConverter : TypeConverter<FareClass> {

override fun read(ojpValue: String): FareClass {
return when (ojpValue.trim()) {
return when (ojpValue) {
"unknown" -> FareClass.UNKNOWN
"firstClass" -> FareClass.FIRST_CLASS
"secondClass" -> FareClass.SECOND_CLASS
"secondClass " -> FareClass.SECOND_CLASS
else -> FareClass.UNKNOWN
}
}
Expand All @@ -22,7 +22,7 @@ internal class FareClassConverter : TypeConverter<FareClass> {
return when (type) {
FareClass.UNKNOWN -> "unknown"
FareClass.FIRST_CLASS -> "firstClass"
FareClass.SECOND_CLASS -> "secondClass"
FareClass.SECOND_CLASS -> "secondClass "
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ch.opentransportdata.ojp.data.dto.response.tir.leg.AbstractLegType
import ch.opentransportdata.ojp.data.dto.response.tir.leg.ContinuousLegDto
import ch.opentransportdata.ojp.data.dto.response.tir.leg.TimedLegDto
import ch.opentransportdata.ojp.data.dto.response.tir.leg.TransferLegDto
import ch.opentransportdata.ojp.data.dto.response.tir.leg.minimalCopy
import ch.opentransportdata.ojp.data.dto.response.tir.leg.replaceWithParentRef
import com.tickaroo.tikxml.annotation.Element
import com.tickaroo.tikxml.annotation.PropertyElement
Expand Down Expand Up @@ -39,9 +40,9 @@ fun LegDto.minimalCopy(): LegDto {
return LegDto(
id = id,
duration = duration,
timedLeg = timedLeg,
timedLeg = timedLeg?.minimalCopy(),
transferLeg = transferLeg,
continuousLeg = continuousLeg
continuousLeg = continuousLeg?.minimalCopy()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ch.opentransportdata.ojp.data.dto.request.tir.TripVia
import ch.opentransportdata.ojp.data.dto.request.trr.TripRefineParamDto
import ch.opentransportdata.ojp.data.dto.request.trr.TripRefineRequestDto
import ch.opentransportdata.ojp.data.dto.response.tir.TripResultDto
import ch.opentransportdata.ojp.data.dto.response.tir.minimalTripResult
import ch.opentransportdata.ojp.data.remote.OjpService
import ch.opentransportdata.ojp.domain.model.LanguageCode
import ch.opentransportdata.ojp.domain.model.TripParams
Expand Down Expand Up @@ -93,7 +94,7 @@ internal class RemoteTripDataSourceImpl(
tripRefineRequest = TripRefineRequestDto(
requestTimestamp = requestTime,
params = params?.mapToBackendParams(),
result = tripResultDto,
result = tripResultDto.minimalTripResult,
)
)
)
Expand Down
Loading