Files
gridpilot.gg/packages/racing/domain/repositories/ISeasonSponsorshipRepository.ts
2025-12-12 14:23:40 +01:00

24 lines
1.0 KiB
TypeScript

/**
* 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[]>;
/**
* Convenience lookup for aggregating sponsorships at league level.
* Implementations should rely on the denormalized leagueId where present,
* falling back to joining through Seasons if needed.
*/
findByLeagueId(leagueId: 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>;
}