diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/common/Line.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/common/Line.kt new file mode 100644 index 0000000..1985097 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/common/Line.kt @@ -0,0 +1,14 @@ +package de.twomartens.timetable.model.common + +import de.twomartens.timetable.types.NonEmptyString + +@JvmInline +value class Line private constructor(val name: String) { + companion object { + val EMPTY = Line("EMPTY") + + fun of(name: NonEmptyString): Line { + return Line(name.value) + } + } +} \ No newline at end of file diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/common/RotationId.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/common/RotationId.kt new file mode 100644 index 0000000..f2af2a2 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/common/RotationId.kt @@ -0,0 +1,12 @@ +package de.twomartens.timetable.model.common + +import de.twomartens.timetable.types.PositiveInteger + +@JvmInline +value class RotationId private constructor(val id: Int) { + companion object { + fun of(id: PositiveInteger): RotationId { + return RotationId(id.value) + } + } +} diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/AdditionalService.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/AdditionalService.kt new file mode 100644 index 0000000..5b9c946 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/AdditionalService.kt @@ -0,0 +1,17 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.FormationId +import de.twomartens.timetable.model.common.Line +import de.twomartens.timetable.model.common.ServiceId +import java.time.LocalTime + +data class AdditionalService( + val id: ServiceId, + val line: Line, + val formationId: FormationId, + val direction: Direction, + val start: Station, + val destination: Station, + val serviceStartTime: LocalTime, + val stops: List +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/AdditionalServiceStop.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/AdditionalServiceStop.kt new file mode 100644 index 0000000..52626f3 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/AdditionalServiceStop.kt @@ -0,0 +1,12 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.types.NonEmptyString +import java.time.LocalTime + +data class AdditionalServiceStop( + val stop: Station, + val arrivalTime: LocalTime, + val departureTime: LocalTime, + val platformAndSection: NonEmptyString, + val loading: Boolean +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Country.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Country.kt new file mode 100644 index 0000000..5bcb65b --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Country.kt @@ -0,0 +1,9 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.CountryCode +import de.twomartens.timetable.types.NonEmptyString + +data class Country( + val countryCode: CountryCode, + val name: NonEmptyString +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Direction.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Direction.kt new file mode 100644 index 0000000..32896d1 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Direction.kt @@ -0,0 +1,6 @@ +package de.twomartens.timetable.model.dto + +enum class Direction { + LEFT, + RIGHT +} \ No newline at end of file diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Formation.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Formation.kt new file mode 100644 index 0000000..982ef6d --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Formation.kt @@ -0,0 +1,11 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.FormationId +import de.twomartens.timetable.types.NonEmptyString + +data class Formation( + val id: FormationId, + val name: NonEmptyString, + val trainSimWorldFormationId: FormationId?, + val coaches: List +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Rotation.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Rotation.kt new file mode 100644 index 0000000..3aaad45 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Rotation.kt @@ -0,0 +1,14 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.FormationId +import de.twomartens.timetable.model.common.RotationId +import java.time.LocalTime + +data class Rotation( + val id: RotationId, + val formationId: FormationId, + val firstServiceStartTime: LocalTime, + val lastServiceEndTime: LocalTime, + val startsInVault: Boolean, + + ) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceFormationStage.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceFormationStage.kt new file mode 100644 index 0000000..d4f1da1 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceFormationStage.kt @@ -0,0 +1,15 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.FormationId +import de.twomartens.timetable.model.common.Line +import de.twomartens.timetable.model.common.ServiceId + +data class ServiceFormationStage( + val id: ServiceId, + val line: Line, + val direction: Direction, + val formation: FormationId, + val formationReversed: Boolean, + val startStop: ServiceStop, + val destinationStop: ServiceStop +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceLinkingStage.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceLinkingStage.kt new file mode 100644 index 0000000..ca3f1ba --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceLinkingStage.kt @@ -0,0 +1,18 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.FormationId +import de.twomartens.timetable.model.common.Line +import de.twomartens.timetable.model.common.ServiceId + +data class ServiceLinkingStage( + val id: ServiceId, + val formationId: FormationId, + val line: Line, + val direction: Direction, + val formationReversed: Boolean, + val startStop: ServiceStop, + val fromDepotOrSidingAtStart: Boolean, + val destinationStop: ServiceStop, + val fromDepotOrSidingAtDestination: Boolean, +) + diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceRotationStage.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceRotationStage.kt new file mode 100644 index 0000000..3b99f4a --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceRotationStage.kt @@ -0,0 +1,16 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.Line +import de.twomartens.timetable.model.common.ServiceId +import de.twomartens.timetable.types.NonEmptyString + +data class ServiceRotationStage( + val id: ServiceId, + val line: Line, + val originStop: NonEmptyString, + val virtualDestinations: List, + val startingFrom: NonEmptyString, + val endingIn: NonEmptyString, + val serviceStartTime: NonEmptyString, + val stops: List +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceStop.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceStop.kt new file mode 100644 index 0000000..66b693b --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/ServiceStop.kt @@ -0,0 +1,11 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.types.NonEmptyString + +data class ServiceStop( + val stop: Station, + val arrivalTime: String, + val departureTime: String, + val platform: NonEmptyString, + val section: String +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Station.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Station.kt new file mode 100644 index 0000000..10199d4 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Station.kt @@ -0,0 +1,9 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.StationId +import de.twomartens.timetable.types.NonEmptyString + +data class Station( + val id: StationId, + val name: NonEmptyString +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Timetable.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Timetable.kt new file mode 100644 index 0000000..64576c8 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/Timetable.kt @@ -0,0 +1,13 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.types.NonEmptyString +import java.time.LocalDate + +data class Timetable( + val name: NonEmptyString, + val country: Country, + val routeName: NonEmptyString, + val fetchDate: LocalDate, + val state: TimetableState, + val numberOfServices: String +) diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/TimetableState.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/TimetableState.kt new file mode 100644 index 0000000..6934eac --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/TimetableState.kt @@ -0,0 +1,9 @@ +package de.twomartens.timetable.model.dto + +enum class TimetableState { + NEW, + PROCESSING, + ENTER_FORMATIONS, + LINK_SERVICES, + READY_FOR_USAGE +} \ No newline at end of file diff --git a/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/TswRoute.kt b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/TswRoute.kt new file mode 100644 index 0000000..6102420 --- /dev/null +++ b/module-server/src/main/kotlin/de/twomartens/timetable/model/dto/TswRoute.kt @@ -0,0 +1,13 @@ +package de.twomartens.timetable.model.dto + +import de.twomartens.timetable.model.common.Depot +import de.twomartens.timetable.model.common.Portal +import de.twomartens.timetable.types.NonEmptyString + +data class TswRoute( + val name: NonEmptyString, + val country: Country, + val stations: List, + val portals: List, + val depots: List +)