seed data
This commit is contained in:
@@ -14,7 +14,7 @@ import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import { SeasonSponsorship } from '@core/racing/domain/entities/season/SeasonSponsorship';
|
||||
import type { TeamJoinRequest, TeamMembership } from '@core/racing/domain/types/TeamMembership';
|
||||
import type { FeedItem } from '@core/social/domain/types/FeedItem';
|
||||
import { RacingDriverFactory } from './RacingDriverFactory';
|
||||
import { RacingDriverFactory, type DriverStats } from './RacingDriverFactory';
|
||||
import { RacingFeedFactory } from './RacingFeedFactory';
|
||||
import { RacingFriendshipFactory } from './RacingFriendshipFactory';
|
||||
import { RacingLeagueFactory } from './RacingLeagueFactory';
|
||||
@@ -22,7 +22,7 @@ import { RacingMembershipFactory } from './RacingMembershipFactory';
|
||||
import { RacingRaceFactory } from './RacingRaceFactory';
|
||||
import { RacingResultFactory } from './RacingResultFactory';
|
||||
import { RacingStandingFactory } from './RacingStandingFactory';
|
||||
import { RacingTeamFactory } from './RacingTeamFactory';
|
||||
import { RacingTeamFactory, type TeamStats } from './RacingTeamFactory';
|
||||
import { RacingTrackFactory } from './RacingTrackFactory';
|
||||
import { RacingSponsorFactory } from './RacingSponsorFactory';
|
||||
import { RacingSeasonSponsorshipFactory } from './RacingSeasonSponsorshipFactory';
|
||||
@@ -36,6 +36,7 @@ export type Friendship = {
|
||||
|
||||
export type RacingSeed = {
|
||||
drivers: Driver[];
|
||||
driverStats: Map<string, DriverStats>;
|
||||
leagues: League[];
|
||||
seasons: Season[];
|
||||
seasonSponsorships: SeasonSponsorship[];
|
||||
@@ -51,6 +52,7 @@ export type RacingSeed = {
|
||||
leagueJoinRequests: JoinRequest[];
|
||||
raceRegistrations: RaceRegistration[];
|
||||
teams: Team[];
|
||||
teamStats: Map<string, TeamStats>;
|
||||
teamMemberships: TeamMembership[];
|
||||
teamJoinRequests: TeamJoinRequest[];
|
||||
sponsors: Sponsor[];
|
||||
@@ -68,7 +70,7 @@ export type RacingSeedOptions = {
|
||||
export const racingSeedDefaults: Readonly<
|
||||
Required<RacingSeedOptions>
|
||||
> = {
|
||||
driverCount: 100,
|
||||
driverCount: 150, // Increased from 100 to 150
|
||||
baseDate: new Date(),
|
||||
persistence: 'inmemory',
|
||||
};
|
||||
@@ -98,6 +100,7 @@ class RacingSeedFactory {
|
||||
const feedFactory = new RacingFeedFactory(this.baseDate, this.persistence);
|
||||
|
||||
const drivers = driverFactory.create();
|
||||
const driverStats = driverFactory.generateDriverStats(drivers);
|
||||
const tracks = trackFactory.create();
|
||||
const leagueFactory = new RacingLeagueFactory(this.baseDate, drivers, this.persistence);
|
||||
const leagues = leagueFactory.create();
|
||||
@@ -113,6 +116,7 @@ class RacingSeedFactory {
|
||||
|
||||
const teamFactory = new RacingTeamFactory(this.baseDate, this.persistence);
|
||||
const teams = teamFactory.createTeams(drivers, leagues);
|
||||
const teamStats = teamFactory.generateTeamStats(teams);
|
||||
const races = raceFactory.create(leagues, tracks);
|
||||
const results = resultFactory.create(drivers, races);
|
||||
const standings = standingFactory.create(leagues, races, results);
|
||||
@@ -128,6 +132,7 @@ class RacingSeedFactory {
|
||||
|
||||
return {
|
||||
drivers,
|
||||
driverStats,
|
||||
leagues,
|
||||
seasons,
|
||||
seasonSponsorships,
|
||||
@@ -143,6 +148,7 @@ class RacingSeedFactory {
|
||||
leagueJoinRequests,
|
||||
raceRegistrations,
|
||||
teams,
|
||||
teamStats,
|
||||
teamMemberships,
|
||||
teamJoinRequests,
|
||||
sponsors,
|
||||
|
||||
Reference in New Issue
Block a user