more seeds
This commit is contained in:
@@ -33,6 +33,12 @@ export class RacingLeagueFactory {
|
||||
const owner = faker.helpers.arrayElement(this.drivers);
|
||||
const config = leagueConfigs[idx % leagueConfigs.length]!;
|
||||
|
||||
const createdAt =
|
||||
// Ensure some "New" leagues (created within 7 days) so `/leagues` featured categories are populated.
|
||||
idx % 6 === 0
|
||||
? faker.date.recent({ days: 6, refDate: this.baseDate })
|
||||
: faker.date.past({ years: 2, refDate: this.baseDate });
|
||||
|
||||
const leagueData: {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -52,7 +58,7 @@ export class RacingLeagueFactory {
|
||||
description: faker.lorem.sentences(2),
|
||||
ownerId: owner.id.toString(),
|
||||
settings: config,
|
||||
createdAt: faker.date.past({ years: 2, refDate: this.baseDate }),
|
||||
createdAt,
|
||||
};
|
||||
|
||||
// Add social links with varying completeness
|
||||
|
||||
@@ -68,7 +68,7 @@ export const racingSeedDefaults: Readonly<
|
||||
Required<RacingSeedOptions>
|
||||
> = {
|
||||
driverCount: 100,
|
||||
baseDate: new Date('2025-01-15T12:00:00.000Z'),
|
||||
baseDate: new Date(),
|
||||
};
|
||||
|
||||
class RacingSeedFactory {
|
||||
|
||||
Reference in New Issue
Block a user