2025-11-13 13:24:03 -08:00
|
|
|
/**
|
|
|
|
|
* Shared types for standings that can be used in both server and client code
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export interface TeamStanding {
|
|
|
|
|
teamId: string;
|
|
|
|
|
teamName: string;
|
Display team owner names in standings views (#184)
* Show team name + username in standings, extract TeamNameDisplay component
- Add TeamNameDisplay component that renders team name (as link) with owner username below, matching the league homepage style
- Update StandingsTable to use TeamNameDisplay with owner username shown below team name
- Update league homepage standings section to use TeamNameDisplay
- Add ownerName/teamOwnerId fields to TeamStanding type
- Extend getSeasonStandings to include teamOwnerId from team relation
- Fetch and attach owner display names in the full standings page loader
https://claude.ai/code/session_01EYgGnuTBaRVdBDapJRTxDZ
* Address code review: type hygiene, explicit types, parallel fetching, style fix
- Remove teamOwnerId from TeamStanding type (was an internal server concern, not display data)
- Remove teamOwnerId from getSeasonStandings return value
- Add TeamStandingWithChange interface extending TeamStanding with sevenDayRankChange/sevenDayOldRank fields
- Annotate getSevenDayStandingsChange with explicit Promise<TeamStandingWithChange[]> return type
- Re-export TeamStandingWithChange from models/standings.ts
- Standings loader: query teams table directly for ownerIds instead of relying on teamOwnerId in standings data
- Standings loader: parallelize all independent queries (standings, teams, progressionData, seasonComplete, completionPercentage) with Promise.all
- Restore font-medium on StandingsTable team TableCell
https://claude.ai/code/session_01EYgGnuTBaRVdBDapJRTxDZ
---------
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-19 20:19:28 -07:00
|
|
|
ownerName?: string | null;
|
2025-11-13 13:24:03 -08:00
|
|
|
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;
|
2026-02-14 22:30:12 -08:00
|
|
|
// Phase 5.4: Expected value projections
|
|
|
|
|
actualPoints?: number | null;
|
|
|
|
|
projectedPoints?: number | null;
|
|
|
|
|
participantsFinished?: number | null;
|
2026-03-22 11:05:13 -07:00
|
|
|
// 7-day point change (optional, present when loaded with change data)
|
|
|
|
|
sevenDayPointChange?: number;
|
2025-11-13 13:24:03 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TeamStandingSnapshot {
|
|
|
|
|
date: Date;
|
|
|
|
|
rank: number;
|
|
|
|
|
totalPoints: number;
|
|
|
|
|
}
|
Display team owner names in standings views (#184)
* Show team name + username in standings, extract TeamNameDisplay component
- Add TeamNameDisplay component that renders team name (as link) with owner username below, matching the league homepage style
- Update StandingsTable to use TeamNameDisplay with owner username shown below team name
- Update league homepage standings section to use TeamNameDisplay
- Add ownerName/teamOwnerId fields to TeamStanding type
- Extend getSeasonStandings to include teamOwnerId from team relation
- Fetch and attach owner display names in the full standings page loader
https://claude.ai/code/session_01EYgGnuTBaRVdBDapJRTxDZ
* Address code review: type hygiene, explicit types, parallel fetching, style fix
- Remove teamOwnerId from TeamStanding type (was an internal server concern, not display data)
- Remove teamOwnerId from getSeasonStandings return value
- Add TeamStandingWithChange interface extending TeamStanding with sevenDayRankChange/sevenDayOldRank fields
- Annotate getSevenDayStandingsChange with explicit Promise<TeamStandingWithChange[]> return type
- Re-export TeamStandingWithChange from models/standings.ts
- Standings loader: query teams table directly for ownerIds instead of relying on teamOwnerId in standings data
- Standings loader: parallelize all independent queries (standings, teams, progressionData, seasonComplete, completionPercentage) with Promise.all
- Restore font-medium on StandingsTable team TableCell
https://claude.ai/code/session_01EYgGnuTBaRVdBDapJRTxDZ
---------
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-19 20:19:28 -07:00
|
|
|
|
|
|
|
|
export interface TeamStandingWithChange extends TeamStanding {
|
|
|
|
|
sevenDayRankChange: number;
|
|
|
|
|
sevenDayOldRank: number | null;
|
2026-03-22 11:05:13 -07:00
|
|
|
sevenDayPointChange: number;
|
Display team owner names in standings views (#184)
* Show team name + username in standings, extract TeamNameDisplay component
- Add TeamNameDisplay component that renders team name (as link) with owner username below, matching the league homepage style
- Update StandingsTable to use TeamNameDisplay with owner username shown below team name
- Update league homepage standings section to use TeamNameDisplay
- Add ownerName/teamOwnerId fields to TeamStanding type
- Extend getSeasonStandings to include teamOwnerId from team relation
- Fetch and attach owner display names in the full standings page loader
https://claude.ai/code/session_01EYgGnuTBaRVdBDapJRTxDZ
* Address code review: type hygiene, explicit types, parallel fetching, style fix
- Remove teamOwnerId from TeamStanding type (was an internal server concern, not display data)
- Remove teamOwnerId from getSeasonStandings return value
- Add TeamStandingWithChange interface extending TeamStanding with sevenDayRankChange/sevenDayOldRank fields
- Annotate getSevenDayStandingsChange with explicit Promise<TeamStandingWithChange[]> return type
- Re-export TeamStandingWithChange from models/standings.ts
- Standings loader: query teams table directly for ownerIds instead of relying on teamOwnerId in standings data
- Standings loader: parallelize all independent queries (standings, teams, progressionData, seasonComplete, completionPercentage) with Promise.all
- Restore font-medium on StandingsTable team TableCell
https://claude.ai/code/session_01EYgGnuTBaRVdBDapJRTxDZ
---------
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-19 20:19:28 -07:00
|
|
|
}
|