feat: refactor TFS integration structure and add scheduler functionality

- Updated TFS service imports to a new directory structure for better organization.
- Introduced new API routes for TFS scheduler configuration and status retrieval.
- Implemented TFS scheduler logic to manage automatic synchronization based on user preferences.
- Added components for TFS configuration and scheduler management, enhancing user interaction with TFS settings.
- Removed deprecated TfsSync component, consolidating functionality into the new structure.
This commit is contained in:
Julien Froidefond
2025-10-03 08:15:12 +02:00
parent f4c6b1181f
commit a1f82a4c9b
17 changed files with 975 additions and 223 deletions

View File

@@ -0,0 +1,30 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/lib/auth';
import { tfsScheduler } from '@/services/integrations/tfs/scheduler';
/**
* GET /api/tfs/scheduler-status
* Récupère le statut du scheduler TFS
*/
export async function GET() {
try {
const session = await getServerSession(authOptions);
if (!session?.user?.id) {
return NextResponse.json({ success: false, error: 'Non authentifié' }, { status: 401 });
}
const status = await tfsScheduler.getStatus(session.user.id);
return NextResponse.json({
success: true,
data: status
});
} catch (error) {
console.error('Erreur récupération statut scheduler TFS:', error);
return NextResponse.json({
success: false,
error: error instanceof Error ? error.message : 'Erreur lors de la récupération'
}, { status: 500 });
}
}