Files
weatherapi/internal/adapters/outbound/postgres/weatherstories_mapper.go
Eric Rakestraw ecea856e8e
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
Implemented weather stories support
2026-05-30 07:06:29 -05:00

29 lines
904 B
Go

// weatherstories_mapper.go maps weather story rows into weather model payloads.
// Layer: adapters/outbound/postgres weather stories feature.
package postgres
import "gitea.maximumdirect.net/ejr/weatherfeeder/model"
func mapWeatherStoryRunParentRow(row weatherStoryRunParentRow) model.WeatherStoryRun {
return model.WeatherStoryRun{
OfficeID: stringValue(row.OfficeID),
AsOf: row.AsOf.UTC(),
Stories: nil,
}
}
func mapWeatherStoryRow(row weatherStoryRow) model.WeatherStory {
return model.WeatherStory{
OfficeID: stringValue(row.OfficeID),
StartTime: row.StartTime.UTC(),
EndTime: row.EndTime.UTC(),
UpdatedAt: row.UpdatedAt.UTC(),
Title: stringValue(row.Title),
Description: stringValue(row.Description),
AltText: stringValue(row.AltText),
Priority: row.Priority,
Order: row.StoryOrder,
DownloadURL: stringValue(row.DownloadURL),
}
}