wip
This commit is contained in:
@@ -8,11 +8,13 @@
|
||||
import type { RaceRegistration } from '@gridpilot/racing/domain/entities/RaceRegistration';
|
||||
import type { IRaceRegistrationRepository } from '@gridpilot/racing/domain/repositories/IRaceRegistrationRepository';
|
||||
|
||||
type RaceRegistrationSeed = Pick<RaceRegistration, 'raceId' | 'driverId' | 'registeredAt'>;
|
||||
|
||||
export class InMemoryRaceRegistrationRepository implements IRaceRegistrationRepository {
|
||||
private registrationsByRace: Map<string, Set<string>>;
|
||||
private registrationsByDriver: Map<string, Set<string>>;
|
||||
|
||||
constructor(seedRegistrations?: RaceRegistration[]) {
|
||||
constructor(seedRegistrations?: RaceRegistrationSeed[]) {
|
||||
this.registrationsByRace = new Map();
|
||||
this.registrationsByDriver = new Map();
|
||||
|
||||
|
||||
@@ -52,6 +52,15 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
return this.sponsorships.has(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed initial data
|
||||
*/
|
||||
seed(sponsorships: SeasonSponsorship[]): void {
|
||||
for (const sponsorship of sponsorships) {
|
||||
this.sponsorships.set(sponsorship.id, sponsorship);
|
||||
}
|
||||
}
|
||||
|
||||
// Test helper
|
||||
clear(): void {
|
||||
this.sponsorships.clear();
|
||||
|
||||
@@ -51,6 +51,15 @@ export class InMemorySponsorRepository implements ISponsorRepository {
|
||||
return this.sponsors.has(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed initial data
|
||||
*/
|
||||
seed(sponsors: Sponsor[]): void {
|
||||
for (const sponsor of sponsors) {
|
||||
this.sponsors.set(sponsor.id, sponsor);
|
||||
}
|
||||
}
|
||||
|
||||
// Test helper
|
||||
clear(): void {
|
||||
this.sponsors.clear();
|
||||
|
||||
Reference in New Issue
Block a user