linting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface GetLeagueJoinRequestsUseCaseParams {
|
||||
}
|
||||
|
||||
export interface GetLeagueJoinRequestsResultDTO {
|
||||
joinRequests: any[];
|
||||
joinRequests: unknown[];
|
||||
drivers: { id: string; name: string }[];
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ export interface GetLeagueProtestsUseCaseParams {
|
||||
}
|
||||
|
||||
export interface GetLeagueProtestsResultDTO {
|
||||
protests: any[];
|
||||
races: any[];
|
||||
protests: unknown[];
|
||||
races: unknown[];
|
||||
drivers: { id: string; name: string }[];
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export interface GetLeagueSeasonsUseCaseParams {
|
||||
}
|
||||
|
||||
export interface GetLeagueSeasonsResultDTO {
|
||||
seasons: any[];
|
||||
seasons: unknown[];
|
||||
}
|
||||
|
||||
export class GetLeagueSeasonsUseCase implements UseCase<GetLeagueSeasonsUseCaseParams, GetLeagueSeasonsResultDTO, GetLeagueSeasonsViewModel, IGetLeagueSeasonsPresenter> {
|
||||
|
||||
@@ -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 => ({
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user