lfqian commited on
Commit
92dfe14
·
1 Parent(s): b374607

Add detailed debug logging for asset data loading

Browse files
Files changed (1) hide show
  1. src/views/RequestView.vue +5 -0
src/views/RequestView.vue CHANGED
@@ -361,18 +361,22 @@ export default {
361
  },
362
 
363
  async rebuildAssets() {
 
364
  const assetsInRows = Array.from(new Set((this.rowsRef || []).map(r => r.asset))).filter(Boolean)
 
365
  if (!assetsInRows.length) { this.assets = []; return }
366
 
367
  const cards = []
368
  for (const code of assetsInRows) {
369
  const seq = await this.buildAssetSeq(code)
 
370
  if (!seq.length) continue
371
 
372
  // B&H equity as normalized series for spark and change
373
  let bh = []
374
  try { bh = computeBuyHoldEquity(seq, 100000) || [] } catch { bh = [] }
375
  const lastIdx = bh.length - 1
 
376
  if (lastIdx < 0) continue
377
 
378
  // Get end_date from actual sequence data (most accurate)
@@ -380,6 +384,7 @@ export default {
380
  const lastDate = seq[lastIdx]?.date || null
381
 
382
  const spark = this.sampleSeries(bh.map(v => v), 12)
 
383
  const change1m = this.pctChange(spark[0], spark[spark.length - 1])
384
 
385
  // trading day span
 
361
  },
362
 
363
  async rebuildAssets() {
364
+ console.log('[RequestView] rebuildAssets called, allDecisions:', this.allDecisions?.length || 0, 'rowsRef:', this.rowsRef?.length || 0)
365
  const assetsInRows = Array.from(new Set((this.rowsRef || []).map(r => r.asset))).filter(Boolean)
366
+ console.log('[RequestView] Assets in rows:', assetsInRows)
367
  if (!assetsInRows.length) { this.assets = []; return }
368
 
369
  const cards = []
370
  for (const code of assetsInRows) {
371
  const seq = await this.buildAssetSeq(code)
372
+ console.log('[RequestView] Asset', code, 'seq length:', seq?.length || 0)
373
  if (!seq.length) continue
374
 
375
  // B&H equity as normalized series for spark and change
376
  let bh = []
377
  try { bh = computeBuyHoldEquity(seq, 100000) || [] } catch { bh = [] }
378
  const lastIdx = bh.length - 1
379
+ console.log('[RequestView] Asset', code, 'bh length:', bh?.length || 0)
380
  if (lastIdx < 0) continue
381
 
382
  // Get end_date from actual sequence data (most accurate)
 
384
  const lastDate = seq[lastIdx]?.date || null
385
 
386
  const spark = this.sampleSeries(bh.map(v => v), 12)
387
+ console.log('[RequestView] Asset', code, 'spark data:', spark)
388
  const change1m = this.pctChange(spark[0], spark[spark.length - 1])
389
 
390
  // trading day span