From 897a21a1d6e628d2860a796c4522059dc3ac9ccf Mon Sep 17 00:00:00 2001 From: Mathias Date: Wed, 3 Jun 2026 15:10:29 +0200 Subject: [PATCH] feat(store): expose provider_video_id on SummaryRow Read-only addition (column + field + scan) so the web layer can build a video embed URL. No write-path or restructuring. --- internal/adapters/store/reads.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/internal/adapters/store/reads.go b/internal/adapters/store/reads.go index 8233d1a..609bcd3 100644 --- a/internal/adapters/store/reads.go +++ b/internal/adapters/store/reads.go @@ -25,19 +25,20 @@ var ErrNotFound = errors.New("store: summary not found") // not part of the Stage-0 store slice yet. When that table is migrated, swap the // JOIN source — callers already fall back gracefully on an empty Channel. type SummaryRow struct { - VideoID string - Title string // videos.title; empty when no videos row - Channel string // videos.provider for now; empty when no videos row - URL string // videos.url; empty when no videos row - PublishedAt time.Time // videos.published_at; zero when absent - Summary string - Highlights []string - Takeaways []string - AIProvider string - AIModel string - FallbackUsed bool - CreatedAt time.Time - Actions []string // current active actions for this video; nil when none + VideoID string + ProviderVideoID string // videos.provider_video_id; empty when no videos row + Title string // videos.title; empty when no videos row + Channel string // videos.provider for now; empty when no videos row + URL string // videos.url; empty when no videos row + PublishedAt time.Time // videos.published_at; zero when absent + Summary string + Highlights []string + Takeaways []string + AIProvider string + AIModel string + FallbackUsed bool + CreatedAt time.Time + Actions []string // current active actions for this video; nil when none } // selectSummary is the shared projection for both reads. videos is LEFT JOINed @@ -45,6 +46,7 @@ type SummaryRow struct { // crosses users and a missing videos row yields nulls, not a dropped summary. const selectSummary = ` SELECT s.video_id, + COALESCE(v.provider_video_id, ''), COALESCE(v.title, ''), COALESCE(v.provider, ''), COALESCE(v.url, ''), @@ -135,6 +137,7 @@ func scanSummaryRow(rows pgx.Row) (SummaryRow, error) { ) if err := rows.Scan( &row.VideoID, + &row.ProviderVideoID, &row.Title, &row.Channel, &row.URL,