From b1d361e31b4762a215d9f544abf664e38faabfb1 Mon Sep 17 00:00:00 2001 From: Astrid Gealer Date: Mon, 26 Oct 2026 09:41:22 +0000 Subject: [PATCH] refactor(api): delete the never-constructed HistorySummaryAnalytics type HistorySummaryAnalytics declared total_period_savings, average_savings_per_period and peak_savings, but nothing ever built it: GET /history/analytics returns *HistorySummary. The frontend stopped reading those keys in an earlier #276 change, so the type is dead and only suggested a wire contract that never existed. The OpenAPI AnalyticsResponse.summary already references HistorySummary, so the spec needs no change. Co-Authored-By: Claude Opus 5.5 --- internal/api/types.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/api/types.go b/internal/api/types.go index b3f7e9ab0..544537c46 100644 --- a/internal/api/types.go +++ b/internal/api/types.go @@ -115,15 +115,6 @@ type HistoryDataPoint struct { CumulativeSavings float64 `json:"cumulative_savings"` } -// HistorySummaryAnalytics contains aggregated statistics for analytics. -type HistorySummaryAnalytics struct { - TotalPeriodSavings float64 `json:"total_period_savings"` - TotalUpfrontSpent float64 `json:"total_upfront_spent"` - PurchaseCount int `json:"purchase_count"` - AverageSavingsPerPeriod float64 `json:"average_savings_per_period"` - PeakSavings float64 `json:"peak_savings"` -} - // BreakdownValue represents savings breakdown by dimension. type BreakdownValue struct { TotalSavings float64 `json:"total_savings"`