feat: Process fetched timetables and combine stops into services

This commit is contained in:
2025-09-18 17:19:55 +02:00
parent 513acf40c2
commit 050badbd85
19 changed files with 519 additions and 3 deletions
@@ -4,6 +4,8 @@ import de.twomartens.timetable.bahnApi.model.Eva
import de.twomartens.timetable.bahnApi.model.db.BahnTimetable
import org.bson.types.ObjectId
import org.springframework.data.domain.ExampleMatcher
import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.data.mongodb.repository.MongoRepository
import java.time.ZonedDateTime
@@ -18,4 +20,7 @@ interface BahnTimetableRepository : MongoRepository<BahnTimetable, ObjectId> {
.withMatcher("eva", ExampleMatcher.GenericPropertyMatchers.exact())
.withMatcher("hourAtDay", ExampleMatcher.GenericPropertyMatchers.exact())
}
fun getBahnTimetablesByUserIdAndTswTimetableId(userId: String, tswTimetableId: String,
pageable: Pageable): Page<BahnTimetable>
}
@@ -2,6 +2,8 @@ package de.twomartens.timetable.bahnApi.repository
import de.twomartens.timetable.bahnApi.model.Eva
import de.twomartens.timetable.bahnApi.model.db.ScheduledFetchTask
import de.twomartens.timetable.model.common.TimetableId
import de.twomartens.timetable.model.common.UserId
import de.twomartens.timetable.types.HourAtDay
import org.bson.types.ObjectId
import org.springframework.data.mongodb.repository.MongoRepository
@@ -11,4 +13,6 @@ interface ScheduledFetchTaskRepository : MongoRepository<ScheduledFetchTask, Obj
fun findByEvaAndFetchedDateTime(eva: Eva, fetchedDateTime: HourAtDay): ScheduledFetchTask?
fun findAllByCreatedAfter(createdAt: Instant): List<ScheduledFetchTask>
fun findScheduledFetchTaskByUserIdAndTswTimetableId(userId: UserId, tswTimetableId: TimetableId): List<ScheduledFetchTask>
}