seed data

This commit is contained in:
2025-12-26 23:06:23 +01:00
parent b4f86abf90
commit f3a89ed87f
15 changed files with 825 additions and 712 deletions

View File

@@ -0,0 +1,18 @@
import { Driver } from '@core/racing/domain/entities/Driver';
import type { Friendship } from './RacingSeed';
export class RacingFriendshipFactory {
create(drivers: Driver[]): Friendship[] {
const friendships: Friendship[] = [];
for (let i = 0; i < drivers.length; i++) {
const driver = drivers[i]!;
for (let offset = 1; offset <= 3; offset++) {
const friend = drivers[(i + offset) % drivers.length]!;
friendships.push({ driverId: driver.id, friendId: friend.id });
}
}
return friendships;
}
}