inmemory to postgres

This commit is contained in:
2025-12-29 19:44:11 +01:00
parent f5639a367f
commit 12ae6e1dad
17 changed files with 361 additions and 94 deletions

View File

@@ -1,11 +1,13 @@
import { League } from '@core/racing/domain/entities/League';
import { Driver } from '@core/racing/domain/entities/Driver';
import { faker } from '@faker-js/faker';
import { seedId } from './SeedIdHelper';
export class RacingLeagueFactory {
constructor(
private readonly baseDate: Date,
private readonly drivers: Driver[],
private readonly persistence: 'postgres' | 'inmemory' = 'inmemory',
) {}
create(): League[] {
@@ -54,7 +56,7 @@ export class RacingLeagueFactory {
socialLinks?: { discordUrl?: string; youtubeUrl?: string; websiteUrl?: string };
participantCount?: number;
} = {
id: `league-${i}`,
id: seedId(`league-${i}`, this.persistence),
name: faker.company.name() + ' Racing League',
description: faker.lorem.sentences(2),
ownerId: owner.id.toString(),