Implemented weather stories support
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
28
internal/adapters/outbound/postgres/weatherstories_mapper.go
Normal file
28
internal/adapters/outbound/postgres/weatherstories_mapper.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// 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),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user