diff --git a/docs/api.md b/docs/api.md index 6c35781..9343ce4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -273,7 +273,7 @@ Outlook fields: | --- | --- | --- | | `id`, `provider`, `product`, `outlookType`, `label` | string | required when an outlook is present | | `day` | integer | SPC outlook day | -| `labelText`, `forecaster`, `headline`, `summary`, `discussion` | string | optional | +| `labelText`, `forecaster` | string | optional | | `severityRank` | integer | optional | | `validFrom`, `validTo`, `issuedAt`, `expiresAt` | RFC3339 datetime | required when an outlook is present | | `sourceUrl`, `imageUrl` | string | optional | diff --git a/docs/integrations/weatherfeeder-postgres.md b/docs/integrations/weatherfeeder-postgres.md index 210fef5..120db2a 100644 --- a/docs/integrations/weatherfeeder-postgres.md +++ b/docs/integrations/weatherfeeder-postgres.md @@ -160,8 +160,8 @@ routes. `outlook_index`, `outlook_id`, `provider`, `product`, `day`, `outlook_type`, `label`, `label_text`, `severity_rank`, `valid_from`, `valid_to`, `issued_at`, -`expires_at`, `forecaster`, `headline`, `summary`, `discussion`, `source_url`, -`image_url`, `contains_location`, `geometry_json`, and `run_event_id`. +`expires_at`, `forecaster`, `source_url`, `image_url`, `contains_location`, +`geometry_json`, and `run_event_id`. `geometry_json` is copied into response GeoJSON without parsing or reserializing. It must contain valid JSON. diff --git a/go.mod b/go.mod index 60c9bea..9f93cf9 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.5 require ( gitea.maximumdirect.net/ejr/feedapi v0.1.0 - gitea.maximumdirect.net/ejr/weatherfeeder v0.11.0 + gitea.maximumdirect.net/ejr/weatherfeeder v0.11.1-0.20260612044033-4358a7cdce2c github.com/lib/pq v1.10.9 ) diff --git a/go.sum b/go.sum index db2b0fe..ef18244 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ gitea.maximumdirect.net/ejr/feedapi v0.1.0 h1:ZB5QWKD5DPFV3P7vyeJqXPMcSWN9qHkDUHw1LgN9hwY= gitea.maximumdirect.net/ejr/feedapi v0.1.0/go.mod h1:3fIaFFx4ywt0TWbN8DIIBAHJn7ZQUm6PNcceqRgy3bw= -gitea.maximumdirect.net/ejr/weatherfeeder v0.11.0 h1:4hRiktLMFS8Arl98j21YYskXT8RHHQGFDPJxOF3CpwU= -gitea.maximumdirect.net/ejr/weatherfeeder v0.11.0/go.mod h1:VVtuwrbddWdUu21ovCSSojhH5J9P6kk0/dfnFqC4/Lw= +gitea.maximumdirect.net/ejr/weatherfeeder v0.11.1-0.20260612044033-4358a7cdce2c h1:rsAqwmsd2QswAJpfEYi8IStkc+7mlxWGyMKppmjO7m0= +gitea.maximumdirect.net/ejr/weatherfeeder v0.11.1-0.20260612044033-4358a7cdce2c/go.mod h1:VVtuwrbddWdUu21ovCSSojhH5J9P6kk0/dfnFqC4/Lw= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/internal/adapters/inbound/httpapi/presenter/outlook.go b/internal/adapters/inbound/httpapi/presenter/outlook.go index d0bd1b9..a145b89 100644 --- a/internal/adapters/inbound/httpapi/presenter/outlook.go +++ b/internal/adapters/inbound/httpapi/presenter/outlook.go @@ -44,9 +44,6 @@ func copyOutlook(outlook model.WeatherOutlook, tz *time.Location) model.WeatherO IssuedAt: inLocationTime(outlook.IssuedAt, tz), ExpiresAt: inLocationTime(outlook.ExpiresAt, tz), Forecaster: outlook.Forecaster, - Headline: outlook.Headline, - Summary: outlook.Summary, - Discussion: outlook.Discussion, SourceURL: outlook.SourceURL, ImageURL: outlook.ImageURL, ContainsLocation: outlook.ContainsLocation, diff --git a/internal/adapters/inbound/httpapi/presenter/payload_test.go b/internal/adapters/inbound/httpapi/presenter/payload_test.go index 92c7aac..7984e3e 100644 --- a/internal/adapters/inbound/httpapi/presenter/payload_test.go +++ b/internal/adapters/inbound/httpapi/presenter/payload_test.go @@ -465,9 +465,6 @@ func TestOutlookRunPayloadTimezoneConversionAndCopySemantics(t *testing.T) { IssuedAt: issuedAt, ExpiresAt: asOf.Add(6 * time.Hour), Forecaster: "DIAL", - Headline: "Severe storms possible", - Summary: "Scattered severe storms are possible.", - Discussion: "Discussion text.", SourceURL: "https://example.test/source", ImageURL: "https://example.test/image.png", ContainsLocation: true, diff --git a/internal/adapters/outbound/postgres/outlooks_mapper.go b/internal/adapters/outbound/postgres/outlooks_mapper.go index 5777ca8..1cfb5b4 100644 --- a/internal/adapters/outbound/postgres/outlooks_mapper.go +++ b/internal/adapters/outbound/postgres/outlooks_mapper.go @@ -41,9 +41,6 @@ func mapOutlookRow(row outlookRow) (model.WeatherOutlook, error) { IssuedAt: row.IssuedAt.UTC(), ExpiresAt: row.ExpiresAt.UTC(), Forecaster: stringValue(row.Forecaster), - Headline: stringValue(row.Headline), - Summary: stringValue(row.Summary), - Discussion: stringValue(row.Discussion), SourceURL: stringValue(row.SourceURL), ImageURL: stringValue(row.ImageURL), ContainsLocation: row.ContainsLocation, diff --git a/internal/adapters/outbound/postgres/outlooks_mapper_test.go b/internal/adapters/outbound/postgres/outlooks_mapper_test.go index 34a1bdd..be8ff78 100644 --- a/internal/adapters/outbound/postgres/outlooks_mapper_test.go +++ b/internal/adapters/outbound/postgres/outlooks_mapper_test.go @@ -79,9 +79,6 @@ func TestMapOutlookRowMapsFields(t *testing.T) { IssuedAt: issuedAt, ExpiresAt: expiresAt, Forecaster: sql.NullString{String: "DIAL", Valid: true}, - Headline: sql.NullString{String: "Severe storms possible", Valid: true}, - Summary: sql.NullString{String: "Scattered severe storms are possible.", Valid: true}, - Discussion: sql.NullString{String: "Discussion text.", Valid: true}, SourceURL: sql.NullString{String: "https://www.spc.noaa.gov/products/outlook/day1otlk.html", Valid: true}, ImageURL: sql.NullString{String: "https://www.spc.noaa.gov/products/outlook/day1otlk.gif", Valid: true}, ContainsLocation: true, @@ -103,8 +100,8 @@ func TestMapOutlookRowMapsFields(t *testing.T) { if outlook.SeverityRank == nil || *outlook.SeverityRank != int(severityRank) { t.Fatalf("expected severity rank %d, got %v", severityRank, outlook.SeverityRank) } - if outlook.Forecaster != "DIAL" || outlook.Headline == "" || outlook.Summary == "" || outlook.Discussion == "" { - t.Fatalf("unexpected text fields: %+v", outlook) + if outlook.Forecaster != "DIAL" { + t.Fatalf("unexpected forecaster: %+v", outlook) } if outlook.SourceURL == "" || outlook.ImageURL == "" { t.Fatalf("expected source and image URLs: %+v", outlook) @@ -142,8 +139,7 @@ func TestMapOutlookRowMissingOptionals(t *testing.T) { t.Fatalf("unexpected error: %v", err) } - if outlook.LabelText != "" || outlook.Forecaster != "" || outlook.Headline != "" || - outlook.Summary != "" || outlook.Discussion != "" || outlook.SourceURL != "" || outlook.ImageURL != "" { + if outlook.LabelText != "" || outlook.Forecaster != "" || outlook.SourceURL != "" || outlook.ImageURL != "" { t.Fatalf("expected optional strings to map to empty values, got %+v", outlook) } if outlook.SeverityRank != nil { diff --git a/internal/adapters/outbound/postgres/outlooks_queries.go b/internal/adapters/outbound/postgres/outlooks_queries.go index dff648e..6c0d9ba 100644 --- a/internal/adapters/outbound/postgres/outlooks_queries.go +++ b/internal/adapters/outbound/postgres/outlooks_queries.go @@ -32,9 +32,6 @@ SELECT issued_at, expires_at, forecaster, - headline, - summary, - discussion, source_url, image_url, contains_location, diff --git a/internal/adapters/outbound/postgres/outlooks_read.go b/internal/adapters/outbound/postgres/outlooks_read.go index 29f9f07..38866d6 100644 --- a/internal/adapters/outbound/postgres/outlooks_read.go +++ b/internal/adapters/outbound/postgres/outlooks_read.go @@ -68,9 +68,6 @@ func (r *Repository) loadOutlooks(ctx context.Context, eventID string) ([]model. &row.IssuedAt, &row.ExpiresAt, &row.Forecaster, - &row.Headline, - &row.Summary, - &row.Discussion, &row.SourceURL, &row.ImageURL, &row.ContainsLocation, diff --git a/internal/adapters/outbound/postgres/outlooks_rows.go b/internal/adapters/outbound/postgres/outlooks_rows.go index cfcef01..9110324 100644 --- a/internal/adapters/outbound/postgres/outlooks_rows.go +++ b/internal/adapters/outbound/postgres/outlooks_rows.go @@ -32,9 +32,6 @@ type outlookRow struct { IssuedAt time.Time ExpiresAt time.Time Forecaster sql.NullString - Headline sql.NullString - Summary sql.NullString - Discussion sql.NullString SourceURL sql.NullString ImageURL sql.NullString ContainsLocation bool diff --git a/internal/app/service_test.go b/internal/app/service_test.go index e65cf09..c7b2102 100644 --- a/internal/app/service_test.go +++ b/internal/app/service_test.go @@ -396,9 +396,6 @@ func testOutlook(id string, day int, outlookType string, containsLocation bool, IssuedAt: validFrom.Add(-time.Hour), ExpiresAt: validTo, Forecaster: "DIAL", - Headline: id + " headline", - Summary: id + " summary", - Discussion: id + " discussion", SourceURL: "https://example.test/" + id, ImageURL: "https://example.test/" + id + ".png", ContainsLocation: containsLocation, diff --git a/templates/outlooks_convective.txt.tmpl b/templates/outlooks_convective.txt.tmpl index 6c31c7a..6512d80 100644 --- a/templates/outlooks_convective.txt.tmpl +++ b/templates/outlooks_convective.txt.tmpl @@ -15,12 +15,6 @@ Contains Location: {{$outlook.ContainsLocation}} {{- if $outlook.LabelText}} Label Text: {{$outlook.LabelText}} {{- end}} -{{- if $outlook.Headline}} -Headline: {{$outlook.Headline}} -{{- end}} -{{- if $outlook.Summary}} -Summary: {{$outlook.Summary}} -{{- end}} {{- if $outlook.SourceURL}} Source URL: {{$outlook.SourceURL}} {{- end}}