inmemory to postgres
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import { seedId } from './SeedIdHelper';
|
||||
|
||||
export class RacingDriverFactory {
|
||||
constructor(
|
||||
private readonly driverCount: number,
|
||||
private readonly baseDate: Date,
|
||||
private readonly persistence: 'postgres' | 'inmemory' = 'inmemory',
|
||||
) {}
|
||||
|
||||
create(): Driver[] {
|
||||
@@ -14,7 +16,7 @@ export class RacingDriverFactory {
|
||||
const i = idx + 1;
|
||||
|
||||
return Driver.create({
|
||||
id: `driver-${i}`,
|
||||
id: seedId(`driver-${i}`, this.persistence),
|
||||
iracingId: String(100000 + i),
|
||||
name: faker.person.fullName(),
|
||||
country: faker.helpers.arrayElement(countries),
|
||||
|
||||
Reference in New Issue
Block a user