Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env sh

npx lint-staged
npx lint-staged
npm run test:coverage:all
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"test": "npm run test --workspaces --if-present",
"test:backend": "npm run test -w @mocker/backend",
"test:coverage": "npm run test:coverage -w @mocker/backend",
"test:coverage:all": "npm run test:coverage -w @mocker/backend && npm run test:coverage -w @mocker/frontend",
"dev:frontend": "npm run dev -w @mocker/frontend",
"lint": "npm run lint -w @mocker/backend && npm run lint -w @mocker/frontend",
"lint:fix": "npm run lint:fix -w @mocker/backend && npm run lint:fix -w @mocker/frontend",
Expand Down
35 changes: 35 additions & 0 deletions packages/backend/src/fantasy/fantasy.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface SleeperLeague {
settings?: {
waiver_budget?: number;
};
roster_positions?: string[];
scoring_settings?: Record<string, number>;
}

export interface SleeperRoster {
Expand Down Expand Up @@ -63,15 +65,30 @@ export interface SleeperPlayer {
position: string | null;
team: string | null;
injury_status: string | null;
fantasy_positions?: string[] | null;
search_rank?: number | null;
}

export interface SleeperMatchup {
roster_id: number;
matchup_id: number | null;
players: string[] | null;
starters: string[] | null;
}

export interface SleeperProjection {
player_id: string;
opponent?: string | null;
stats?: Record<string, number | null | undefined>;
}

export interface FantasyPlayer {
id: string;
name: string;
position: string | null;
team: string | null;
injuryStatus: string | null;
fantasyPositions: string[];
}

export interface FantasyTeam {
Expand Down Expand Up @@ -128,6 +145,21 @@ export interface TeamHealth {
summary: string;
}

export interface ProjectedFantasyPlayer extends FantasyPlayer {
projectedPoints: number;
}

export interface LineupRecommendation {
week: number;
opponentOwnerName: string | null;
recommendedStarters: ProjectedFantasyPlayer[];
start: ProjectedFantasyPlayer[];
sit: ProjectedFantasyPlayer[];
userPotential: { min: number; max: number };
opponentPotential: { min: number; max: number } | null;
summary: string;
}

export interface GameToWatch {
id: string;
startsAt: string;
Expand All @@ -146,6 +178,8 @@ export interface FantasyOverview {
gamesToWatch: GameToWatch[];
tradeSuggestions: TradeSuggestion[];
waiverSuggestions: WaiverSuggestion[];
lineupRecommendation: LineupRecommendation | null;
lineupStatus: 'ready' | 'unavailable' | 'no_matchup';
teamHealth: TeamHealth | null;
aiStatus: 'ready' | 'unavailable';
sleeperUrl: string;
Expand Down Expand Up @@ -180,4 +214,5 @@ export interface AITradeAnalysis {
priority: 'high' | 'medium' | 'low';
recommendedBid: number;
}>;
lineupSummary: string;
}
Loading
Loading