integration tests
This commit is contained in:
77
core/leaderboards/application/ports/DriverRankingsQuery.ts
Normal file
77
core/leaderboards/application/ports/DriverRankingsQuery.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Driver Rankings Query Port
|
||||
*
|
||||
* Defines the interface for querying driver rankings data.
|
||||
* This is a read-only query with search, filter, and sort capabilities.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Query input for driver rankings
|
||||
*/
|
||||
export interface DriverRankingsQuery {
|
||||
/**
|
||||
* Search term for filtering drivers by name (case-insensitive)
|
||||
*/
|
||||
search?: string;
|
||||
|
||||
/**
|
||||
* Minimum rating filter
|
||||
*/
|
||||
minRating?: number;
|
||||
|
||||
/**
|
||||
* Filter by team ID
|
||||
*/
|
||||
teamId?: string;
|
||||
|
||||
/**
|
||||
* Sort field (default: rating)
|
||||
*/
|
||||
sortBy?: 'rating' | 'name' | 'rank' | 'raceCount';
|
||||
|
||||
/**
|
||||
* Sort order (default: desc)
|
||||
*/
|
||||
sortOrder?: 'asc' | 'desc';
|
||||
|
||||
/**
|
||||
* Page number (default: 1)
|
||||
*/
|
||||
page?: number;
|
||||
|
||||
/**
|
||||
* Number of results per page (default: 20)
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Driver entry for rankings
|
||||
*/
|
||||
export interface DriverRankingEntry {
|
||||
rank: number;
|
||||
id: string;
|
||||
name: string;
|
||||
rating: number;
|
||||
teamId?: string;
|
||||
teamName?: string;
|
||||
raceCount: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pagination metadata
|
||||
*/
|
||||
export interface PaginationMetadata {
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
totalPages: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Driver rankings result
|
||||
*/
|
||||
export interface DriverRankingsResult {
|
||||
drivers: DriverRankingEntry[];
|
||||
pagination: PaginationMetadata;
|
||||
}
|
||||
Reference in New Issue
Block a user