From db0365adade5a9d2b6f4a2e0f8e335abebfad611 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Fri, 26 Dec 2025 21:38:16 +0100 Subject: [PATCH] Lib: Add schema + fetcher for seasonpickpoints table --- src/lib/fetch.ts | 14 ++++++++++++++ src/lib/schema.ts | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 5ae9e49..7ea3be4 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -18,6 +18,7 @@ import type { ScrapedTeamStanding, SeasonPick, SeasonPickedUser, + SeasonPickPoints, SeasonPickResult, Substitution, Team, @@ -323,6 +324,19 @@ export const fetch_racepickpointstotal = async ( return racepickpointstotal; }; +/** + * Fetch all [SeasonPickPoints] from the database. + */ +export const fetch_seasonpickpoints = async ( + fetch: (_: any) => Promise, +): Promise => { + const seasonpickpoints: SeasonPickPoints[] = await pb + .collection("seasonpickpoints") + .getFullList({ fetch: fetch }); + + return seasonpickpoints; +}; + /** * Fetch all [ScrapedDriverStandings] from the database, ordered ascendingly by position. */ diff --git a/src/lib/schema.ts b/src/lib/schema.ts index 790e8b8..4455329 100644 --- a/src/lib/schema.ts +++ b/src/lib/schema.ts @@ -169,6 +169,19 @@ export interface RacePickPointsTotal { 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 export interface ScrapedStartingGrid {