This commit is contained in:
2025-12-10 00:38:59 +01:00
parent a4a732ddc5
commit 0f7fe67d3c
25 changed files with 1914 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
/**
* Repository Interface: ILeagueWalletRepository
*
* Defines operations for LeagueWallet aggregate persistence
*/
import type { LeagueWallet } from '../entities/LeagueWallet';
export interface ILeagueWalletRepository {
findById(id: string): Promise<LeagueWallet | null>;
findByLeagueId(leagueId: string): Promise<LeagueWallet | null>;
create(wallet: LeagueWallet): Promise<LeagueWallet>;
update(wallet: LeagueWallet): Promise<LeagueWallet>;
delete(id: string): Promise<void>;
exists(id: string): Promise<boolean>;
}

View File

@@ -0,0 +1,26 @@
/**
* Repository Interface: ILiveryRepository
*
* Defines operations for livery-related entities
*/
import type { DriverLivery } from '../entities/DriverLivery';
import type { LiveryTemplate } from '../entities/LiveryTemplate';
export interface ILiveryRepository {
// DriverLivery operations
findDriverLiveryById(id: string): Promise<DriverLivery | null>;
findDriverLiveriesByDriverId(driverId: string): Promise<DriverLivery[]>;
findDriverLiveryByDriverAndCar(driverId: string, carId: string): Promise<DriverLivery | null>;
createDriverLivery(livery: DriverLivery): Promise<DriverLivery>;
updateDriverLivery(livery: DriverLivery): Promise<DriverLivery>;
deleteDriverLivery(id: string): Promise<void>;
// LiveryTemplate operations
findTemplateById(id: string): Promise<LiveryTemplate | null>;
findTemplatesBySeasonId(seasonId: string): Promise<LiveryTemplate[]>;
findTemplateBySeasonAndCar(seasonId: string, carId: string): Promise<LiveryTemplate | null>;
createTemplate(template: LiveryTemplate): Promise<LiveryTemplate>;
updateTemplate(template: LiveryTemplate): Promise<LiveryTemplate>;
deleteTemplate(id: string): Promise<void>;
}

View File

@@ -0,0 +1,19 @@
/**
* Repository Interface: IPrizeRepository
*
* Defines operations for Prize entity persistence
*/
import type { Prize, PrizeStatus } from '../entities/Prize';
export interface IPrizeRepository {
findById(id: string): Promise<Prize | null>;
findBySeasonId(seasonId: string): Promise<Prize[]>;
findByDriverId(driverId: string): Promise<Prize[]>;
findByStatus(status: PrizeStatus): Promise<Prize[]>;
findBySeasonAndPosition(seasonId: string, position: number): Promise<Prize | null>;
create(prize: Prize): Promise<Prize>;
update(prize: Prize): Promise<Prize>;
delete(id: string): Promise<void>;
exists(id: string): Promise<boolean>;
}

View File

@@ -0,0 +1,18 @@
/**
* Repository Interface: ISeasonSponsorshipRepository
*
* Defines operations for SeasonSponsorship aggregate persistence
*/
import type { SeasonSponsorship, SponsorshipTier } from '../entities/SeasonSponsorship';
export interface ISeasonSponsorshipRepository {
findById(id: string): Promise<SeasonSponsorship | null>;
findBySeasonId(seasonId: string): Promise<SeasonSponsorship[]>;
findBySponsorId(sponsorId: string): Promise<SeasonSponsorship[]>;
findBySeasonAndTier(seasonId: string, tier: SponsorshipTier): Promise<SeasonSponsorship[]>;
create(sponsorship: SeasonSponsorship): Promise<SeasonSponsorship>;
update(sponsorship: SeasonSponsorship): Promise<SeasonSponsorship>;
delete(id: string): Promise<void>;
exists(id: string): Promise<boolean>;
}

View File

@@ -0,0 +1,17 @@
/**
* Repository Interface: ISponsorRepository
*
* Defines operations for Sponsor aggregate persistence
*/
import type { Sponsor } from '../entities/Sponsor';
export interface ISponsorRepository {
findById(id: string): Promise<Sponsor | null>;
findAll(): Promise<Sponsor[]>;
findByEmail(email: string): Promise<Sponsor | null>;
create(sponsor: Sponsor): Promise<Sponsor>;
update(sponsor: Sponsor): Promise<Sponsor>;
delete(id: string): Promise<void>;
exists(id: string): Promise<boolean>;
}

View File

@@ -0,0 +1,17 @@
/**
* Repository Interface: ITransactionRepository
*
* Defines operations for Transaction entity persistence
*/
import type { Transaction, TransactionType } from '../entities/Transaction';
export interface ITransactionRepository {
findById(id: string): Promise<Transaction | null>;
findByWalletId(walletId: string): Promise<Transaction[]>;
findByType(type: TransactionType): Promise<Transaction[]>;
create(transaction: Transaction): Promise<Transaction>;
update(transaction: Transaction): Promise<Transaction>;
delete(id: string): Promise<void>;
exists(id: string): Promise<boolean>;
}