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,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),