website refactor
This commit is contained in:
@@ -9,7 +9,7 @@ import type { Car } from '../entities/Car';
|
||||
import type { CarClass } from '../entities/CarClass';
|
||||
import type { CarLicense } from '../entities/CarLicense';
|
||||
|
||||
export interface ICarRepository {
|
||||
export interface CarRepository {
|
||||
/**
|
||||
* Find a car by ID
|
||||
*/
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ChampionshipStanding } from '../entities/championship/ChampionshipStanding';
|
||||
|
||||
export interface IChampionshipStandingRepository {
|
||||
export interface ChampionshipStandingRepository {
|
||||
findBySeasonAndChampionship(
|
||||
seasonId: string,
|
||||
championshipId: string,
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { Driver } from '../entities/Driver';
|
||||
|
||||
export interface IDriverRepository {
|
||||
export interface DriverRepository {
|
||||
/**
|
||||
* Find a driver by ID
|
||||
*/
|
||||
@@ -5,9 +5,23 @@
|
||||
* This is used for caching computed stats and serving frontend data.
|
||||
*/
|
||||
|
||||
import type { DriverStats } from '../../application/use-cases/IDriverStatsUseCase';
|
||||
export interface DriverStats {
|
||||
rating: number;
|
||||
safetyRating: number;
|
||||
sportsmanshipRating: number;
|
||||
totalRaces: number;
|
||||
wins: number;
|
||||
podiums: number;
|
||||
dnfs: number;
|
||||
avgFinish: number;
|
||||
bestFinish: number;
|
||||
worstFinish: number;
|
||||
consistency: number;
|
||||
experienceLevel: string;
|
||||
overallRank: number | null;
|
||||
}
|
||||
|
||||
export interface IDriverStatsRepository {
|
||||
export interface DriverStatsRepository {
|
||||
/**
|
||||
* Get stats for a specific driver
|
||||
*/
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Game } from '../entities/Game';
|
||||
|
||||
export interface IGameRepository {
|
||||
export interface GameRepository {
|
||||
findById(id: string): Promise<Game | null>;
|
||||
findAll(): Promise<Game[]>;
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
JoinRequest,
|
||||
} from '../entities/LeagueMembership';
|
||||
|
||||
export interface ILeagueMembershipRepository {
|
||||
export interface LeagueMembershipRepository {
|
||||
/**
|
||||
* Get membership for a driver in a league, or null if none exists.
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { League } from '../entities/League';
|
||||
|
||||
export interface ILeagueRepository {
|
||||
export interface LeagueRepository {
|
||||
/**
|
||||
* Find a league by ID
|
||||
*/
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { LeagueScoringConfig } from '../entities/LeagueScoringConfig';
|
||||
|
||||
export interface ILeagueScoringConfigRepository {
|
||||
export interface LeagueScoringConfigRepository {
|
||||
findBySeasonId(seasonId: string): Promise<LeagueScoringConfig | null>;
|
||||
save(config: LeagueScoringConfig): Promise<LeagueScoringConfig>;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { LeagueWallet } from '../entities/league-wallet/LeagueWallet';
|
||||
|
||||
export interface ILeagueWalletRepository {
|
||||
export interface LeagueWalletRepository {
|
||||
findById(id: string): Promise<LeagueWallet | null>;
|
||||
findByLeagueId(leagueId: string): Promise<LeagueWallet | null>;
|
||||
create(wallet: LeagueWallet): Promise<LeagueWallet>;
|
||||
@@ -7,7 +7,7 @@
|
||||
import type { DriverLivery } from '../entities/DriverLivery';
|
||||
import type { LiveryTemplate } from '../entities/LiveryTemplate';
|
||||
|
||||
export interface ILiveryRepository {
|
||||
export interface LiveryRepository {
|
||||
// DriverLivery operations
|
||||
findDriverLiveryById(id: string): Promise<DriverLivery | null>;
|
||||
findDriverLiveriesByDriverId(driverId: string): Promise<DriverLivery[]>;
|
||||
@@ -5,7 +5,7 @@
|
||||
* Handles frontend assets like team logos and driver avatars.
|
||||
*/
|
||||
|
||||
export interface IMediaRepository {
|
||||
export interface MediaRepository {
|
||||
/**
|
||||
* Get driver avatar URL
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Penalty } from '../entities/penalty/Penalty';
|
||||
|
||||
export interface IPenaltyRepository {
|
||||
export interface PenaltyRepository {
|
||||
/**
|
||||
* Find a penalty by ID
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
import type { Prize } from '../entities/prize/Prize';
|
||||
import type { PrizeStatusValue } from '../entities/prize/PrizeStatus';
|
||||
|
||||
export interface IPrizeRepository {
|
||||
export interface PrizeRepository {
|
||||
findById(id: string): Promise<Prize | null>;
|
||||
findBySeasonId(seasonId: string): Promise<Prize[]>;
|
||||
findByDriverId(driverId: string): Promise<Prize[]>;
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Protest } from '../entities/Protest';
|
||||
|
||||
export interface IProtestRepository {
|
||||
export interface ProtestRepository {
|
||||
/**
|
||||
* Find a protest by ID
|
||||
*/
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { RaceEvent } from '../entities/RaceEvent';
|
||||
|
||||
export interface IRaceEventRepository {
|
||||
export interface RaceEventRepository {
|
||||
findById(id: string): Promise<RaceEvent | null>;
|
||||
findAll(): Promise<RaceEvent[]>;
|
||||
findBySeasonId(seasonId: string): Promise<RaceEvent[]>;
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { RaceRegistration } from '../entities/RaceRegistration';
|
||||
|
||||
export interface IRaceRegistrationRepository {
|
||||
export interface RaceRegistrationRepository {
|
||||
/**
|
||||
* Check if a driver is registered for a race.
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { Race, RaceStatusValue } from '../entities/Race';
|
||||
|
||||
export interface IRaceRepository {
|
||||
export interface RaceRepository {
|
||||
/**
|
||||
* Find a race by ID
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { Result } from '../entities/result/Result';
|
||||
|
||||
export interface IResultRepository {
|
||||
export interface ResultRepository {
|
||||
/**
|
||||
* Find a result by ID
|
||||
*/
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Season } from '../entities/season/Season';
|
||||
|
||||
export interface ISeasonRepository {
|
||||
export interface SeasonRepository {
|
||||
findById(id: string): Promise<Season | null>;
|
||||
/**
|
||||
* Backward-compatible alias retained for existing callers.
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { SeasonSponsorship, SponsorshipTier } from '../entities/season/SeasonSponsorship';
|
||||
|
||||
export interface ISeasonSponsorshipRepository {
|
||||
export interface SeasonSponsorshipRepository {
|
||||
findById(id: string): Promise<SeasonSponsorship | null>;
|
||||
findBySeasonId(seasonId: string): Promise<SeasonSponsorship[]>;
|
||||
/**
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Session } from '../entities/Session';
|
||||
|
||||
export interface ISessionRepository {
|
||||
export interface SessionRepository {
|
||||
findById(id: string): Promise<Session | null>;
|
||||
findAll(): Promise<Session[]>;
|
||||
findByRaceEventId(raceEventId: string): Promise<Session[]>;
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Sponsor } from '../entities/sponsor/Sponsor';
|
||||
|
||||
export interface ISponsorRepository {
|
||||
export interface SponsorRepository {
|
||||
findById(id: string): Promise<Sponsor | null>;
|
||||
findAll(): Promise<Sponsor[]>;
|
||||
findByEmail(email: string): Promise<Sponsor | null>;
|
||||
@@ -8,7 +8,7 @@
|
||||
import type { SponsorshipPricing } from '../value-objects/SponsorshipPricing';
|
||||
import type { SponsorableEntityType } from '../entities/SponsorshipRequest';
|
||||
|
||||
export interface ISponsorshipPricingRepository {
|
||||
export interface SponsorshipPricingRepository {
|
||||
/**
|
||||
* Get pricing configuration for an entity
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { SponsorshipRequest, SponsorableEntityType, SponsorshipRequestStatus } from '../entities/SponsorshipRequest';
|
||||
|
||||
export interface ISponsorshipRequestRepository {
|
||||
export interface SponsorshipRequestRepository {
|
||||
findById(id: string): Promise<SponsorshipRequest | null>;
|
||||
|
||||
/**
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { Standing } from '../entities/Standing';
|
||||
|
||||
export interface IStandingRepository {
|
||||
export interface StandingRepository {
|
||||
/**
|
||||
* Find standings by league ID (sorted by position)
|
||||
*/
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
TeamJoinRequest,
|
||||
} from '../types/TeamMembership';
|
||||
|
||||
export interface ITeamMembershipRepository {
|
||||
export interface TeamMembershipRepository {
|
||||
/**
|
||||
* Get membership for a driver in a team, or null if none exists.
|
||||
*/
|
||||
@@ -44,7 +44,7 @@ export interface PaginatedResult<T> {
|
||||
nextOffset?: number;
|
||||
}
|
||||
|
||||
export interface ITeamRatingEventRepository {
|
||||
export interface TeamRatingEventRepository {
|
||||
/**
|
||||
* Save a rating event to the ledger
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { TeamRatingSnapshot } from '../services/TeamRatingSnapshotCalculator';
|
||||
|
||||
export interface ITeamRatingRepository {
|
||||
export interface TeamRatingRepository {
|
||||
/**
|
||||
* Find rating snapshot by team ID
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { Team } from '../entities/Team';
|
||||
|
||||
export interface ITeamRepository {
|
||||
export interface TeamRepository {
|
||||
/**
|
||||
* Find a team by ID.
|
||||
*/
|
||||
@@ -16,7 +16,7 @@ export interface TeamStats {
|
||||
category?: string;
|
||||
}
|
||||
|
||||
export interface ITeamStatsRepository {
|
||||
export interface TeamStatsRepository {
|
||||
/**
|
||||
* Get stats for a specific team
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { Track, TrackCategory } from '../entities/Track';
|
||||
|
||||
export interface ITrackRepository {
|
||||
export interface TrackRepository {
|
||||
/**
|
||||
* Find a track by ID
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Transaction, TransactionType } from '../entities/league-wallet/Transaction';
|
||||
|
||||
export interface ITransactionRepository {
|
||||
export interface TransactionRepository {
|
||||
findById(id: string): Promise<Transaction | null>;
|
||||
findByWalletId(walletId: string): Promise<Transaction[]>;
|
||||
findByType(type: TransactionType): Promise<Transaction[]>;
|
||||
Reference in New Issue
Block a user