Implemented weather stories support
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-05-30 07:06:29 -05:00
parent bde515d146
commit ecea856e8e
18 changed files with 760 additions and 4 deletions

View File

@@ -0,0 +1,48 @@
// weatherstories_queries.go contains SQL text for weather story reads.
// Layer: adapters/outbound/postgres weather stories feature.
package postgres
const (
queryLatestWeatherStoryRun = `
SELECT
event_id,
office_id,
as_of
FROM weather_story_runs
ORDER BY as_of DESC, event_emitted_at DESC
LIMIT 1`
queryWeatherStoriesForRun = `
SELECT
story_index,
office_id,
start_time,
end_time,
updated_at,
title,
description,
alt_text,
priority,
story_order,
download_url
FROM weather_stories
WHERE run_event_id = $1
ORDER BY story_index ASC`
queryLatestWeatherStory = `
SELECT
story_index,
office_id,
start_time,
end_time,
updated_at,
title,
description,
alt_text,
priority,
story_order,
download_url
FROM weather_stories
ORDER BY updated_at DESC, as_of DESC, story_order ASC, story_index ASC
LIMIT 1`
)