Cleanup outlook endpoints and completed roadmap documentation
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-06-12 09:40:49 -05:00
parent 6316783c3a
commit f4dd701204
11 changed files with 43 additions and 429 deletions

View File

@@ -25,10 +25,9 @@ type Repository interface {
// OutlookFilter selects outlook entries from the latest convective outlook run.
type OutlookFilter struct {
Day *int
OutlookType string
ContainsLocation *bool
ActiveAt *time.Time
Day *int
OutlookType string
ActiveAt *time.Time
}
// Service provides weather read use-cases.
@@ -120,9 +119,6 @@ func matchesOutlookFilter(outlook model.WeatherOutlook, filter OutlookFilter) bo
if filter.OutlookType != "" && outlook.OutlookType != normalizeOutlookType(filter.OutlookType) {
return false
}
if filter.ContainsLocation != nil && outlook.ContainsLocation != *filter.ContainsLocation {
return false
}
if filter.ActiveAt != nil && (filter.ActiveAt.Before(outlook.ValidFrom) || !filter.ActiveAt.Before(outlook.ValidTo)) {
return false
}

View File

@@ -358,32 +358,6 @@ func TestServiceLatestConvectiveOutlookFiltersByOutlookType(t *testing.T) {
assertDiscussionDays(t, run, []int{1})
}
func TestServiceLatestConvectiveOutlookFiltersByContainsLocation(t *testing.T) {
containsLocation := true
repo := &fakeRepository{outlookRun: testOutlookRun()}
svc := NewService(repo)
run, err := svc.LatestConvectiveOutlook(context.Background(), OutlookFilter{ContainsLocation: &containsLocation})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
assertOutlookIDs(t, run, []string{"cat-1", "tor-1", "day-2"})
assertDiscussionDays(t, run, []int{1, 2})
}
func TestServiceLatestConvectiveOutlookContainsLocationFalseReturnsEmptyRun(t *testing.T) {
containsLocation := false
repo := &fakeRepository{outlookRun: testOutlookRun()}
svc := NewService(repo)
run, err := svc.LatestConvectiveOutlook(context.Background(), OutlookFilter{ContainsLocation: &containsLocation})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
assertOutlookIDs(t, run, nil)
assertDiscussionDays(t, run, nil)
}
func TestServiceLatestConvectiveOutlookFiltersByActiveAt(t *testing.T) {
activeAt := time.Date(2026, 6, 11, 15, 0, 0, 0, time.UTC)
repo := &fakeRepository{outlookRun: testOutlookRun()}
@@ -399,16 +373,14 @@ func TestServiceLatestConvectiveOutlookFiltersByActiveAt(t *testing.T) {
func TestServiceLatestConvectiveOutlookCombinesFilters(t *testing.T) {
day := 1
containsLocation := true
activeAt := time.Date(2026, 6, 11, 15, 0, 0, 0, time.UTC)
repo := &fakeRepository{outlookRun: testOutlookRun()}
svc := NewService(repo)
run, err := svc.LatestConvectiveOutlook(context.Background(), OutlookFilter{
Day: &day,
OutlookType: "categorical",
ContainsLocation: &containsLocation,
ActiveAt: &activeAt,
Day: &day,
OutlookType: "categorical",
ActiveAt: &activeAt,
})
if err != nil {
t.Fatalf("unexpected error: %v", err)