import { fetchWithAuth } from "./client"; export interface BrandScoreDimension { name: string; score: number; max_score: number; description: string; } export interface BrandScore { overall_score: number; dimensions: BrandScoreDimension[]; generated_at: string; } export interface BrandCompareCompetitor { name: string; scores: Record; } export interface BrandCompare { brand_name: string; competitors: BrandCompareCompetitor[]; dimensions: string[]; } export interface ScoreHistoryEntry { date: string; overall_score: number; dimension_scores: Record; } export interface ScoreHistory { scores: ScoreHistoryEntry[]; } export const scoringApi = { getScore: (token: string, brandId: string) => fetchWithAuth(`/api/v1/brands/${brandId}/score/`, {}, token) as Promise, getHistory: (token: string, brandId: string) => fetchWithAuth(`/api/v1/brands/${brandId}/score/history/`, {}, token) as Promise, getCompare: (token: string, brandId: string) => fetchWithAuth(`/api/v1/brands/${brandId}/compare/`, {}, token) as Promise, };