SkillRepository
app/features/mmr/SkillRepository.server.ts- Tables
- CalendarEventCalendarEventDateGroupMatchSeedingSkillSkillTournament
- Calls
- no other repositories
- Imports
- no other modules
- Used by
- 3 loaders2 scripts4 other
Types
export type CurrentSkill = Pick< Tables["Skill"], "mu" | "sigma" | "matchesCount" >;
Functions & values
Season's latest skill of each user, keyed by user id; users without one are absent.
export async function findCurrentUserSkills({ season, userIds, }: { season: number; userIds: Array<number>; })
Season's latest skill of each team, keyed by identifier; teams without one are absent.
export async function findCurrentTeamSkills({ season, identifiers, }: { season: number; identifiers: Array<SkillTeamIdentifier>; })
Ordinals of the season's latest skill of every user who has one, best first.
export async function findOrderedUserOrdinalsBySeason(season: number)
Whether the season has any Skill rows.
export async function existsBySeason(season: number)
Seeding skills of the users for one seeding type, keyed by user id; users without one are absent.
export async function findSeedingSkills({ type, userIds, }: { type: Tables["SeedingSkill"]["type"]; userIds: Array<number>; })
Adds a user's starting skill of a season.
export async function addInitialSkill( { mu, sigma, season, userId, }: { mu: number; sigma: number; season: number; userId: number; }, trx?: Transaction<DB>, )
User's ordinal after the last set of each day of the season they played on, days ascending.
export async function findSeasonProgressionByUserId({ userId, season, }: { userId: number; season: number; })
Unit tests (2)
User's highest ordinal of the season, null before they have played enough sets for one.
export async function findSeasonPeakOrdinalByUserId({ userId, season, }: { userId: number; season: number; })
Unit tests (2)
Days (yyyy-MM-dd) of the season the user played a set on, with whether it was SendouQ, tournaments or both.
export async function findSeasonActiveDaysByUserId({ userId, season, }: { userId: number; season: number; }): Promise<Array<{ date: string; activity: "sq" | "tournament" | "both" }>>