inmemory to postgres
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user