refactor: remove deprecated weekly summary components and related services

- Deleted `WeeklySummaryClient`, `VelocityMetrics`, `PeriodSelector`, and associated services to streamline the codebase.
- Removed the `weekly-summary` API route and related PDF export functionality, as these features are no longer in use.
- Updated `TODO.md` to reflect the removal of these components and their functionalities.
This commit is contained in:
Julien Froidefond
2025-09-19 15:26:20 +02:00
parent 888e81d15d
commit 9d0b6da3a0
9 changed files with 0 additions and 1587 deletions

View File

@@ -1,36 +0,0 @@
import { NextRequest, NextResponse } from 'next/server';
import { WeeklySummaryService } from '@/services/weekly-summary';
export async function GET(request: NextRequest) {
try {
const { searchParams } = new URL(request.url);
const periodParam = searchParams.get('period');
// Valider le paramètre de période
let periodDays = 7; // Défaut: 7 jours
if (periodParam) {
const parsedPeriod = parseInt(periodParam, 10);
if (!isNaN(parsedPeriod) && parsedPeriod > 0 && parsedPeriod <= 365) {
periodDays = parsedPeriod;
}
}
console.log(`📊 API weekly-summary appelée avec période: ${periodDays} jours`);
const summary = await WeeklySummaryService.getWeeklySummary(periodDays);
return NextResponse.json(summary, {
headers: {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0'
}
});
} catch (error) {
console.error('Erreur lors de la génération du résumé hebdomadaire:', error);
return NextResponse.json(
{ error: 'Erreur lors de la génération du résumé' },
{ status: 500 }
);
}
}

View File

@@ -1,20 +0,0 @@
import { Header } from '@/components/ui/Header';
import WeeklySummaryClient from '@/components/dashboard/WeeklySummaryClient';
import { WeeklySummaryService } from '@/services/weekly-summary';
export default async function WeeklySummaryPage() {
// Récupération côté serveur
const summary = await WeeklySummaryService.getWeeklySummary();
return (
<div className="min-h-screen bg-[var(--background)]">
<Header />
<div className="container mx-auto px-4 py-8">
<div className="max-w-6xl mx-auto">
<WeeklySummaryClient initialSummary={summary} />
</div>
</div>
</div>
);
}