50 lines
935 B
TypeScript
50 lines
935 B
TypeScript
/**
|
|
* Application Port: ILeagueRepository
|
|
*
|
|
* Repository interface for League entity CRUD operations.
|
|
* Defines async methods using domain entities as types.
|
|
*/
|
|
|
|
import { League } from '../../domain/entities/League';
|
|
|
|
export interface ILeagueRepository {
|
|
/**
|
|
* Find a league by ID
|
|
*/
|
|
findById(id: string): Promise<League | null>;
|
|
|
|
/**
|
|
* Find all leagues
|
|
*/
|
|
findAll(): Promise<League[]>;
|
|
|
|
/**
|
|
* Find leagues by owner ID
|
|
*/
|
|
findByOwnerId(ownerId: string): Promise<League[]>;
|
|
|
|
/**
|
|
* Create a new league
|
|
*/
|
|
create(league: League): Promise<League>;
|
|
|
|
/**
|
|
* Update an existing league
|
|
*/
|
|
update(league: League): Promise<League>;
|
|
|
|
/**
|
|
* Delete a league by ID
|
|
*/
|
|
delete(id: string): Promise<void>;
|
|
|
|
/**
|
|
* Check if a league exists by ID
|
|
*/
|
|
exists(id: string): Promise<boolean>;
|
|
|
|
/**
|
|
* Search leagues by name
|
|
*/
|
|
searchByName(query: string): Promise<League[]>;
|
|
} |