This commit is contained in:
2025-12-16 13:53:23 +01:00
parent 84f05598a6
commit 29dc11deb9
127 changed files with 538 additions and 547 deletions

View File

@@ -96,7 +96,7 @@ export class AcceptSponsorshipRequestUseCase
platformFee: acceptedRequest.getPlatformFee().amount,
netAmount: acceptedRequest.getNetAmount().amount,
};
} catch (error: any) {
} catch (error) {
this.logger.error(`Failed to accept sponsorship request ${dto.requestId}: ${error.message}`, { requestId: dto.requestId, error: error.message, stack: error.stack });
throw error;
}

View File

@@ -128,7 +128,7 @@ export class CreateLeagueWithSeasonAndScoringUseCase
};
this.logger.debug('CreateLeagueWithSeasonAndScoringUseCase completed successfully.', { result });
return result;
} catch (error: any) {
} catch (error) {
this.logger.error('Error during CreateLeagueWithSeasonAndScoringUseCase execution.', {
command,
error: error.message,

View File

@@ -4,7 +4,7 @@
* Creates a new sponsor.
*/
import { Sponsor, type SponsorProps } from '../../domain/entities/Sponsor';
import type { ISponsorRepository } from '../../domain/repositories/ISponsorRepository';
import type {
ICreateSponsorPresenter,
@@ -41,7 +41,7 @@ export class CreateSponsorUseCase
contactEmail: input.contactEmail,
...(input.websiteUrl !== undefined ? { websiteUrl: input.websiteUrl } : {}),
...(input.logoUrl !== undefined ? { logoUrl: input.logoUrl } : {}),
} as any);
} as unknown);
await this.sponsorRepository.create(sponsor);

View File

@@ -138,8 +138,8 @@ export class GetDashboardOverviewUseCase {
presenter.present(viewModel);
}
private async getDriverLeagues(allLeagues: any[], driverId: string): Promise<any[]> {
const driverLeagues: any[] = [];
private async getDriverLeagues(allLeagues: unknown[], driverId: string): Promise<any[]> {
const driverLeagues: unknown[] = [];
for (const league of allLeagues) {
const membership = await this.leagueMembershipRepository.getMembership(league.id, driverId);
@@ -152,7 +152,7 @@ export class GetDashboardOverviewUseCase {
}
private async partitionUpcomingRacesByRegistration(
upcomingRaces: any[],
upcomingRaces: unknown[],
driverId: string,
leagueMap: Map<string, string>,
): Promise<{
@@ -194,9 +194,9 @@ export class GetDashboardOverviewUseCase {
}
private buildRecentResults(
allResults: any[],
allRaces: any[],
allLeagues: any[],
allResults: unknown[],
allRaces: unknown[],
allLeagues: unknown[],
driverId: string,
): DashboardRecentResultViewModel[] {
const raceById = new Map(allRaces.map(race => [race.id, race]));
@@ -237,7 +237,7 @@ export class GetDashboardOverviewUseCase {
}
private async buildLeagueStandingsSummaries(
driverLeagues: any[],
driverLeagues: unknown[],
driverId: string,
): Promise<DashboardLeagueStandingSummaryViewModel[]> {
const summaries: DashboardLeagueStandingSummaryViewModel[] = [];
@@ -277,7 +277,7 @@ export class GetDashboardOverviewUseCase {
return activeLeagueIds.size;
}
private buildFeedSummary(feedItems: any[]): DashboardFeedSummaryViewModel {
private buildFeedSummary(feedItems: unknown[]): DashboardFeedSummaryViewModel {
const items: DashboardFeedItemSummaryViewModel[] = feedItems.map(item => ({
id: item.id,
type: item.type,
@@ -297,7 +297,7 @@ export class GetDashboardOverviewUseCase {
};
}
private buildFriendsSummary(friends: any[]): DashboardFriendSummaryViewModel[] {
private buildFriendsSummary(friends: unknown[]): DashboardFriendSummaryViewModel[] {
return friends.map(friend => ({
id: friend.id,
name: friend.name,

View File

@@ -8,7 +8,7 @@ export interface GetLeagueJoinRequestsUseCaseParams {
}
export interface GetLeagueJoinRequestsResultDTO {
joinRequests: any[];
joinRequests: unknown[];
drivers: { id: string; name: string }[];
}

View File

@@ -9,8 +9,8 @@ export interface GetLeagueProtestsUseCaseParams {
}
export interface GetLeagueProtestsResultDTO {
protests: any[];
races: any[];
protests: unknown[];
races: unknown[];
drivers: { id: string; name: string }[];
}

View File

@@ -7,7 +7,7 @@ export interface GetLeagueSeasonsUseCaseParams {
}
export interface GetLeagueSeasonsResultDTO {
seasons: any[];
seasons: unknown[];
}
export class GetLeagueSeasonsUseCase implements UseCase<GetLeagueSeasonsUseCaseParams, GetLeagueSeasonsResultDTO, GetLeagueSeasonsViewModel, IGetLeagueSeasonsPresenter> {

View File

@@ -202,7 +202,7 @@ export class GetProfileOverviewUseCase {
private async buildTeamMemberships(
driverId: string,
teams: any[],
teams: unknown[],
): Promise<ProfileOverviewTeamMembershipViewModel[]> {
const memberships: ProfileOverviewTeamMembershipViewModel[] = [];
@@ -231,7 +231,7 @@ export class GetProfileOverviewUseCase {
return memberships;
}
private buildSocialSummary(friends: any[]): ProfileOverviewSocialSummaryViewModel {
private buildSocialSummary(friends: unknown[]): ProfileOverviewSocialSummaryViewModel {
return {
friendsCount: friends.length,
friends: friends.map(friend => ({

View File

@@ -32,7 +32,7 @@ export class GetTeamsLeaderboardUseCase
async execute(_input: void, presenter: ITeamsLeaderboardPresenter): Promise<void> {
const allTeams = await this.teamRepository.findAll();
const teams: any[] = [];
const teams: unknown[] = [];
await Promise.all(
allTeams.map(async (team) => {

View File

@@ -3,11 +3,7 @@ import type {
ILeagueMembershipRepository,
} from '@core/racing/domain/repositories/ILeagueMembershipRepository';
import type { AsyncUseCase } from '@core/shared/application';
import {
LeagueMembership,
type MembershipRole,
type MembershipStatus,
} from '@core/racing/domain/entities/LeagueMembership';
import type { JoinLeagueCommandDTO } from '../dto/JoinLeagueCommandDTO';
import { BusinessRuleViolationError } from '../errors/RacingApplicationError';

View File

@@ -1,6 +1,6 @@
import type { ITeamRepository } from '../../domain/repositories/ITeamRepository';
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
import { Team } from '../../domain/entities/Team';
import type { UpdateTeamCommandDTO } from '../dto/TeamCommandAndQueryDTO';
export class UpdateTeamUseCase {