Files
weatherfeeder/internal/standards/schema.go
Eric Rakestraw 00e811f8f7 normalizers/nws: add NWS alerts normalizer and canonical alert mapping
- Introduce AlertsNormalizer to convert Raw NWS Alerts (SchemaRawNWSAlertsV1)
  into canonical WeatherAlert runs (SchemaWeatherAlertV1)
- Add minimal NWS alerts response/types to support GeoJSON FeatureCollection parsing
- Map NWS alert properties (event, headline, severity, timing, area, references)
  into model.WeatherAlert with best-effort timestamp handling
- Establish clear AsOf / EffectiveAt policy for alert runs to support stable
  deduplication and snapshot semantics
- Register the new alerts normalizer alongside existing NWS observation and
  forecast normalizers
2026-01-16 21:40:20 -06:00

29 lines
1.1 KiB
Go

package standards
// Schema strings used by weatherfeeder.
//
// We standardize on schema matching for normalizers (rather than matching on
// source names or kinds) because schema strings are explicit, versionable, and
// independent of user configuration.
//
// Conventions:
// - Raw upstream payloads: "raw.<provider>.<thing>.vN"
// - Canonical domain events: "weather.<kind>.vN"
const (
// Raw upstream schemas (emitted by sources).
SchemaRawNWSObservationV1 = "raw.nws.observation.v1"
SchemaRawOpenMeteoCurrentV1 = "raw.openmeteo.current.v1"
SchemaRawOpenWeatherCurrentV1 = "raw.openweather.current.v1"
SchemaRawNWSHourlyForecastV1 = "raw.nws.hourly.forecast.v1"
SchemaRawOpenMeteoHourlyForecastV1 = "raw.openmeteo.hourly.forecast.v1"
SchemaRawOpenWeatherHourlyForecastV1 = "raw.openweather.hourly.forecast.v1"
SchemaRawNWSAlertsV1 = "raw.nws.alerts.v1"
// Canonical domain schemas (emitted after normalization).
SchemaWeatherObservationV1 = "weather.observation.v1"
SchemaWeatherForecastV1 = "weather.forecast.v1"
SchemaWeatherAlertV1 = "weather.alert.v1"
)