Lib: Add schema + fetcher for seasonpickpoints table

This commit is contained in:
2025-12-26 21:38:16 +01:00
parent 5cf7974a79
commit db0365adad
2 changed files with 27 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import type {
ScrapedTeamStanding, ScrapedTeamStanding,
SeasonPick, SeasonPick,
SeasonPickedUser, SeasonPickedUser,
SeasonPickPoints,
SeasonPickResult, SeasonPickResult,
Substitution, Substitution,
Team, Team,
@ -323,6 +324,19 @@ export const fetch_racepickpointstotal = async (
return racepickpointstotal; return racepickpointstotal;
}; };
/**
* Fetch all [SeasonPickPoints] from the database.
*/
export const fetch_seasonpickpoints = async (
fetch: (_: any) => Promise<Response>,
): Promise<SeasonPickPoints[]> => {
const seasonpickpoints: SeasonPickPoints[] = await pb
.collection("seasonpickpoints")
.getFullList({ fetch: fetch });
return seasonpickpoints;
};
/** /**
* Fetch all [ScrapedDriverStandings] from the database, ordered ascendingly by position. * Fetch all [ScrapedDriverStandings] from the database, ordered ascendingly by position.
*/ */

View File

@ -169,6 +169,19 @@ export interface RacePickPointsTotal {
total_points_per_pick: number; total_points_per_pick: number;
} }
export interface SeasonPickPoints {
id: string;
user: string;
hottake_points: number;
wdc_points: number;
wcc_points: number;
doohan_points: number;
overtakes_points: number;
dnfs_points: number;
teamwinner_points: number;
podium_points: number;
}
// Scraped Data // Scraped Data
export interface ScrapedStartingGrid { export interface ScrapedStartingGrid {