Files
weatherapi/internal/adapters/outbound/postgres/alerts_rows.go
Eric Rakestraw 2a33fe01cf
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
Update to support upstream weatherfeeder v0.12.1 and add ends field to the alerts schema
2026-06-16 20:08:03 -05:00

61 lines
1.4 KiB
Go

// alerts_rows.go defines row DTOs for alert-run, alert, and reference reads.
// Layer: adapters/outbound/postgres alerts feature.
package postgres
import (
"database/sql"
"time"
"gitea.maximumdirect.net/ejr/weatherfeeder/model"
)
type alertRunParentRow struct {
EventID string
LocationID sql.NullString
LocationName sql.NullString
AsOf time.Time
Latitude sql.NullFloat64
Longitude sql.NullFloat64
}
type alertRow struct {
AlertIndex int
AlertID string
Event sql.NullString
Headline sql.NullString
Severity sql.NullString
Urgency sql.NullString
Certainty sql.NullString
Status sql.NullString
MessageType sql.NullString
Category sql.NullString
Response sql.NullString
Description sql.NullString
Instruction sql.NullString
Sent sql.NullTime
Effective sql.NullTime
Onset sql.NullTime
Ends sql.NullTime
Expires sql.NullTime
AreaDescription sql.NullString
SenderName sql.NullString
}
type indexedAlert struct {
Index int
Alert model.WeatherAlert
}
type alertReferenceRow struct {
AlertIndex int
ID sql.NullString
Identifier sql.NullString
Sender sql.NullString
Sent sql.NullTime
}
type indexedAlertReference struct {
AlertIndex int
Reference model.AlertReference
}