TrackerScores.kt
composeApp/src/commonMain/kotlin/eu/friedcutlet/yokan/services/tracking/TrackerScores.kt
1package eu.friedcutlet.yokan.services.tracking23/** Defaults for existing saved rows; production callers may provide the service's advertised scale. */4fun trackerScoreMaximum(providerId: Int?): Int? = when (providerId) {5 1, 4, 5, 6, in 10..15 -> 106 2, 3 -> 1007 else -> null8}910fun normalizedTrackerScore(providerId: Int?, score: Int?, maximum: Int? = trackerScoreMaximum(providerId)): Double? {11 if (score == null || maximum == null || maximum <= 0 || score <= 0 || score > maximum) return null12 return score.toDouble() * 10.0 / maximum13}14