feat(drivers): merge two drivers, link a deleted duplicate's series results; refuse one transponder twice in a class (1.89.39)

This commit is contained in:
larssand committed 2026-11-15 18:22:21 +01:00
1 parent 5928ce847b
commit 10b5d0a447
11 files changed
+223 -10

No files matched your search

+14
View File
@@ -60,3 +60,17 @@ export function findTransponderConflict(drivers, { transponder, profileId, exclu
&& getDriverProfileId(driver) !== String(profileId || "")
)) || null;
}
// The same transponder twice in one class (one person's two cars entered as two drivers): the
// laps can't be told apart - the decoder only sees the chip - so that is never allowed. Drive
// both cars as one entry, or merge the two entries.
export function findSameClassTransponder(drivers, { transponder, classId, excludeDriverId } = {}) {
const value = String(transponder || "").trim();
if (!value || !classId) return null;
return (Array.isArray(drivers) ? drivers : []).find((driver) => (
String(driver.id || "") !== String(excludeDriverId || "")
&& !driver.guestEventId
&& String(driver.classId || "") === String(classId)
&& String(driver.transponder || "").trim() === value
)) || null;
}