feat: Support CRUD functionality (#7)

The station search implementation only works via DB and is very slow. For a simple query, the answer takes about 1s or longer. That is 100 times slower than it should be. For now, however, this solution is adequate to achieve a first prototype that includes the core functionality.

feat: Add station search
This commit is contained in:
2024-01-06 14:06:43 +01:00
committed by GitHub
parent b5681181fb
commit 7fbd270019
166 changed files with 2039 additions and 482 deletions
@@ -0,0 +1,11 @@
package de.twomartens.timetable.types
@JvmInline
value class Email private constructor(val value: String) {
companion object {
fun of(email: NonEmptyString): Email {
require(email.value.contains("@")) { "Invalid email format" }
return Email(email.value)
}
}
}
@@ -0,0 +1,10 @@
package de.twomartens.timetable.types
@JvmInline
value class ZeroOrPositiveInteger(val value: Int) {
init {
require(value >= 0) {
"Value must be zero or positive integer"
}
}
}