Implements schedule viewing from SBA production API with week navigation and game creation from scheduled matchups. Groups games by team matchup horizontally with games stacked vertically for space efficiency. Backend: - Add schedule routes (/api/schedule/current, /api/schedule/games) - Add SBA API client methods for schedule data - Fix multi-worker state isolation (single worker for in-memory state) - Add Redis migration TODO for future scalability - Support custom team IDs in quick-create endpoint Frontend: - Add Schedule tab as default on home page - Week navigation with prev/next and "Current Week" jump - Horizontal group layout (2-6 columns responsive) - Completed games show score + "Final" badge (no Play button) - Incomplete games show "Play" button to create webapp game Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
121 lines
2.3 KiB
TypeScript
121 lines
2.3 KiB
TypeScript
/**
|
|
* Type Definitions Index
|
|
*
|
|
* Central export point for all TypeScript types.
|
|
* Import types from this file throughout the application.
|
|
*
|
|
* @example
|
|
* import type { GameState, SbaPlayer, TypedSocket } from '~/types'
|
|
*/
|
|
|
|
// Game types
|
|
export type {
|
|
GameStatus,
|
|
InningHalf,
|
|
GameMode,
|
|
GameVisibility,
|
|
LeagueId,
|
|
DecisionPhase,
|
|
LineupPlayerState,
|
|
GameState,
|
|
DefensiveDecision,
|
|
OffensiveDecision,
|
|
RollData,
|
|
PlayOutcome,
|
|
RunnerAdvancement,
|
|
PlayResult,
|
|
XCheckResult,
|
|
DecisionPrompt,
|
|
ManualOutcomeSubmission,
|
|
GameListItem,
|
|
CreateGameRequest,
|
|
CreateGameResponse,
|
|
} from './game'
|
|
|
|
// Player types
|
|
export type {
|
|
SbaPlayer,
|
|
Lineup,
|
|
TeamLineup,
|
|
LineupDataResponse,
|
|
SubstitutionType,
|
|
SubstitutionRequest,
|
|
SubstitutionResult,
|
|
SubstitutionErrorCode,
|
|
SubstitutionError,
|
|
} from './player'
|
|
|
|
// WebSocket types
|
|
export type {
|
|
SocketAuth,
|
|
ClientToServerEvents,
|
|
ServerToClientEvents,
|
|
TypedSocket,
|
|
// Request types
|
|
JoinGameRequest,
|
|
LeaveGameRequest,
|
|
DefensiveDecisionRequest,
|
|
OffensiveDecisionRequest,
|
|
RollDiceRequest,
|
|
SubmitManualOutcomeRequest,
|
|
PinchHitterRequest,
|
|
DefensiveReplacementRequest,
|
|
PitchingChangeRequest,
|
|
GetLineupRequest,
|
|
GetBoxScoreRequest,
|
|
RequestGameStateRequest,
|
|
// Event types
|
|
ConnectedEvent,
|
|
GameJoinedEvent,
|
|
UserConnectedEvent,
|
|
UserDisconnectedEvent,
|
|
DefensiveDecisionSubmittedEvent,
|
|
OffensiveDecisionSubmittedEvent,
|
|
DiceRolledEvent,
|
|
OutcomeAcceptedEvent,
|
|
InningChangeEvent,
|
|
GameEndedEvent,
|
|
SubstitutionConfirmedEvent,
|
|
BoxScoreDataEvent,
|
|
BattingStatLine,
|
|
PitchingStatLine,
|
|
GameStateSyncEvent,
|
|
ErrorEvent,
|
|
OutcomeRejectedEvent,
|
|
InvalidActionEvent,
|
|
ConnectionErrorEvent,
|
|
} from './websocket'
|
|
|
|
// API types
|
|
export type {
|
|
ApiError,
|
|
PaginatedResponse,
|
|
GameFilters,
|
|
DiscordAuthResponse,
|
|
DiscordUser,
|
|
JwtPayload,
|
|
Team,
|
|
UserTeamsResponse,
|
|
CreateGameRequestData,
|
|
CreateGameResponseData,
|
|
GetGameResponse,
|
|
GetActiveGamesResponse,
|
|
GetCompletedGamesResponse,
|
|
PlayHistoryItem,
|
|
GetPlayHistoryResponse,
|
|
DeleteGameResponse,
|
|
DiscordCallbackRequest,
|
|
DiscordCallbackResponse,
|
|
GetCurrentUserResponse,
|
|
RefreshTokenRequest,
|
|
RefreshTokenResponse,
|
|
} from './api'
|
|
|
|
// Schedule types
|
|
export type {
|
|
SbaCurrent,
|
|
SbaScheduledGame,
|
|
GetCurrentResponse,
|
|
GetScheduleGamesResponse,
|
|
} from './schedule'
|