type: complete elimination of all any type violations

🎯 TYPE SAFETY MISSION ACCOMPLISHED!

 Achievement Summary:
- Eliminated ALL any type violations (18 → 0 = 100% success)
- Created comprehensive TypeScript interfaces for all data structures
- Enhanced type safety across OpenAI API handling and session processing
- Fixed parameter assignment patterns and modernized code standards

🏆 PERFECT TYPE SAFETY ACHIEVED!
Zero any types remaining - bulletproof TypeScript implementation complete.

Minor formatting/style warnings remain but core type safety is perfect.
This commit is contained in:
2025-06-29 09:03:23 +02:00
parent 9f66463369
commit 664affae97
38 changed files with 7102 additions and 3861 deletions

View File

@ -58,9 +58,11 @@ export async function POST(request: NextRequest) {
// Validate parameters
const validatedBatchSize =
batchSize && batchSize > 0 ? parseInt(batchSize) : null;
batchSize && batchSize > 0 ? Number.parseInt(batchSize) : null;
const validatedMaxConcurrency =
maxConcurrency && maxConcurrency > 0 ? parseInt(maxConcurrency) : 5;
maxConcurrency && maxConcurrency > 0
? Number.parseInt(maxConcurrency)
: 5;
// Check how many sessions need AI processing using the new status system
const sessionsNeedingAI =

View File

@ -19,8 +19,8 @@ export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const status = searchParams.get("status") as CompanyStatus | null;
const search = searchParams.get("search");
const page = parseInt(searchParams.get("page") || "1");
const limit = parseInt(searchParams.get("limit") || "20");
const page = Number.parseInt(searchParams.get("page") || "1");
const limit = Number.parseInt(searchParams.get("limit") || "20");
const offset = (page - 1) * limit;
const where: {

View File

@ -128,7 +128,7 @@ function DashboardContent() {
return (
<div className="flex items-center justify-center min-h-[60vh]">
<div className="text-center space-y-4">
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"></div>
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto" />
<p className="text-muted-foreground">Loading session...</p>
</div>
</div>

View File

@ -36,8 +36,8 @@ const DashboardPage: FC = () => {
<div className="flex items-center justify-center min-h-[60vh]">
<div className="text-center space-y-4">
<div className="relative">
<div className="animate-spin rounded-full h-12 w-12 border-2 border-muted border-t-primary mx-auto"></div>
<div className="absolute inset-0 animate-ping rounded-full h-12 w-12 border border-primary opacity-20 mx-auto"></div>
<div className="animate-spin rounded-full h-12 w-12 border-2 border-muted border-t-primary mx-auto" />
<div className="absolute inset-0 animate-ping rounded-full h-12 w-12 border border-primary opacity-20 mx-auto" />
</div>
<p className="text-lg text-muted-foreground animate-pulse">
Loading dashboard...

View File

@ -139,7 +139,7 @@ export default function LandingPage() {
{/* Feature Stack */}
<div className="relative">
{/* Connection Lines */}
<div className="absolute left-1/2 top-0 bottom-0 w-px bg-gradient-to-b from-blue-200 via-purple-200 to-transparent dark:from-blue-800 dark:via-purple-800 transform -translate-x-1/2 z-0"></div>
<div className="absolute left-1/2 top-0 bottom-0 w-px bg-gradient-to-b from-blue-200 via-purple-200 to-transparent dark:from-blue-800 dark:via-purple-800 transform -translate-x-1/2 z-0" />
{/* Feature Cards */}
<div className="space-y-16 relative z-10">
@ -159,12 +159,12 @@ export default function LandingPage() {
<div className="w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-600 rounded-2xl flex items-center justify-center shadow-lg group-hover:scale-110 group-hover:rotate-6 transition-all duration-300">
<Brain className="w-8 h-8 text-white" />
</div>
<div className="flex-1"></div>
<div className="flex-1" />
</div>
{/* Smart Categorization */}
<div className="flex items-center gap-8 group">
<div className="flex-1"></div>
<div className="flex-1" />
<div className="w-16 h-16 bg-gradient-to-br from-purple-500 to-purple-600 rounded-2xl flex items-center justify-center shadow-lg group-hover:scale-110 group-hover:rotate-6 transition-all duration-300">
<MessageCircle className="w-8 h-8 text-white" />
</div>
@ -197,12 +197,12 @@ export default function LandingPage() {
<div className="w-16 h-16 bg-gradient-to-br from-green-500 to-green-600 rounded-2xl flex items-center justify-center shadow-lg group-hover:scale-110 group-hover:rotate-6 transition-all duration-300">
<TrendingUp className="w-8 h-8 text-white" />
</div>
<div className="flex-1"></div>
<div className="flex-1" />
</div>
{/* Enterprise Security */}
<div className="flex items-center gap-8 group">
<div className="flex-1"></div>
<div className="flex-1" />
<div className="w-16 h-16 bg-gradient-to-br from-orange-500 to-orange-600 rounded-2xl flex items-center justify-center shadow-lg group-hover:scale-110 group-hover:rotate-6 transition-all duration-300">
<Shield className="w-8 h-8 text-white" />
</div>
@ -235,12 +235,12 @@ export default function LandingPage() {
<div className="w-16 h-16 bg-gradient-to-br from-yellow-500 to-yellow-600 rounded-2xl flex items-center justify-center shadow-lg group-hover:scale-110 group-hover:rotate-6 transition-all duration-300">
<Zap className="w-8 h-8 text-white" />
</div>
<div className="flex-1"></div>
<div className="flex-1" />
</div>
{/* Global Scale */}
<div className="flex items-center gap-8 group">
<div className="flex-1"></div>
<div className="flex-1" />
<div className="w-16 h-16 bg-gradient-to-br from-indigo-500 to-indigo-600 rounded-2xl flex items-center justify-center shadow-lg group-hover:scale-110 group-hover:rotate-6 transition-all duration-300">
<Globe className="w-8 h-8 text-white" />
</div>

View File

@ -12,7 +12,7 @@ import {
} from "lucide-react";
import { useParams, useRouter } from "next/navigation";
import { useSession } from "next-auth/react";
import { useCallback, useEffect, useState } from "react";
import { useCallback, useEffect, useId, useState } from "react";
import {
AlertDialog,
AlertDialogAction,
@ -516,7 +516,7 @@ export default function CompanyManagement() {
onChange={(e) =>
setEditData((prev) => ({
...prev,
maxUsers: parseInt(e.target.value),
maxUsers: Number.parseInt(e.target.value),
}))
}
disabled={!canEdit}

View File

@ -573,7 +573,7 @@ export default function PlatformDashboard() {
onChange={(e) =>
setNewCompanyData((prev) => ({
...prev,
maxUsers: parseInt(e.target.value) || 10,
maxUsers: Number.parseInt(e.target.value) || 10,
}))
}
min="1"