mirror of
https://github.com/2martens/tsw-timetable.git
synced 2026-10-17 07:57:55 +02:00
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:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user