wip
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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';
|
||||
@@ -11,5 +11,10 @@
|
||||
"./application/*": "./application/*",
|
||||
"./infrastructure/*": "./infrastructure/*"
|
||||
},
|
||||
"dependencies": {}
|
||||
"dependencies": {
|
||||
"uuid": "^11.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/uuid": "^10.0.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user