- Added a new route for league standings: `/leagues/:leagueId/standings/:seasonId` - Implemented the `StandingsTable` component to display team standings with ranking, points, and placement breakdown. - Integrated tiebreaker logic for ranking teams based on total points and placements. - Enhanced the league home page with a link to view standings. - Updated scoring system documentation to reflect the new standings features. - Added comprehensive tests for tiebreaker logic and `StandingsTable` component. - Created shared types for standings to be used in both server and client code.
30 lines
638 B
TypeScript
30 lines
638 B
TypeScript
/**
|
|
* Shared types for standings that can be used in both server and client code
|
|
*/
|
|
|
|
export interface TeamStanding {
|
|
teamId: string;
|
|
teamName: string;
|
|
totalPoints: number;
|
|
currentRank: number;
|
|
previousRank: number | null;
|
|
rankChange: number; // Positive = moved up, negative = moved down
|
|
placementCounts: {
|
|
first: number;
|
|
second: number;
|
|
third: number;
|
|
fourth: number;
|
|
fifth: number;
|
|
sixth: number;
|
|
seventh: number;
|
|
eighth: number;
|
|
};
|
|
participantsRemaining: number;
|
|
calculatedAt: Date;
|
|
}
|
|
|
|
export interface TeamStandingSnapshot {
|
|
date: Date;
|
|
rank: number;
|
|
totalPoints: number;
|
|
}
|