mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:35:23 +02:00
debug: add diagnostic logs to trace history merge for 59272EN
This commit is contained in:
+13
@@ -186,11 +186,24 @@ export default function App() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const articleNoIdx = resolvedCols.ARTICLE_NO;
|
const articleNoIdx = resolvedCols.ARTICLE_NO;
|
||||||
|
const debugProduct = '59272EN';
|
||||||
const processedRows = rows.map(row => {
|
const processedRows = rows.map(row => {
|
||||||
const articleNo = String(row[articleNoIdx]);
|
const articleNo = String(row[articleNoIdx]);
|
||||||
const synced = syncedData[articleNo];
|
const synced = syncedData[articleNo];
|
||||||
const hist = historyData[articleNo];
|
const hist = historyData[articleNo];
|
||||||
|
|
||||||
|
if (articleNo === debugProduct) {
|
||||||
|
console.log('[DEBUG 59272EN] articleNo from row:', articleNo);
|
||||||
|
console.log('[DEBUG 59272EN] synced exists:', !!synced);
|
||||||
|
console.log('[DEBUG 59272EN] hist exists:', !!hist);
|
||||||
|
if (hist) {
|
||||||
|
console.log('[DEBUG 59272EN] hist[103]:', hist[103]);
|
||||||
|
console.log('[DEBUG 59272EN] hist length:', hist.length);
|
||||||
|
}
|
||||||
|
console.log('[DEBUG 59272EN] historyData keys count:', Object.keys(historyData).length);
|
||||||
|
console.log('[DEBUG 59272EN] historyData has key?:', debugProduct in historyData);
|
||||||
|
}
|
||||||
|
|
||||||
// Start with fresh Dropbox values (prices from Excel)
|
// Start with fresh Dropbox values (prices from Excel)
|
||||||
let finalRow = [...row];
|
let finalRow = [...row];
|
||||||
|
|
||||||
|
|||||||
@@ -206,6 +206,8 @@ export async function getHistoryDataForMerge(): Promise<Record<string, ExcelRow>
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
const entries: Array<{ product_id: string; new_data: ExcelRow }> = await response.json();
|
const entries: Array<{ product_id: string; new_data: ExcelRow }> = await response.json();
|
||||||
|
console.log('[getHistoryDataForMerge] Raw entries:', entries.length);
|
||||||
|
console.log('[getHistoryDataForMerge] Has 59272EN?:', entries.some(e => e.product_id === '59272EN'));
|
||||||
|
|
||||||
const result: Record<string, ExcelRow> = {};
|
const result: Record<string, ExcelRow> = {};
|
||||||
const seen = new Set<string>();
|
const seen = new Set<string>();
|
||||||
@@ -216,6 +218,11 @@ export async function getHistoryDataForMerge(): Promise<Record<string, ExcelRow>
|
|||||||
result[entry.product_id] = entry.new_data;
|
result[entry.product_id] = entry.new_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log('[getHistoryDataForMerge] Deduplicated count:', Object.keys(result).length);
|
||||||
|
console.log('[getHistoryDataForMerge] result[59272EN]?:', !!result['59272EN']);
|
||||||
|
if (result['59272EN']) {
|
||||||
|
console.log('[getHistoryDataForMerge] result[59272EN][103]:', result['59272EN'][103]);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('[getHistoryDataForMerge] Exception:', error.message);
|
console.error('[getHistoryDataForMerge] Exception:', error.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user