feat: Update age group categories in training stats for better accuracy
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 46s

This commit is contained in:
Torsten Schulz (local)
2026-05-22 14:49:23 +02:00
parent 75a17d42b5
commit 2e7cf0c28d
4 changed files with 16 additions and 14 deletions

View File

@@ -563,11 +563,13 @@ export default {
ageGroupStats() {
const buckets = [
{ label: 'Kinder U13', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age <= 12 },
{ label: 'Jugend U19', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 13 && age <= 18 },
{ label: 'Erwachsene', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 19 && age <= 59 },
{ label: 'Senioren 60+', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 60 },
{ label: 'Ohne Geburtsdatum', memberCount: 0, totalParticipations12Months: 0, match: (age) => age === null }
{ label: 'U7', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age <= 6 },
{ label: 'U9', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 7 && age <= 8 },
{ label: 'U11', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 9 && age <= 10 },
{ label: 'U13', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 11 && age <= 12 },
{ label: 'U15', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 13 && age <= 14 },
{ label: 'U19', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 15 && age <= 18 },
{ label: 'Erwachsene', memberCount: 0, totalParticipations12Months: 0, match: (age) => age !== null && age >= 19 }
];
this.filteredMembers.forEach((member) => {
@@ -579,7 +581,6 @@ export default {
});
return buckets
.filter((entry) => entry.memberCount > 0)
.map((entry) => ({
...entry,
averageParticipations12Months: entry.memberCount > 0 ? entry.totalParticipations12Months / entry.memberCount : 0

View File

@@ -228,11 +228,13 @@ object TrainingStatsDerived {
fun ageGroupStats(filteredMembers: List<TrainingStatsMember>): List<AgeGroupStatRow> {
data class Bucket(val label: String, val match: (Int?) -> Boolean, var memberCount: Int = 0, var totalP12: Int = 0)
val buckets = listOf(
Bucket("Kinder U13", { a -> a != null && a <= 12 }),
Bucket("Jugend U19", { a -> a != null && a in 13..18 }),
Bucket("Erwachsene", { a -> a != null && a in 19..59 }),
Bucket("Senioren 60+", { a -> a != null && a >= 60 }),
Bucket("Ohne Geburtsdatum", { a -> a == null }),
Bucket("U7", { a -> a != null && a <= 6 }),
Bucket("U9", { a -> a != null && a in 7..8 }),
Bucket("U11", { a -> a != null && a in 9..10 }),
Bucket("U13", { a -> a != null && a in 11..12 }),
Bucket("U15", { a -> a != null && a in 13..14 }),
Bucket("U19", { a -> a != null && a in 15..18 }),
Bucket("Erwachsene", { a -> a != null && a >= 19 }),
)
for (member in filteredMembers) {
val age = ageFromBirthDate(member.birthDate)
@@ -241,7 +243,6 @@ object TrainingStatsDerived {
bucket.totalP12 += member.participation12Months
}
return buckets
.filter { it.memberCount > 0 }
.map {
val mc = it.memberCount
AgeGroupStatRow(

View File

@@ -1,7 +1,7 @@
[versions]
# composeApp (Play Store / „Über die App“-Build)
appVersionCode = "14"
appVersionName = "1.5.0"
appVersionCode = "15"
appVersionName = "1.6.0"
agp = "9.2.1"
android-compileSdk = "35"
android-minSdk = "24"