refactor(insights): drop the unused metric-to-insight key helper

The identity-cast helper had no caller and tripped the dead-code gate.
Remove it and its now-orphaned type import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc-André BombeckandClaude Opus 4.8 committed 2026-06-02 13:32:30 +02:00
1 parent 78b76d2ac5
commit 5827ef58cb
1 file changed
-15
@@ -36,7 +36,6 @@
* collect.
*/
import type { MeasurementType } from "@/generated/prisma/client";
import type { InsightMetric } from "@/lib/insights/metric-availability";
/** The five shared archetypes plus the dedicated sleep template. */
export type MetricArchetype =
@@ -435,17 +434,3 @@ export function metricStatusScope(
): `metric:${MetricStatusMetricId}` {
return `metric:${metric}`;
}
/**
* Map a generic metric id to its `InsightMetric` key so the shared
* `hasMetricData` gate can answer the data-availability question with no
* new branch. The two vocabularies line up one-to-one for every
* registered metric except `STEPS` / `ACTIVE_ENERGY`, whose
* `InsightMetric` keys match the id directly (the divergence is only at
* the `MeasurementType` layer, which `hasMetricData` does not consult).
*/
export function metricStatusInsightKey(
metric: MetricStatusMetricId,
): InsightMetric {
return metric as InsightMetric;
}