fix(ai-import): give the keeper search a starting flight

This commit is contained in:
Maurice
2026-10-14 13:21:02 +02:00
committed by Maurice
parent f746c22a83
commit e7f2e17954
+1 -1
View File
@@ -71,7 +71,7 @@ export function collapseRepeatedBookingTotal(nodes: Node[], documentText: string
if (!printed.onTotal || printed.lines >= priced.length) return nodes;
// The first to depart keeps it; a tie keeps the order the model gave.
const keeper = priced.reduce((first, node) => (departure(node) < departure(first) ? node : first));
const keeper = priced.reduce((first, node) => (departure(node) < departure(first) ? node : first), priced[0]);
return nodes.map((node) => {
if (node === keeper || priceOf(node) == null) return node;
const { price: _price, priceCurrency: _currency, ...rest } = node;