From a213a5cf9ff4d087abca36177e0b67e3100c6e22 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 17 Dec 2025 14:40:46 +0100 Subject: [PATCH] make website run --- .../app/auth/iracing/callback/route.ts | 1 - apps/website/app/dashboard/page.tsx | 1 - apps/website/app/drivers/[id]/page.tsx | 7 - apps/website/app/drivers/page.tsx | 1 - apps/website/app/layout.tsx | 7 +- .../website/app/leaderboards/drivers/page.tsx | 1 - apps/website/app/leaderboards/page.tsx | 1 - apps/website/app/leagues/[id]/layout.tsx | 8 - apps/website/app/leagues/[id]/page.tsx | 13 - .../app/leagues/[id]/rulebook/page.tsx | 4 - .../app/leagues/[id]/schedule/page.tsx | 1 - .../app/leagues/[id]/settings/page.tsx | 10 - .../app/leagues/[id]/sponsorships/page.tsx | 4 - .../app/leagues/[id]/standings/page.tsx | 5 - .../app/leagues/[id]/stewarding/page.tsx | 9 - .../stewarding/protests/[protestId]/page.tsx | 10 - apps/website/app/leagues/page.tsx | 2 +- apps/website/app/onboarding/page.tsx | 1 - apps/website/app/page.tsx | 15 +- apps/website/app/profile/leagues/page.tsx | 1 - apps/website/app/profile/page.tsx | 5 - .../app/profile/sponsorship-requests/page.tsx | 11 +- apps/website/app/teams/[id]/page.tsx | 8 +- apps/website/app/teams/leaderboard/page.tsx | 1 - apps/website/app/teams/page.tsx | 1 - apps/website/components/dev/DevToolbar.tsx | 239 +++++++++--------- .../components/drivers/CreateDriverForm.tsx | 1 - .../components/drivers/DriverIdentity.tsx | 1 - .../components/drivers/DriverProfile.tsx | 1 - .../components/drivers/ProfileRaceHistory.tsx | 1 - .../components/drivers/ProfileStats.tsx | 1 - apps/website/components/feed/FeedItemCard.tsx | 1 - .../components/leagues/CreateLeagueForm.tsx | 1 - .../components/leagues/CreateLeagueWizard.tsx | 4 +- .../components/leagues/JoinLeagueButton.tsx | 1 - .../components/leagues/LeagueActivityFeed.tsx | 1 - .../website/components/leagues/LeagueCard.tsx | 1 - .../components/leagues/LeagueHeader.tsx | 7 +- .../components/leagues/LeagueMembers.tsx | 1 - .../leagues/LeagueSponsorshipsSection.tsx | 7 +- .../components/leagues/QuickPenaltyModal.tsx | 1 - .../components/leagues/StandingsTable.tsx | 2 - .../notifications/NotificationCenter.tsx | 35 ++- .../notifications/NotificationProvider.tsx | 74 +++--- .../components/profile/DriverSummaryPill.tsx | 1 - .../components/profile/ProfileHeader.tsx | 1 - apps/website/components/profile/UserPill.tsx | 8 +- .../components/races/FileProtestModal.tsx | 1 - .../sponsors/SponsorInsightsCard.tsx | 1 - .../components/teams/CreateTeamForm.tsx | 1 - .../components/teams/JoinTeamButton.tsx | 5 - apps/website/components/teams/TeamCard.tsx | 1 - .../components/teams/TeamLadderRow.tsx | 1 - package.json | 20 +- 54 files changed, 196 insertions(+), 352 deletions(-) diff --git a/apps/website/app/auth/iracing/callback/route.ts b/apps/website/app/auth/iracing/callback/route.ts index 9a7a62876..a0c372c5b 100644 --- a/apps/website/app/auth/iracing/callback/route.ts +++ b/apps/website/app/auth/iracing/callback/route.ts @@ -1,7 +1,6 @@ import { cookies } from 'next/headers'; import { NextResponse } from 'next/server'; -import { getAuthService } from '../../../../lib/auth'; const STATE_COOKIE = 'gp_demo_auth_state'; diff --git a/apps/website/app/dashboard/page.tsx b/apps/website/app/dashboard/page.tsx index 8f2d176d0..cbf8dd365 100644 --- a/apps/website/app/dashboard/page.tsx +++ b/apps/website/app/dashboard/page.tsx @@ -25,7 +25,6 @@ import { import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; -import { getAuthService } from '@/lib/auth'; import type { DashboardOverviewViewModel, DashboardFeedItemSummaryViewModel, diff --git a/apps/website/app/drivers/[id]/page.tsx b/apps/website/app/drivers/[id]/page.tsx index 17882b022..dad75bb93 100644 --- a/apps/website/app/drivers/[id]/page.tsx +++ b/apps/website/app/drivers/[id]/page.tsx @@ -36,13 +36,6 @@ import { Megaphone, DollarSign, } from 'lucide-react'; -import { - getGetProfileOverviewUseCase, - getGetDriverTeamUseCase, - getImageService, - getGetAllTeamsUseCase, - getGetTeamMembersUseCase, -} from '@/lib/di-container'; import { AllTeamsPresenter } from '@/lib/presenters/AllTeamsPresenter'; import { TeamMembersPresenter } from '@/lib/presenters/TeamMembersPresenter'; import { Driver, EntityMappers, type Team } from '@core/racing'; diff --git a/apps/website/app/drivers/page.tsx b/apps/website/app/drivers/page.tsx index 39b099549..a41cc1fe8 100644 --- a/apps/website/app/drivers/page.tsx +++ b/apps/website/app/drivers/page.tsx @@ -27,7 +27,6 @@ import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; import Card from '@/components/ui/Card'; import Heading from '@/components/ui/Heading'; -import { getGetDriversLeaderboardUseCase } from '@/lib/di-container'; import { DriversLeaderboardPresenter } from '@/lib/presenters/DriversLeaderboardPresenter'; import type { DriverLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/IDriversLeaderboardPresenter'; import Image from 'next/image'; diff --git a/apps/website/app/layout.tsx b/apps/website/app/layout.tsx index 921f46e78..f5b467b57 100644 --- a/apps/website/app/layout.tsx +++ b/apps/website/app/layout.tsx @@ -4,14 +4,12 @@ import Image from 'next/image'; import Link from 'next/link'; import './globals.css'; import { getAppMode } from '@/lib/mode'; -import { getAuthService } from '@/lib/auth'; import { AlphaNav } from '@/components/alpha/AlphaNav'; import AlphaBanner from '@/components/alpha/AlphaBanner'; import AlphaFooter from '@/components/alpha/AlphaFooter'; import { AuthProvider } from '@/lib/auth/AuthContext'; import NotificationProvider from '@/components/notifications/NotificationProvider'; import DevToolbar from '@/components/dev/DevToolbar'; -import { initializeDIContainer } from '@/lib/di-setup'; export const dynamic = 'force-dynamic'; @@ -50,12 +48,11 @@ export default async function RootLayout({ }: { children: React.ReactNode; }) { - await initializeDIContainer(); const mode = getAppMode(); if (mode === 'alpha') { - const authService = getAuthService(); - const session = await authService.getCurrentSession(); + //const session = await authService.getCurrentSession(); + const session = null; return ( diff --git a/apps/website/app/leaderboards/drivers/page.tsx b/apps/website/app/leaderboards/drivers/page.tsx index 3b02c4865..de7efadfe 100644 --- a/apps/website/app/leaderboards/drivers/page.tsx +++ b/apps/website/app/leaderboards/drivers/page.tsx @@ -19,7 +19,6 @@ import { import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; import Heading from '@/components/ui/Heading'; -import { getGetDriversLeaderboardUseCase } from '@/lib/di-container'; import { DriversLeaderboardPresenter } from '@/lib/presenters/DriversLeaderboardPresenter'; import type { DriverLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/IDriversLeaderboardPresenter'; import Image from 'next/image'; diff --git a/apps/website/app/leaderboards/page.tsx b/apps/website/app/leaderboards/page.tsx index 3df44de8d..8b1fef1c0 100644 --- a/apps/website/app/leaderboards/page.tsx +++ b/apps/website/app/leaderboards/page.tsx @@ -20,7 +20,6 @@ import { } from 'lucide-react'; import Button from '@/components/ui/Button'; import Heading from '@/components/ui/Heading'; -import { getGetDriversLeaderboardUseCase, getGetTeamsLeaderboardUseCase } from '@/lib/di-container'; import { DriversLeaderboardPresenter } from '@/lib/presenters/DriversLeaderboardPresenter'; import { TeamsLeaderboardPresenter } from '@/lib/presenters/TeamsLeaderboardPresenter'; import type { DriverLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/IDriversLeaderboardPresenter'; diff --git a/apps/website/app/leagues/[id]/layout.tsx b/apps/website/app/leagues/[id]/layout.tsx index ad0396adf..b868e3436 100644 --- a/apps/website/app/leagues/[id]/layout.tsx +++ b/apps/website/app/leagues/[id]/layout.tsx @@ -4,14 +4,6 @@ import React, { useState, useEffect } from 'react'; import { useParams, usePathname, useRouter } from 'next/navigation'; import Breadcrumbs from '@/components/layout/Breadcrumbs'; import LeagueHeader from '@/components/leagues/LeagueHeader'; -import { - getLeagueRepository, - getDriverRepository, - getLeagueMembershipRepository, - getSeasonRepository, - getSponsorRepository, - getSeasonSponsorshipRepository, -} from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles'; import type { League } from '@core/racing/domain/entities/League'; diff --git a/apps/website/app/leagues/[id]/page.tsx b/apps/website/app/leagues/[id]/page.tsx index 513954b11..2dd816f58 100644 --- a/apps/website/app/leagues/[id]/page.tsx +++ b/apps/website/app/leagues/[id]/page.tsx @@ -23,19 +23,6 @@ import { type LeagueScoringConfigDTO, Race, } from '@core/racing'; -import { - getLeagueRepository, - getRaceRepository, - getDriverRepository, - getGetLeagueScoringConfigUseCase, - getDriverStats, - getAllDriverRankings, - getGetLeagueStatsUseCase, - getSeasonRepository, - getSponsorRepository, - getSeasonSponsorshipRepository, - getCompleteRaceUseCase, -} from '@/lib/di-container'; import { LeagueScoringConfigPresenter } from '@/lib/presenters/LeagueScoringConfigPresenter'; import { Trophy, Star, ExternalLink, Calendar, Users } from 'lucide-react'; import { getMembership, getLeagueMembers } from '@/lib/leagueMembership'; diff --git a/apps/website/app/leagues/[id]/rulebook/page.tsx b/apps/website/app/leagues/[id]/rulebook/page.tsx index ea5a1a49f..f383442ea 100644 --- a/apps/website/app/leagues/[id]/rulebook/page.tsx +++ b/apps/website/app/leagues/[id]/rulebook/page.tsx @@ -3,10 +3,6 @@ import { useState, useEffect } from 'react'; import { useParams } from 'next/navigation'; import Card from '@/components/ui/Card'; -import { - getLeagueRepository, - getGetLeagueScoringConfigUseCase -} from '@/lib/di-container'; import { LeagueScoringConfigPresenter } from '@/lib/presenters/LeagueScoringConfigPresenter'; import type { LeagueScoringConfigDTO } from '@core/racing/application/dto/LeagueScoringConfigDTO'; import type { League } from '@core/racing/domain/entities/League'; diff --git a/apps/website/app/leagues/[id]/schedule/page.tsx b/apps/website/app/leagues/[id]/schedule/page.tsx index 33da040f7..303dcc53d 100644 --- a/apps/website/app/leagues/[id]/schedule/page.tsx +++ b/apps/website/app/leagues/[id]/schedule/page.tsx @@ -6,7 +6,6 @@ import LeagueSchedule from '@/components/leagues/LeagueSchedule'; import ScheduleRaceForm from '@/components/leagues/ScheduleRaceForm'; import { useState, useEffect } from 'react'; import { useRouter } from 'next/navigation'; -import { getLeagueMembershipRepository } from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles'; diff --git a/apps/website/app/leagues/[id]/settings/page.tsx b/apps/website/app/leagues/[id]/settings/page.tsx index efa81b947..6f35dd77a 100644 --- a/apps/website/app/leagues/[id]/settings/page.tsx +++ b/apps/website/app/leagues/[id]/settings/page.tsx @@ -4,16 +4,6 @@ import { useState, useEffect, useMemo } from 'react'; import { useParams, useRouter } from 'next/navigation'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; -import { - getLeagueRepository, - getDriverRepository, - getGetLeagueFullConfigUseCase, - getLeagueMembershipRepository, - getDriverStats, - getAllDriverRankings, - getListLeagueScoringPresetsUseCase, - getTransferLeagueOwnershipUseCase -} from '@/lib/di-container'; import { LeagueFullConfigPresenter } from '@/lib/presenters/LeagueFullConfigPresenter'; import { LeagueScoringPresetsPresenter } from '@/lib/presenters/LeagueScoringPresetsPresenter'; import { useEffectiveDriverId } from '@/lib/currentDriver'; diff --git a/apps/website/app/leagues/[id]/sponsorships/page.tsx b/apps/website/app/leagues/[id]/sponsorships/page.tsx index 997514d27..a5f7c9d25 100644 --- a/apps/website/app/leagues/[id]/sponsorships/page.tsx +++ b/apps/website/app/leagues/[id]/sponsorships/page.tsx @@ -5,10 +5,6 @@ import { useParams } from 'next/navigation'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import { LeagueSponsorshipsSection } from '@/components/leagues/LeagueSponsorshipsSection'; -import { - getLeagueRepository, - getLeagueMembershipRepository, -} from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles'; import { AlertTriangle, Building, DollarSign } from 'lucide-react'; diff --git a/apps/website/app/leagues/[id]/standings/page.tsx b/apps/website/app/leagues/[id]/standings/page.tsx index f09bce5de..f600c3b1d 100644 --- a/apps/website/app/leagues/[id]/standings/page.tsx +++ b/apps/website/app/leagues/[id]/standings/page.tsx @@ -9,11 +9,6 @@ import { type DriverDTO, type LeagueDriverSeasonStatsDTO, } from '@core/racing'; -import { - getGetLeagueDriverSeasonStatsUseCase, - getDriverRepository, - getLeagueMembershipRepository -} from '@/lib/di-container'; import { LeagueDriverSeasonStatsPresenter } from '@/lib/presenters/LeagueDriverSeasonStatsPresenter'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles'; diff --git a/apps/website/app/leagues/[id]/stewarding/page.tsx b/apps/website/app/leagues/[id]/stewarding/page.tsx index f9dfbc8aa..3c0148a8a 100644 --- a/apps/website/app/leagues/[id]/stewarding/page.tsx +++ b/apps/website/app/leagues/[id]/stewarding/page.tsx @@ -8,15 +8,6 @@ import Button from '@/components/ui/Button'; import { ReviewProtestModal } from '@/components/leagues/ReviewProtestModal'; import QuickPenaltyModal from '@/components/leagues/QuickPenaltyModal'; import PenaltyFAB from '@/components/leagues/PenaltyFAB'; -import { - getRaceRepository, - getProtestRepository, - getDriverRepository, - getLeagueMembershipRepository, - getReviewProtestUseCase, - getApplyPenaltyUseCase, - getPenaltyRepository -} from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles'; import type { Protest } from '@core/racing/domain/entities/Protest'; diff --git a/apps/website/app/leagues/[id]/stewarding/protests/[protestId]/page.tsx b/apps/website/app/leagues/[id]/stewarding/protests/[protestId]/page.tsx index 95871b329..d5538cd56 100644 --- a/apps/website/app/leagues/[id]/stewarding/protests/[protestId]/page.tsx +++ b/apps/website/app/leagues/[id]/stewarding/protests/[protestId]/page.tsx @@ -5,16 +5,6 @@ import { useParams, useRouter } from 'next/navigation'; import Link from 'next/link'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; -import { - getProtestRepository, - getRaceRepository, - getDriverRepository, - getLeagueMembershipRepository, - getReviewProtestUseCase, - getApplyPenaltyUseCase, - getRequestProtestDefenseUseCase, - getSendNotificationUseCase -} from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles'; import type { Protest } from '@core/racing/domain/entities/Protest'; diff --git a/apps/website/app/leagues/page.tsx b/apps/website/app/leagues/page.tsx index 3ede7922d..d10faf075 100644 --- a/apps/website/app/leagues/page.tsx +++ b/apps/website/app/leagues/page.tsx @@ -32,7 +32,7 @@ import Input from '@/components/ui/Input'; import Heading from '@/components/ui/Heading'; import type { LeagueSummaryViewModel } from '@core/racing/application/presenters/IAllLeaguesWithCapacityAndScoringPresenter'; import { AllLeaguesWithCapacityAndScoringPresenter } from '@/lib/presenters/AllLeaguesWithCapacityAndScoringPresenter'; -import { getGetAllLeaguesWithCapacityAndScoringUseCase } from '@/lib/di-container'; + // ============================================================================ // TYPES diff --git a/apps/website/app/onboarding/page.tsx b/apps/website/app/onboarding/page.tsx index de6ac2cc6..849544535 100644 --- a/apps/website/app/onboarding/page.tsx +++ b/apps/website/app/onboarding/page.tsx @@ -1,5 +1,4 @@ import { redirect } from 'next/navigation'; -import { getAuthService } from '@/lib/auth'; import OnboardingWizard from '@/components/onboarding/OnboardingWizard'; export const dynamic = 'force-dynamic'; diff --git a/apps/website/app/page.tsx b/apps/website/app/page.tsx index 0c8e27b38..d9f36599d 100644 --- a/apps/website/app/page.tsx +++ b/apps/website/app/page.tsx @@ -1,7 +1,6 @@ import { redirect } from 'next/navigation'; import { getAppMode } from '@/lib/mode'; -import { getAuthService } from '@/lib/auth'; import Hero from '@/components/landing/Hero'; import AlternatingSection from '@/components/landing/AlternatingSection'; import FeatureGrid from '@/components/landing/FeatureGrid'; @@ -15,23 +14,19 @@ import SimPlatformMockup from '@/components/mockups/SimPlatformMockup'; import MockupStack from '@/components/ui/MockupStack'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; -import { - topLeagues, - teams, - getUpcomingRaces, -} from '@core/testing-support'; export default async function HomePage() { - const authService = getAuthService(); - const session = await authService.getCurrentSession(); - + const session = null; // TODO if (session) { redirect('/dashboard'); } const mode = getAppMode(); const isAlpha = mode === 'alpha'; - const upcomingRaces = getUpcomingRaces(3); + // const upcomingRaces = getUpcomingRaces(3); + const upcomingRaces = []; // TODO + const topLeagues = []; // TODO + const teams = []; // TODO return (
diff --git a/apps/website/app/profile/leagues/page.tsx b/apps/website/app/profile/leagues/page.tsx index 8bed4c5b9..bc2963b8b 100644 --- a/apps/website/app/profile/leagues/page.tsx +++ b/apps/website/app/profile/leagues/page.tsx @@ -4,7 +4,6 @@ import { useEffect, useState } from 'react'; import Link from 'next/link'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; -import { getLeagueRepository, getLeagueMembershipRepository } from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import type { League } from '@core/racing/domain/entities/League'; import type { LeagueMembership } from '@core/racing/domain/entities/LeagueMembership'; diff --git a/apps/website/app/profile/page.tsx b/apps/website/app/profile/page.tsx index 1793aee6e..36c4cef5c 100644 --- a/apps/website/app/profile/page.tsx +++ b/apps/website/app/profile/page.tsx @@ -34,11 +34,6 @@ import { Percent, Activity, } from 'lucide-react'; -import { - getGetProfileOverviewUseCase, - getImageService, - getUpdateDriverProfileUseCase, -} from '@/lib/di-container'; import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; import type { ProfileOverviewViewModel, diff --git a/apps/website/app/profile/sponsorship-requests/page.tsx b/apps/website/app/profile/sponsorship-requests/page.tsx index 793370e65..b49c77b89 100644 --- a/apps/website/app/profile/sponsorship-requests/page.tsx +++ b/apps/website/app/profile/sponsorship-requests/page.tsx @@ -6,16 +6,7 @@ import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Breadcrumbs from '@/components/layout/Breadcrumbs'; import PendingSponsorshipRequests, { type PendingRequestDTO } from '@/components/sponsors/PendingSponsorshipRequests'; -import { - getGetPendingSponsorshipRequestsUseCase, - getAcceptSponsorshipRequestUseCase, - getRejectSponsorshipRequestUseCase, - getDriverRepository, - getLeagueRepository, - getTeamRepository, - getLeagueMembershipRepository, - getTeamMembershipRepository, -} from '@/lib/di-container'; + import { PendingSponsorshipRequestsPresenter } from '@/lib/presenters/PendingSponsorshipRequestsPresenter'; import { useEffectiveDriverId } from '@/lib/currentDriver'; import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles'; diff --git a/apps/website/app/teams/[id]/page.tsx b/apps/website/app/teams/[id]/page.tsx index d00e9930b..979b8b125 100644 --- a/apps/website/app/teams/[id]/page.tsx +++ b/apps/website/app/teams/[id]/page.tsx @@ -8,7 +8,7 @@ import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Breadcrumbs from '@/components/layout/Breadcrumbs'; import SponsorInsightsCard, { useSponsorMode, MetricBuilders, SlotTemplates } from '@/components/sponsors/SponsorInsightsCard'; -import { getImageService } from '@/lib/di-container'; + import { TeamMembersPresenter } from '@/lib/presenters/TeamMembersPresenter'; import { TeamDetailsPresenter } from '@/lib/presenters/TeamDetailsPresenter'; import type { TeamDetailsViewModel } from '@core/racing/application/presenters/ITeamDetailsPresenter'; @@ -16,11 +16,7 @@ import TeamRoster from '@/components/teams/TeamRoster'; import TeamStandings from '@/components/teams/TeamStandings'; import TeamAdmin from '@/components/teams/TeamAdmin'; import JoinTeamButton from '@/components/teams/JoinTeamButton'; -import { - getGetTeamDetailsUseCase, - getGetTeamMembersUseCase, - getTeamMembershipRepository, -} from '@/lib/di-container'; + import { useEffectiveDriverId } from '@/lib/currentDriver'; import { Users, Trophy, TrendingUp, Star, Zap } from 'lucide-react'; diff --git a/apps/website/app/teams/leaderboard/page.tsx b/apps/website/app/teams/leaderboard/page.tsx index 39c3311f0..ca4d13244 100644 --- a/apps/website/app/teams/leaderboard/page.tsx +++ b/apps/website/app/teams/leaderboard/page.tsx @@ -22,7 +22,6 @@ import { import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; import Heading from '@/components/ui/Heading'; -import { getGetTeamsLeaderboardUseCase } from '@/lib/di-container'; import { TeamsLeaderboardPresenter } from '@/lib/presenters/TeamsLeaderboardPresenter'; import type { TeamLeaderboardItemViewModel, diff --git a/apps/website/app/teams/page.tsx b/apps/website/app/teams/page.tsx index 366c38109..45866e348 100644 --- a/apps/website/app/teams/page.tsx +++ b/apps/website/app/teams/page.tsx @@ -28,7 +28,6 @@ import Card from '@/components/ui/Card'; import Input from '@/components/ui/Input'; import Heading from '@/components/ui/Heading'; import CreateTeamForm from '@/components/teams/CreateTeamForm'; -import { getGetTeamsLeaderboardUseCase } from '@/lib/di-container'; import { TeamsLeaderboardPresenter } from '@/lib/presenters/TeamsLeaderboardPresenter'; import type { TeamLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/ITeamsLeaderboardPresenter'; diff --git a/apps/website/components/dev/DevToolbar.tsx b/apps/website/components/dev/DevToolbar.tsx index 68741628d..8a45d5521 100644 --- a/apps/website/components/dev/DevToolbar.tsx +++ b/apps/website/components/dev/DevToolbar.tsx @@ -3,7 +3,6 @@ import { useState, useEffect } from 'react'; import { useRouter } from 'next/navigation'; import { useEffectiveDriverId } from '@/lib/currentDriver'; -import { getSendNotificationUseCase, getRaceRepository, getLeagueRepository } from '@/lib/di-container'; import type { NotificationUrgency } from '@core/notifications/application'; import { Bell, @@ -182,135 +181,135 @@ export default function DevToolbar() { return null; } - const handleSendNotification = async () => { - setSending(true); - try { - const sendNotification = getSendNotificationUseCase(); + // const handleSendNotification = async () => { + // setSending(true); + // try { + // const sendNotification = getSendNotificationUseCase(); - const raceRepository = getRaceRepository(); - const leagueRepository = getLeagueRepository(); + // const raceRepository = getRaceRepository(); + // const leagueRepository = getLeagueRepository(); - const [allRaces, allLeagues] = await Promise.all([ - raceRepository.findAll(), - leagueRepository.findAll(), - ]); + // const [allRaces, allLeagues] = await Promise.all([ + // raceRepository.findAll(), + // leagueRepository.findAll(), + // ]); - const completedRaces = allRaces.filter((race) => race.status === 'completed'); - const scheduledRaces = allRaces.filter((race) => race.status === 'scheduled'); + // const completedRaces = allRaces.filter((race) => race.status === 'completed'); + // const scheduledRaces = allRaces.filter((race) => race.status === 'scheduled'); - const primaryRace = completedRaces[0] ?? allRaces[0]; - const secondaryRace = scheduledRaces[0] ?? allRaces[1] ?? primaryRace; - const primaryLeague = allLeagues[0]; + // const primaryRace = completedRaces[0] ?? allRaces[0]; + // const secondaryRace = scheduledRaces[0] ?? allRaces[1] ?? primaryRace; + // const primaryLeague = allLeagues[0]; - const notificationDeadline = - selectedUrgency === 'modal' - ? new Date(Date.now() + 48 * 60 * 60 * 1000) - : undefined; + // const notificationDeadline = + // selectedUrgency === 'modal' + // ? new Date(Date.now() + 48 * 60 * 60 * 1000) + // : undefined; - let title: string; - let body: string; - let notificationType: 'protest_filed' | 'protest_defense_requested' | 'protest_vote_required' | 'race_performance_summary' | 'race_final_results'; - let actionUrl: string; + // let title: string; + // let body: string; + // let notificationType: 'protest_filed' | 'protest_defense_requested' | 'protest_vote_required' | 'race_performance_summary' | 'race_final_results'; + // let actionUrl: string; - switch (selectedType) { - case 'protest_filed': { - const raceId = primaryRace?.id; - title = '🚨 Protest Filed Against You'; - body = - 'A protest has been filed against you for unsafe rejoining during a recent race. Please review the incident details.'; - notificationType = 'protest_filed'; - actionUrl = raceId ? `/races/${raceId}/stewarding` : '/races'; - break; - } - case 'defense_requested': { - const raceId = secondaryRace?.id ?? primaryRace?.id; - title = '⚖️ Defense Requested'; - body = - 'A steward has requested your defense regarding a recent incident. Please provide your side of the story within 48 hours.'; - notificationType = 'protest_defense_requested'; - actionUrl = raceId ? `/races/${raceId}/stewarding` : '/races'; - break; - } - case 'vote_required': { - const leagueId = primaryLeague?.id; - title = '🗳️ Your Vote Required'; - body = - 'As a league steward, you are required to vote on an open protest. Please review the case and cast your vote.'; - notificationType = 'protest_vote_required'; - actionUrl = leagueId ? `/leagues/${leagueId}/stewarding` : '/leagues'; - break; - } - case 'race_performance_summary': { - const raceId = primaryRace?.id; - const leagueId = primaryLeague?.id; - title = '🏁 Race Complete: Performance Summary'; - body = - 'Your Monza Grand Prix race is finished! You finished P1 with 0 incidents. Provisional rating: +25 points. View full results and standings.'; - notificationType = 'race_performance_summary'; - actionUrl = raceId ? `/races/${raceId}` : '/races'; - break; - } - case 'race_final_results': { - const leagueId = primaryLeague?.id; - title = '🏆 Final Results: Monza Grand Prix'; - body = - 'Stewarding is now closed. Your final result: P1 (+25 rating). No penalties were applied. View championship standings.'; - notificationType = 'race_final_results'; - actionUrl = leagueId ? `/leagues/${leagueId}/standings` : '/leagues'; - break; - } - } + // switch (selectedType) { + // case 'protest_filed': { + // const raceId = primaryRace?.id; + // title = '🚨 Protest Filed Against You'; + // body = + // 'A protest has been filed against you for unsafe rejoining during a recent race. Please review the incident details.'; + // notificationType = 'protest_filed'; + // actionUrl = raceId ? `/races/${raceId}/stewarding` : '/races'; + // break; + // } + // case 'defense_requested': { + // const raceId = secondaryRace?.id ?? primaryRace?.id; + // title = '⚖️ Defense Requested'; + // body = + // 'A steward has requested your defense regarding a recent incident. Please provide your side of the story within 48 hours.'; + // notificationType = 'protest_defense_requested'; + // actionUrl = raceId ? `/races/${raceId}/stewarding` : '/races'; + // break; + // } + // case 'vote_required': { + // const leagueId = primaryLeague?.id; + // title = '🗳️ Your Vote Required'; + // body = + // 'As a league steward, you are required to vote on an open protest. Please review the case and cast your vote.'; + // notificationType = 'protest_vote_required'; + // actionUrl = leagueId ? `/leagues/${leagueId}/stewarding` : '/leagues'; + // break; + // } + // case 'race_performance_summary': { + // const raceId = primaryRace?.id; + // const leagueId = primaryLeague?.id; + // title = '🏁 Race Complete: Performance Summary'; + // body = + // 'Your Monza Grand Prix race is finished! You finished P1 with 0 incidents. Provisional rating: +25 points. View full results and standings.'; + // notificationType = 'race_performance_summary'; + // actionUrl = raceId ? `/races/${raceId}` : '/races'; + // break; + // } + // case 'race_final_results': { + // const leagueId = primaryLeague?.id; + // title = '🏆 Final Results: Monza Grand Prix'; + // body = + // 'Stewarding is now closed. Your final result: P1 (+25 rating). No penalties were applied. View championship standings.'; + // notificationType = 'race_final_results'; + // actionUrl = leagueId ? `/leagues/${leagueId}/standings` : '/leagues'; + // break; + // } + // } - const actions = - selectedUrgency === 'modal' - ? selectedType.startsWith('race_') - ? [ - { label: selectedType === 'race_performance_summary' ? '🏁 View Race Results' : '🏆 View Standings', type: 'primary' as const, href: actionUrl, actionId: 'view' }, - { label: '🎉 Share Achievement', type: 'secondary' as const, actionId: 'share' }, - ] - : [ - { label: 'View Protest', type: 'primary' as const, href: actionUrl, actionId: 'view' }, - { label: 'Dismiss', type: 'secondary' as const, actionId: 'dismiss' }, - ] - : []; + // const actions = + // selectedUrgency === 'modal' + // ? selectedType.startsWith('race_') + // ? [ + // { label: selectedType === 'race_performance_summary' ? '🏁 View Race Results' : '🏆 View Standings', type: 'primary' as const, href: actionUrl, actionId: 'view' }, + // { label: '🎉 Share Achievement', type: 'secondary' as const, actionId: 'share' }, + // ] + // : [ + // { label: 'View Protest', type: 'primary' as const, href: actionUrl, actionId: 'view' }, + // { label: 'Dismiss', type: 'secondary' as const, actionId: 'dismiss' }, + // ] + // : []; - await sendNotification.execute({ - recipientId: currentDriverId, - type: notificationType, - title, - body, - actionUrl, - urgency: selectedUrgency as NotificationUrgency, - requiresResponse: selectedUrgency === 'modal' && !selectedType.startsWith('race_'), - actions, - data: { - ...(selectedType.startsWith('protest_') ? { - protestId: `demo-protest-${Date.now()}`, - } : {}), - ...(selectedType.startsWith('race_') ? { - raceEventId: `demo-race-event-${Date.now()}`, - sessionId: `demo-session-${Date.now()}`, - position: 1, - positionChange: 0, - incidents: 0, - provisionalRatingChange: 25, - finalRatingChange: 25, - hadPenaltiesApplied: false, - } : {}), - raceId: primaryRace?.id ?? '', - leagueId: primaryLeague?.id ?? '', - ...(notificationDeadline && selectedType.startsWith('protest_') ? { deadline: notificationDeadline } : {}), - }, - }); + // await sendNotification.execute({ + // recipientId: currentDriverId, + // type: notificationType, + // title, + // body, + // actionUrl, + // urgency: selectedUrgency as NotificationUrgency, + // requiresResponse: selectedUrgency === 'modal' && !selectedType.startsWith('race_'), + // actions, + // data: { + // ...(selectedType.startsWith('protest_') ? { + // protestId: `demo-protest-${Date.now()}`, + // } : {}), + // ...(selectedType.startsWith('race_') ? { + // raceEventId: `demo-race-event-${Date.now()}`, + // sessionId: `demo-session-${Date.now()}`, + // position: 1, + // positionChange: 0, + // incidents: 0, + // provisionalRatingChange: 25, + // finalRatingChange: 25, + // hadPenaltiesApplied: false, + // } : {}), + // raceId: primaryRace?.id ?? '', + // leagueId: primaryLeague?.id ?? '', + // ...(notificationDeadline && selectedType.startsWith('protest_') ? { deadline: notificationDeadline } : {}), + // }, + // }); - setLastSent(`${selectedType}-${selectedUrgency}`); - setTimeout(() => setLastSent(null), 3000); - } catch (error) { - console.error('Failed to send demo notification:', error); - } finally { - setSending(false); - } - }; + // setLastSent(`${selectedType}-${selectedUrgency}`); + // setTimeout(() => setLastSent(null), 3000); + // } catch (error) { + // console.error('Failed to send demo notification:', error); + // } finally { + // setSending(false); + // } + // }; if (isMinimized) { return ( diff --git a/apps/website/components/drivers/CreateDriverForm.tsx b/apps/website/components/drivers/CreateDriverForm.tsx index 7167f86bd..7cf47fca2 100644 --- a/apps/website/components/drivers/CreateDriverForm.tsx +++ b/apps/website/components/drivers/CreateDriverForm.tsx @@ -5,7 +5,6 @@ import { useRouter } from 'next/navigation'; import Input from '../ui/Input'; import Button from '../ui/Button'; import { Driver } from '@core/racing'; -import { getDriverRepository } from '../../lib/di-container'; interface FormErrors { name?: string; diff --git a/apps/website/components/drivers/DriverIdentity.tsx b/apps/website/components/drivers/DriverIdentity.tsx index 1548b9f8a..7fa16ea82 100644 --- a/apps/website/components/drivers/DriverIdentity.tsx +++ b/apps/website/components/drivers/DriverIdentity.tsx @@ -1,7 +1,6 @@ import Link from 'next/link'; import Image from 'next/image'; import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; -import { getImageService } from '@/lib/di-container'; export interface DriverIdentityProps { driver: DriverDTO; diff --git a/apps/website/components/drivers/DriverProfile.tsx b/apps/website/components/drivers/DriverProfile.tsx index 9d9fa309d..4bc79f553 100644 --- a/apps/website/components/drivers/DriverProfile.tsx +++ b/apps/website/components/drivers/DriverProfile.tsx @@ -8,7 +8,6 @@ import CareerHighlights from './CareerHighlights'; import DriverRankings from './DriverRankings'; import PerformanceMetrics from './PerformanceMetrics'; import { useEffect, useState } from 'react'; -import { getLeagueRankings, getGetDriverTeamUseCase, getGetProfileOverviewUseCase } from '@/lib/di-container'; import { DriverTeamPresenter } from '@/lib/presenters/DriverTeamPresenter'; import { getPrimaryLeagueIdForDriver } from '@/lib/leagueMembership'; import type { ProfileOverviewViewModel } from '@core/racing/application/presenters/IProfileOverviewPresenter'; diff --git a/apps/website/components/drivers/ProfileRaceHistory.tsx b/apps/website/components/drivers/ProfileRaceHistory.tsx index 088c69526..50bae1b46 100644 --- a/apps/website/components/drivers/ProfileRaceHistory.tsx +++ b/apps/website/components/drivers/ProfileRaceHistory.tsx @@ -4,7 +4,6 @@ import { useState, useEffect } from 'react'; import Card from '../ui/Card'; import Button from '../ui/Button'; import RaceResultCard from '../races/RaceResultCard'; -import { getRaceRepository, getLeagueRepository, getResultRepository } from '@/lib/di-container'; import { Race } from '@core/racing/domain/entities/Race'; import { Result } from '@core/racing/domain/entities/Result'; import { League } from '@core/racing/domain/entities/League'; diff --git a/apps/website/components/drivers/ProfileStats.tsx b/apps/website/components/drivers/ProfileStats.tsx index 1b1955672..75608e789 100644 --- a/apps/website/components/drivers/ProfileStats.tsx +++ b/apps/website/components/drivers/ProfileStats.tsx @@ -2,7 +2,6 @@ import Card from '../ui/Card'; import RankBadge from './RankBadge'; -import { getLeagueRankings, getGetProfileOverviewUseCase } from '@/lib/di-container'; import { useState, useEffect } from 'react'; import { getPrimaryLeagueIdForDriver } from '@/lib/leagueMembership'; import type { ProfileOverviewViewModel } from '@core/racing/application/presenters/IProfileOverviewPresenter'; diff --git a/apps/website/components/feed/FeedItemCard.tsx b/apps/website/components/feed/FeedItemCard.tsx index 03022b4d8..36c450f4a 100644 --- a/apps/website/components/feed/FeedItemCard.tsx +++ b/apps/website/components/feed/FeedItemCard.tsx @@ -3,7 +3,6 @@ import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Image from 'next/image'; import type { FeedItemDTO } from '@core/social/application/dto/FeedItemDTO'; -import { getDriverRepository, getImageService } from '@/lib/di-container'; function timeAgo(timestamp: Date | string): string { const date = typeof timestamp === 'string' ? new Date(timestamp) : timestamp; diff --git a/apps/website/components/leagues/CreateLeagueForm.tsx b/apps/website/components/leagues/CreateLeagueForm.tsx index 90ba63f82..84027b5fb 100644 --- a/apps/website/components/leagues/CreateLeagueForm.tsx +++ b/apps/website/components/leagues/CreateLeagueForm.tsx @@ -5,7 +5,6 @@ import { useRouter } from 'next/navigation'; import Input from '../ui/Input'; import Button from '../ui/Button'; import { League } from '@core/racing/domain/entities/League'; -import { getLeagueRepository, getDriverRepository } from '../../lib/di-container'; interface FormErrors { name?: string; diff --git a/apps/website/components/leagues/CreateLeagueWizard.tsx b/apps/website/components/leagues/CreateLeagueWizard.tsx index 73deeed71..ef0552504 100644 --- a/apps/website/components/leagues/CreateLeagueWizard.tsx +++ b/apps/website/components/leagues/CreateLeagueWizard.tsx @@ -22,9 +22,7 @@ import Button from '@/components/ui/Button'; import Heading from '@/components/ui/Heading'; import LeagueReviewSummary from '@/components/leagues/LeagueReviewSummary'; import Input from '@/components/ui/Input'; -import { - getListLeagueScoringPresetsQuery, -} from '@/lib/di-container'; + import { validateLeagueWizardStep, validateAllLeagueWizardSteps, diff --git a/apps/website/components/leagues/JoinLeagueButton.tsx b/apps/website/components/leagues/JoinLeagueButton.tsx index 278b4d33c..c3808e768 100644 --- a/apps/website/components/leagues/JoinLeagueButton.tsx +++ b/apps/website/components/leagues/JoinLeagueButton.tsx @@ -4,7 +4,6 @@ import { useState } from 'react'; import Button from '../ui/Button'; import { getMembership, type MembershipStatus } from '@/lib/leagueMembership'; import { useEffectiveDriverId } from '@/lib/currentDriver'; -import { getJoinLeagueUseCase, getLeagueMembershipRepository } from '@/lib/di-container'; interface JoinLeagueButtonProps { leagueId: string; diff --git a/apps/website/components/leagues/LeagueActivityFeed.tsx b/apps/website/components/leagues/LeagueActivityFeed.tsx index 0407a7313..09ff75f55 100644 --- a/apps/website/components/leagues/LeagueActivityFeed.tsx +++ b/apps/website/components/leagues/LeagueActivityFeed.tsx @@ -3,7 +3,6 @@ import { Calendar, Award, UserPlus, UserMinus, Shield, Flag, AlertTriangle } from 'lucide-react'; import { Race, Penalty } from '@core/racing'; import type { LeagueMembership } from '@core/racing/domain/entities/LeagueMembership'; -import { getDriverRepository, getPenaltyRepository, getRaceRepository } from '@/lib/di-container'; import { useEffect, useState } from 'react'; import type { Driver } from '@core/racing'; diff --git a/apps/website/components/leagues/LeagueCard.tsx b/apps/website/components/leagues/LeagueCard.tsx index 3a3a52601..22c9d0bd2 100644 --- a/apps/website/components/leagues/LeagueCard.tsx +++ b/apps/website/components/leagues/LeagueCard.tsx @@ -14,7 +14,6 @@ import { } from 'lucide-react'; import type { LeagueSummaryViewModel } from '@core/racing/application/presenters/IAllLeaguesWithCapacityAndScoringPresenter'; import { getLeagueCoverClasses } from '@/lib/leagueCovers'; -import { getImageService } from '@/lib/di-container'; interface LeagueCardProps { league: LeagueSummaryViewModel; diff --git a/apps/website/components/leagues/LeagueHeader.tsx b/apps/website/components/leagues/LeagueHeader.tsx index b10b1feec..9a1583ac7 100644 --- a/apps/website/components/leagues/LeagueHeader.tsx +++ b/apps/website/components/leagues/LeagueHeader.tsx @@ -5,12 +5,7 @@ import Link from 'next/link'; import Image from 'next/image'; import MembershipStatus from '@/components/leagues/MembershipStatus'; import FeatureLimitationTooltip from '@/components/alpha/FeatureLimitationTooltip'; -import { - getDriverRepository, - getDriverStats, - getAllDriverRankings, - getImageService, -} from '@/lib/di-container'; + import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; import { EntityMappers } from '@core/racing/application/mappers/EntityMappers'; import DriverSummaryPill from '@/components/profile/DriverSummaryPill'; diff --git a/apps/website/components/leagues/LeagueMembers.tsx b/apps/website/components/leagues/LeagueMembers.tsx index 79de9db2b..5486e2001 100644 --- a/apps/website/components/leagues/LeagueMembers.tsx +++ b/apps/website/components/leagues/LeagueMembers.tsx @@ -4,7 +4,6 @@ import { useState, useEffect, useCallback } from 'react'; import DriverIdentity from '@/components/drivers/DriverIdentity'; import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; import { EntityMappers } from '@core/racing/application/mappers/EntityMappers'; -import { getDriverRepository, getDriverStats } from '@/lib/di-container'; import { getLeagueMembers, type LeagueMembership, diff --git a/apps/website/components/leagues/LeagueSponsorshipsSection.tsx b/apps/website/components/leagues/LeagueSponsorshipsSection.tsx index 89d9269ed..11ab77bfe 100644 --- a/apps/website/components/leagues/LeagueSponsorshipsSection.tsx +++ b/apps/website/components/leagues/LeagueSponsorshipsSection.tsx @@ -5,12 +5,7 @@ import Button from '../ui/Button'; import Input from '../ui/Input'; import { DollarSign, Star, Award, Plus, X, Bell } from 'lucide-react'; import PendingSponsorshipRequests, { type PendingRequestDTO } from '../sponsors/PendingSponsorshipRequests'; -import { - getGetPendingSponsorshipRequestsUseCase, - getAcceptSponsorshipRequestUseCase, - getRejectSponsorshipRequestUseCase, - getSeasonRepository, -} from '@/lib/di-container'; + import { PendingSponsorshipRequestsPresenter } from '@/lib/presenters/PendingSponsorshipRequestsPresenter'; import { useEffectiveDriverId } from '@/lib/currentDriver'; diff --git a/apps/website/components/leagues/QuickPenaltyModal.tsx b/apps/website/components/leagues/QuickPenaltyModal.tsx index 1654d9b22..fba27596e 100644 --- a/apps/website/components/leagues/QuickPenaltyModal.tsx +++ b/apps/website/components/leagues/QuickPenaltyModal.tsx @@ -2,7 +2,6 @@ import React, { useState } from 'react'; import { useRouter } from 'next/navigation'; -import { getQuickPenaltyUseCase } from '@/lib/di-container'; import Button from '@/components/ui/Button'; import { AlertTriangle, Clock, Flag, Zap } from 'lucide-react'; diff --git a/apps/website/components/leagues/StandingsTable.tsx b/apps/website/components/leagues/StandingsTable.tsx index 7eff19a8f..f0303e5a8 100644 --- a/apps/website/components/leagues/StandingsTable.tsx +++ b/apps/website/components/leagues/StandingsTable.tsx @@ -8,8 +8,6 @@ import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; import type { LeagueDriverSeasonStatsDTO } from '@core/racing/application/dto/LeagueDriverSeasonStatsDTO'; import type { LeagueMembership, MembershipRole } from '@/lib/leagueMembership'; import { getLeagueRoleDisplay } from '@/lib/leagueRoles'; -import { getDriverStats } from '@/lib/di-container'; -import { getImageService } from '@/lib/di-container'; import CountryFlag from '@/components/ui/CountryFlag'; // Position background colors diff --git a/apps/website/components/notifications/NotificationCenter.tsx b/apps/website/components/notifications/NotificationCenter.tsx index 6dd599d40..4aa4f1a33 100644 --- a/apps/website/components/notifications/NotificationCenter.tsx +++ b/apps/website/components/notifications/NotificationCenter.tsx @@ -4,10 +4,6 @@ import React, { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { useEffectiveDriverId } from '@/lib/currentDriver'; -import { - getNotificationRepository, - getMarkNotificationReadUseCase, -} from '@/lib/di-container'; import type { Notification } from '@core/notifications/application'; import { Bell, @@ -52,23 +48,24 @@ export default function NotificationCenter() { const currentDriverId = useEffectiveDriverId(); // Polling for new notifications - useEffect(() => { - const loadNotifications = async () => { - try { - const repo = getNotificationRepository(); - const allNotifications = await repo.findByRecipientId(currentDriverId); - setNotifications(allNotifications); - } catch (error) { - console.error('Failed to load notifications:', error); - } - }; + // TODO + // useEffect(() => { + // const loadNotifications = async () => { + // try { + // const repo = getNotificationRepository(); + // const allNotifications = await repo.findByRecipientId(currentDriverId); + // setNotifications(allNotifications); + // } catch (error) { + // console.error('Failed to load notifications:', error); + // } + // }; - loadNotifications(); + // loadNotifications(); - // Poll every 5 seconds - const interval = setInterval(loadNotifications, 5000); - return () => clearInterval(interval); - }, [currentDriverId]); + // // Poll every 5 seconds + // const interval = setInterval(loadNotifications, 5000); + // return () => clearInterval(interval); + // }, [currentDriverId]); // Close panel when clicking outside useEffect(() => { diff --git a/apps/website/components/notifications/NotificationProvider.tsx b/apps/website/components/notifications/NotificationProvider.tsx index 748283d86..4b8189757 100644 --- a/apps/website/components/notifications/NotificationProvider.tsx +++ b/apps/website/components/notifications/NotificationProvider.tsx @@ -2,10 +2,7 @@ import { createContext, useContext, useState, useEffect, useCallback, ReactNode } from 'react'; import { useEffectiveDriverId } from '@/lib/currentDriver'; -import { - getNotificationRepository, - getMarkNotificationReadUseCase, -} from '@/lib/di-container'; + import type { Notification } from '@core/notifications/application'; import ToastNotification from './ToastNotification'; import ModalNotification from './ModalNotification'; @@ -44,45 +41,46 @@ export default function NotificationProvider({ children }: NotificationProviderP const currentDriverId = useEffectiveDriverId(); // Poll for new notifications - useEffect(() => { - const loadNotifications = async () => { - try { - const repo = getNotificationRepository(); - const allNotifications = await repo.findByRecipientId(currentDriverId); - setNotifications(allNotifications); + // TODO + // useEffect(() => { + // const loadNotifications = async () => { + // try { + // const repo = getNotificationRepository(); + // const allNotifications = await repo.findByRecipientId(currentDriverId); + // setNotifications(allNotifications); - // Check for new notifications that need toast/modal display - allNotifications.forEach((notification) => { - // Check both unread and action_required status for modals - const shouldDisplay = (notification.isUnread() || notification.isActionRequired()) && - !seenNotificationIds.has(notification.id); + // // Check for new notifications that need toast/modal display + // allNotifications.forEach((notification) => { + // // Check both unread and action_required status for modals + // const shouldDisplay = (notification.isUnread() || notification.isActionRequired()) && + // !seenNotificationIds.has(notification.id); - if (shouldDisplay) { - // Mark as seen to prevent duplicate displays - setSeenNotificationIds((prev) => new Set([...prev, notification.id])); + // if (shouldDisplay) { + // // Mark as seen to prevent duplicate displays + // setSeenNotificationIds((prev) => new Set([...prev, notification.id])); - // Handle based on urgency - if (notification.isModal()) { - // Modal takes priority - show immediately - setModalNotification(notification); - } else if (notification.isToast()) { - // Add to toast queue - setToastNotifications((prev) => [...prev, notification]); - } - // Silent notifications just appear in the notification center - } - }); - } catch (error) { - console.error('Failed to load notifications:', error); - } - }; + // // Handle based on urgency + // if (notification.isModal()) { + // // Modal takes priority - show immediately + // setModalNotification(notification); + // } else if (notification.isToast()) { + // // Add to toast queue + // setToastNotifications((prev) => [...prev, notification]); + // } + // // Silent notifications just appear in the notification center + // } + // }); + // } catch (error) { + // console.error('Failed to load notifications:', error); + // } + // }; - loadNotifications(); + // loadNotifications(); - // Poll every 2 seconds for responsiveness - const interval = setInterval(loadNotifications, 2000); - return () => clearInterval(interval); - }, [currentDriverId, seenNotificationIds]); + // // Poll every 2 seconds for responsiveness + // const interval = setInterval(loadNotifications, 2000); + // return () => clearInterval(interval); + // }, [currentDriverId, seenNotificationIds]); // Prevent body scroll when modal is open useEffect(() => { diff --git a/apps/website/components/profile/DriverSummaryPill.tsx b/apps/website/components/profile/DriverSummaryPill.tsx index d199d2cd5..128833b89 100644 --- a/apps/website/components/profile/DriverSummaryPill.tsx +++ b/apps/website/components/profile/DriverSummaryPill.tsx @@ -4,7 +4,6 @@ import Image from 'next/image'; import Link from 'next/link'; import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; import DriverRating from '@/components/profile/DriverRatingPill'; -import { getImageService } from '@/lib/di-container'; export interface DriverSummaryPillProps { driver: DriverDTO; diff --git a/apps/website/components/profile/ProfileHeader.tsx b/apps/website/components/profile/ProfileHeader.tsx index 402449430..c8f0a6226 100644 --- a/apps/website/components/profile/ProfileHeader.tsx +++ b/apps/website/components/profile/ProfileHeader.tsx @@ -3,7 +3,6 @@ import Image from 'next/image'; import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; import Button from '../ui/Button'; -import { getImageService } from '@/lib/di-container'; import DriverRatingPill from '@/components/profile/DriverRatingPill'; import CountryFlag from '@/components/ui/CountryFlag'; diff --git a/apps/website/components/profile/UserPill.tsx b/apps/website/components/profile/UserPill.tsx index d17356794..e3c1be51e 100644 --- a/apps/website/components/profile/UserPill.tsx +++ b/apps/website/components/profile/UserPill.tsx @@ -4,13 +4,7 @@ import Link from 'next/link'; import { useEffect, useMemo, useState } from 'react'; import { LogOut, Settings, Star, Paintbrush, Building2, BarChart3, Megaphone, CreditCard, Handshake } from 'lucide-react'; import { useAuth } from '@/lib/auth/AuthContext'; -import { - getDriverStats, - getLeagueRankings, - getAllDriverRankings, - getDriverRepository, - getImageService, -} from '@/lib/di-container'; + import { useEffectiveDriverId } from '@/lib/currentDriver'; import type { DriverDTO } from '@core/racing/application/dto/DriverDTO'; import { EntityMappers } from '@core/racing/application/mappers/EntityMappers'; diff --git a/apps/website/components/races/FileProtestModal.tsx b/apps/website/components/races/FileProtestModal.tsx index 9d78c1fd6..647ab1589 100644 --- a/apps/website/components/races/FileProtestModal.tsx +++ b/apps/website/components/races/FileProtestModal.tsx @@ -3,7 +3,6 @@ import { useState } from 'react'; import Modal from '@/components/ui/Modal'; import Button from '@/components/ui/Button'; -import { getFileProtestUseCase } from '@/lib/di-container'; import type { ProtestIncident } from '@core/racing/domain/entities/Protest'; import { AlertTriangle, diff --git a/apps/website/components/sponsors/SponsorInsightsCard.tsx b/apps/website/components/sponsors/SponsorInsightsCard.tsx index 03d3d580b..b5973750a 100644 --- a/apps/website/components/sponsors/SponsorInsightsCard.tsx +++ b/apps/website/components/sponsors/SponsorInsightsCard.tsx @@ -21,7 +21,6 @@ import { Check, Loader2, } from 'lucide-react'; -import { getApplyForSponsorshipUseCase, getSponsorRepository } from '@/lib/di-container'; // ============================================================================ // TYPES diff --git a/apps/website/components/teams/CreateTeamForm.tsx b/apps/website/components/teams/CreateTeamForm.tsx index 011d0d1c7..931849522 100644 --- a/apps/website/components/teams/CreateTeamForm.tsx +++ b/apps/website/components/teams/CreateTeamForm.tsx @@ -4,7 +4,6 @@ import { useState } from 'react'; import { useRouter } from 'next/navigation'; import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; -import { getCreateTeamUseCase } from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; interface CreateTeamFormProps { diff --git a/apps/website/components/teams/JoinTeamButton.tsx b/apps/website/components/teams/JoinTeamButton.tsx index eb719196f..d692de05d 100644 --- a/apps/website/components/teams/JoinTeamButton.tsx +++ b/apps/website/components/teams/JoinTeamButton.tsx @@ -2,11 +2,6 @@ import { useState, useEffect } from 'react'; import Button from '@/components/ui/Button'; -import { - getJoinTeamUseCase, - getLeaveTeamUseCase, - getTeamMembershipRepository, -} from '@/lib/di-container'; import { useEffectiveDriverId } from '@/lib/currentDriver'; type TeamMembershipStatus = 'active' | 'pending' | 'inactive'; diff --git a/apps/website/components/teams/TeamCard.tsx b/apps/website/components/teams/TeamCard.tsx index b43111a40..77f092986 100644 --- a/apps/website/components/teams/TeamCard.tsx +++ b/apps/website/components/teams/TeamCard.tsx @@ -16,7 +16,6 @@ import { Globe, Languages, } from 'lucide-react'; -import { getImageService } from '@/lib/di-container'; interface TeamCardProps { id: string; diff --git a/apps/website/components/teams/TeamLadderRow.tsx b/apps/website/components/teams/TeamLadderRow.tsx index ff230adbe..cc257f181 100644 --- a/apps/website/components/teams/TeamLadderRow.tsx +++ b/apps/website/components/teams/TeamLadderRow.tsx @@ -2,7 +2,6 @@ import { useRouter } from 'next/navigation'; import Image from 'next/image'; -import { getImageService } from '@/lib/di-container'; export interface TeamLadderRowProps { rank: number; diff --git a/package.json b/package.json index 8e2d4e751..ff8601474 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "docker:prod:down": "docker-compose -f docker-compose.prod.yml down", "docker:prod:logs": "docker-compose -f docker-compose.prod.yml logs -f", "docker:prod:clean": "docker-compose -f docker-compose.prod.yml down -v", - "api:build": "npm run build --workspace=@core/api", + "api:build": "npm run build --workspace=@gridpilot/api", "test": "vitest run \"$@\"", "test:unit": "vitest run tests/unit", "test:integration": "vitest run tests/integration", @@ -39,16 +39,16 @@ "test:companion-hosted": "vitest run --config vitest.e2e.config.ts tests/e2e/companion/companion-ui-full-workflow.e2e.test.ts", "typecheck": "tsc --noEmit", "test:types": "tsc --noEmit -p tsconfig.tests.json", - "companion:dev": "npm run dev --workspace=@core/companion", - "companion:build": "npm run build --workspace=@core/companion", - "companion:start": "npm run start --workspace=@core/companion", + "companion:dev": "npm run dev --workspace=@gridpilot/companion", + "companion:build": "npm run build --workspace=@gridpilot/companion", + "companion:start": "npm run start --workspace=@gridpilot/companion", "env:website:merge": "node scripts/merge-website-env.js", - "website:dev": "npm run env:website:merge && npm run dev --workspace=@core/website", - "website:build": "npm run env:website:merge && npm run build --workspace=@core/website", - "website:start": "npm run start --workspace=@core/website", - "website:lint": "npm run lint --workspace=@core/website", - "website:type-check": "npm run type-check --workspace=@core/website", - "website:clean": "npm run clean --workspace=@core/website", + "website:dev": "npm run env:website:merge && npm run dev --workspace=@gridpilot/website", + "website:build": "npm run env:website:merge && npm run build --workspace=@gridpilot/website", + "website:start": "npm run start --workspace=@gridpilot/website", + "website:lint": "npm run lint --workspace=@gridpilot/website", + "website:type-check": "npm run type-check --workspace=@gridpilot/website", + "website:clean": "npm run clean --workspace=@gridpilot/website", "deploy:website:preview": "npx vercel deploy --cwd apps/website", "deploy:website:prod": "npx vercel deploy --prod", "deploy:website": "npm run deploy:website:prod",