This commit is contained in:
2025-12-06 00:17:24 +01:00
parent 78c85a429c
commit 70d5f5689e
54 changed files with 826 additions and 210 deletions

View File

@@ -1,9 +1,19 @@
import type { ImageServicePort } from '@gridpilot/media';
const MALE_DEFAULT_AVATAR = '/images/avatars/male-default-avatar.jpg';
const FEMALE_DEFAULT_AVATAR = '/images/avatars/female-default-avatar.jpeg';
export class DemoImageServiceAdapter implements ImageServicePort {
getDriverAvatar(driverId: string): string {
const numericSuffixMatch = driverId.match(/(\d+)$/
);
if (numericSuffixMatch) {
const numericSuffix = Number.parseInt(numericSuffixMatch[1], 10);
return numericSuffix % 2 === 0 ? FEMALE_DEFAULT_AVATAR : MALE_DEFAULT_AVATAR;
}
const seed = stableHash(driverId);
return `https://picsum.photos/seed/driver-${seed}/128/128`;
return seed % 2 === 0 ? FEMALE_DEFAULT_AVATAR : MALE_DEFAULT_AVATAR;
}
getTeamLogo(teamId: string): string {

View File

@@ -102,7 +102,7 @@ export class GetLeagueScoringConfigQuery {
}
private buildPointsPreview(
tables: Record<string, PointsTable>,
tables: Record<string, any>,
): Array<{ sessionType: string; position: number; points: number }> {
const preview: Array<{
sessionType: string;

View File

@@ -93,7 +93,7 @@ export class EventScoringService {
sessionType: SessionType,
): BonusRule[] {
const all = championship.bonusRulesBySessionType ?? {};
return all[sessionType] ?? [];
return (all as Record<SessionType, BonusRule[]>)[sessionType] ?? [];
}
private applyFastestLapBonus(

View File

@@ -15,4 +15,9 @@ export * from './domain/repositories/IStandingRepository';
export * from './domain/repositories/ILeagueMembershipRepository';
export * from './domain/repositories/IRaceRegistrationRepository';
export * from './domain/repositories/ITeamRepository';
export * from './domain/repositories/ITeamMembershipRepository';
export * from './domain/repositories/ITeamMembershipRepository';
export * from './application/mappers/EntityMappers';
export * from './application/dto/DriverDTO';
export * from './application/dto/LeagueDriverSeasonStatsDTO';
export * from './application/dto/LeagueScoringConfigDTO';

View File

@@ -11,5 +11,10 @@
"./application/*": "./application/*",
"./infrastructure/*": "./infrastructure/*"
},
"dependencies": {}
"dependencies": {
"uuid": "^11.0.5"
},
"devDependencies": {
"@types/uuid": "^10.0.0"
}
}