feat(scheduling): show all candidates instead of top 5, update section title
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
kkfluous
2026-04-16 22:44:51 +08:00
parent 4f02a54d38
commit 7aa0d961ce
2 changed files with 7 additions and 7 deletions

View File

@@ -129,7 +129,7 @@ export function generateSuggestions(
// Among non-qualifiable: smallest gap first (closest to target)
return a.mileageGap - b.mileageGap;
})
.slice(0, 5);
;
const gap = Math.max(0, vehicle.yearTarget - vehicle.currentYearMileage);
const dailyReq = vehicle.daysLeft > 0 ? Math.round(gap / vehicle.daysLeft) : 0;
@@ -192,7 +192,7 @@ export function generateSuggestions(
})
// Only keep candidates that can actually qualify at this customer
.filter(c => c.canQualifyAfterSwap)
.slice(0, 5);
;
// Skip if no candidate can reach target — swap would be pointless
if (candidates.length === 0) continue;