This commit is contained in:
2025-12-09 10:32:59 +01:00
parent 35f988f885
commit a780139692
26 changed files with 2224 additions and 344 deletions

View File

@@ -120,8 +120,14 @@ export class EventScoringService {
private aggregatePenalties(penalties: Penalty[]): Map<string, number> {
const map = new Map<string, number>();
for (const penalty of penalties) {
// Only count applied points_deduction penalties
if (penalty.status !== 'applied' || penalty.type !== 'points_deduction') {
continue;
}
const current = map.get(penalty.driverId) ?? 0;
map.set(penalty.driverId, current + penalty.pointsDelta);
const delta = penalty.value ?? 0;
map.set(penalty.driverId, current + delta);
}
return map;
}