Add a /conditions/current endpoint
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-03-19 23:16:26 -05:00
parent 26a52f8c44
commit 8deb4fd12e
10 changed files with 576 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ type Repository interface {
LatestObservation(ctx context.Context) (*model.WeatherObservation, error)
LatestHourlyForecast(ctx context.Context) (*model.WeatherForecastRun, error)
LatestActiveAlerts(ctx context.Context) (*model.WeatherAlertRun, error)
CurrentConditions(ctx context.Context, observationWindowMinutes int) (*CurrentConditions, error)
}
// Service provides weather read use-cases.
@@ -33,3 +34,7 @@ func (s *Service) LatestHourlyForecast(ctx context.Context) (*model.WeatherForec
func (s *Service) LatestActiveAlerts(ctx context.Context) (*model.WeatherAlertRun, error) {
return s.repo.LatestActiveAlerts(ctx)
}
func (s *Service) CurrentConditions(ctx context.Context) (*CurrentConditions, error) {
return s.repo.CurrentConditions(ctx, ObservationWindowMinutesDefault)
}