-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stopfinder impl for RealTripPlanningRepository
- Loading branch information
1 parent
d4168a3
commit 7cc5d56
Showing
5 changed files
with
116 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package xyz.ksharma.krail.trip_planner.network.api.model | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class StopFinderResponse( | ||
@SerialName("version") | ||
val version: String, | ||
|
||
@SerialName("locations") | ||
val locations: List<Location> | ||
) | ||
|
||
@Serializable | ||
data class Location( | ||
@SerialName("id") | ||
val id: String, | ||
|
||
@SerialName("isGlobalId") | ||
val isGlobalId: Boolean, | ||
|
||
@SerialName("name") | ||
val name: String, | ||
|
||
@SerialName("disassembledName") | ||
val disassembledName: String? = null, | ||
|
||
@SerialName("coord") | ||
val coord: List<Double>, | ||
|
||
@SerialName("type") | ||
val type: String, | ||
|
||
@SerialName("matchQuality") | ||
val matchQuality: Int, | ||
|
||
@SerialName("isBest") | ||
val isBest: Boolean, | ||
|
||
@SerialName("parent") | ||
val parent: Parent? = null, | ||
|
||
@SerialName("assignedStops") | ||
val assignedStops: List<AssignedStop>? = null, | ||
|
||
@SerialName("properties") | ||
val properties: Properties? = null | ||
) | ||
|
||
@Serializable | ||
data class Parent( | ||
@SerialName("id") | ||
val id: String? = null, | ||
|
||
@SerialName("name") | ||
val name: String, | ||
|
||
@SerialName("type") | ||
val type: String | ||
) | ||
|
||
@Serializable | ||
data class AssignedStop( | ||
@SerialName("id") | ||
val id: String, | ||
|
||
@SerialName("isGlobalId") | ||
val isGlobalId: Boolean, | ||
|
||
@SerialName("name") | ||
val name: String, | ||
|
||
@SerialName("type") | ||
val type: String, | ||
|
||
@SerialName("coord") | ||
val coord: List<Double>, | ||
|
||
@SerialName("parent") | ||
val parent: Parent, | ||
|
||
@SerialName("productClasses") | ||
val productClasses: List<Int>, | ||
|
||
@SerialName("connectingMode") | ||
val connectingMode: Int, | ||
|
||
@SerialName("properties") | ||
val properties: Properties | ||
) | ||
|
||
@Serializable | ||
data class Properties( | ||
@SerialName("stopId") | ||
val stopId: String | ||
) |
3 changes: 2 additions & 1 deletion
3
...in/kotlin/xyz/ksharma/krail/trip_planner/network/api/repository/TripPlanningRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package xyz.ksharma.krail.trip_planner.network.api.repository | ||
|
||
import xyz.ksharma.krail.trip_planner.network.api.model.StopFinderResponse | ||
import xyz.ksharma.krail.trip_planner.network.api.model.StopType | ||
|
||
interface TripPlanningRepository { | ||
|
||
suspend fun stopFinder(stopType: StopType, stopSearchQuery: String) | ||
suspend fun stopFinder(stopType: StopType, stopSearchQuery: String): Result<StopFinderResponse> | ||
|
||
fun trip() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters