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;
  }
}