seed data
This commit is contained in:
100
adapters/bootstrap/racing/RacingLeagueFactory.ts
Normal file
100
adapters/bootstrap/racing/RacingLeagueFactory.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
import { League } from '@core/racing/domain/entities/League';
|
||||
|
||||
export class RacingLeagueFactory {
|
||||
constructor(private readonly baseDate: Date) {}
|
||||
|
||||
create(): League[] {
|
||||
const createdAtBase = this.baseDate;
|
||||
|
||||
return [
|
||||
League.create({
|
||||
id: 'league-1',
|
||||
name: 'GridPilot Sprint Series',
|
||||
description: 'Weekly sprint races with stable grids.',
|
||||
ownerId: 'driver-1',
|
||||
settings: {
|
||||
pointsSystem: 'f1-2024',
|
||||
maxDrivers: 24,
|
||||
sessionDuration: 60,
|
||||
qualifyingFormat: 'open',
|
||||
},
|
||||
createdAt: this.addDays(createdAtBase, -200),
|
||||
socialLinks: {
|
||||
discordUrl: 'https://discord.gg/gridpilot-demo',
|
||||
youtubeUrl: 'https://youtube.com/@gridpilot-demo',
|
||||
websiteUrl: 'https://gridpilot-demo.example.com',
|
||||
},
|
||||
}),
|
||||
League.create({
|
||||
id: 'league-2',
|
||||
name: 'GridPilot Endurance Cup',
|
||||
description: 'Longer races with strategy and consistency.',
|
||||
ownerId: 'driver-2',
|
||||
settings: {
|
||||
pointsSystem: 'indycar',
|
||||
maxDrivers: 32,
|
||||
sessionDuration: 120,
|
||||
qualifyingFormat: 'open',
|
||||
},
|
||||
createdAt: this.addDays(createdAtBase, -180),
|
||||
socialLinks: { discordUrl: 'https://discord.gg/gridpilot-endurance' },
|
||||
}),
|
||||
League.create({
|
||||
id: 'league-3',
|
||||
name: 'GridPilot Club Ladder',
|
||||
description: 'Casual ladder with fast onboarding.',
|
||||
ownerId: 'driver-3',
|
||||
settings: {
|
||||
pointsSystem: 'f1-2024',
|
||||
maxDrivers: 48,
|
||||
sessionDuration: 45,
|
||||
qualifyingFormat: 'single-lap',
|
||||
},
|
||||
createdAt: this.addDays(createdAtBase, -160),
|
||||
}),
|
||||
League.create({
|
||||
id: 'league-4',
|
||||
name: 'Nordic Night Series',
|
||||
description: 'Evening races with tight fields.',
|
||||
ownerId: 'driver-4',
|
||||
settings: {
|
||||
pointsSystem: 'f1-2024',
|
||||
maxDrivers: 32,
|
||||
sessionDuration: 60,
|
||||
qualifyingFormat: 'open',
|
||||
},
|
||||
createdAt: this.addDays(createdAtBase, -150),
|
||||
}),
|
||||
League.create({
|
||||
id: 'league-5',
|
||||
name: 'Demo League (Admin)',
|
||||
description: 'Primary demo league owned by driver-1.',
|
||||
ownerId: 'driver-1',
|
||||
settings: {
|
||||
pointsSystem: 'f1-2024',
|
||||
maxDrivers: 24,
|
||||
sessionDuration: 60,
|
||||
qualifyingFormat: 'open',
|
||||
},
|
||||
createdAt: this.addDays(createdAtBase, -140),
|
||||
}),
|
||||
League.create({
|
||||
id: 'league-6',
|
||||
name: 'Sim Racing Alliance',
|
||||
description: 'Mixed-format season with community events.',
|
||||
ownerId: 'driver-5',
|
||||
settings: {
|
||||
pointsSystem: 'indycar',
|
||||
maxDrivers: 40,
|
||||
sessionDuration: 90,
|
||||
qualifyingFormat: 'open',
|
||||
},
|
||||
createdAt: this.addDays(createdAtBase, -130),
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
private addDays(date: Date, days: number): Date {
|
||||
return new Date(date.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user