wip
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user