This commit is contained in:
2025-12-10 12:38:55 +01:00
parent 0f7fe67d3c
commit fbbcf414a4
87 changed files with 11972 additions and 390 deletions

View File

@@ -12,6 +12,8 @@ export interface ILiveryRepository {
findDriverLiveryById(id: string): Promise<DriverLivery | null>;
findDriverLiveriesByDriverId(driverId: string): Promise<DriverLivery[]>;
findDriverLiveryByDriverAndCar(driverId: string, carId: string): Promise<DriverLivery | null>;
findDriverLiveriesByGameId(gameId: string): Promise<DriverLivery[]>;
findDriverLiveryByDriverAndGame(driverId: string, gameId: string): Promise<DriverLivery[]>;
createDriverLivery(livery: DriverLivery): Promise<DriverLivery>;
updateDriverLivery(livery: DriverLivery): Promise<DriverLivery>;
deleteDriverLivery(id: string): Promise<void>;

View File

@@ -0,0 +1,39 @@
/**
* Repository Interface: ISponsorshipPricingRepository
*
* Stores sponsorship pricing configuration for any sponsorable entity.
* This allows drivers, teams, races, and leagues to define their sponsorship slots.
*/
import type { SponsorshipPricing } from '../value-objects/SponsorshipPricing';
import type { SponsorableEntityType } from '../entities/SponsorshipRequest';
export interface ISponsorshipPricingRepository {
/**
* Get pricing configuration for an entity
*/
findByEntity(entityType: SponsorableEntityType, entityId: string): Promise<SponsorshipPricing | null>;
/**
* Save or update pricing configuration for an entity
*/
save(entityType: SponsorableEntityType, entityId: string, pricing: SponsorshipPricing): Promise<void>;
/**
* Delete pricing configuration for an entity
*/
delete(entityType: SponsorableEntityType, entityId: string): Promise<void>;
/**
* Check if entity has pricing configured
*/
exists(entityType: SponsorableEntityType, entityId: string): Promise<boolean>;
/**
* Find all entities accepting sponsorship applications
*/
findAcceptingApplications(entityType: SponsorableEntityType): Promise<Array<{
entityId: string;
pricing: SponsorshipPricing;
}>>;
}

View File

@@ -0,0 +1,51 @@
/**
* Repository Interface: ISponsorshipRequestRepository
*
* Defines operations for SponsorshipRequest aggregate persistence
*/
import type { SponsorshipRequest, SponsorableEntityType, SponsorshipRequestStatus } from '../entities/SponsorshipRequest';
export interface ISponsorshipRequestRepository {
findById(id: string): Promise<SponsorshipRequest | null>;
/**
* Find all requests for a specific entity (driver, team, race, or season)
*/
findByEntity(entityType: SponsorableEntityType, entityId: string): Promise<SponsorshipRequest[]>;
/**
* Find pending requests for an entity that need review
*/
findPendingByEntity(entityType: SponsorableEntityType, entityId: string): Promise<SponsorshipRequest[]>;
/**
* Find all requests made by a sponsor
*/
findBySponsorId(sponsorId: string): Promise<SponsorshipRequest[]>;
/**
* Find requests by status
*/
findByStatus(status: SponsorshipRequestStatus): Promise<SponsorshipRequest[]>;
/**
* Find requests by sponsor and status
*/
findBySponsorIdAndStatus(sponsorId: string, status: SponsorshipRequestStatus): Promise<SponsorshipRequest[]>;
/**
* Check if a sponsor already has a pending request for an entity
*/
hasPendingRequest(sponsorId: string, entityType: SponsorableEntityType, entityId: string): Promise<boolean>;
/**
* Count pending requests for an entity
*/
countPendingByEntity(entityType: SponsorableEntityType, entityId: string): Promise<number>;
create(request: SponsorshipRequest): Promise<SponsorshipRequest>;
update(request: SponsorshipRequest): Promise<SponsorshipRequest>;
delete(id: string): Promise<void>;
exists(id: string): Promise<boolean>;
}