Skip to content

MMR · Repositories

1 module · 12 exports · 1 repository · 0 e2e tests · 0 routes

Every table a function queries, its own helpers included, read or written. Calls to other repositories are listed apart, their tables are on their own page.

SkillRepository

app/features/mmr/SkillRepository.server.ts
Tables
CalendarEventCalendarEventDateGroupMatchSeedingSkillSkillTournament
Calls
no other repositories
Imports
no other modules
Used by
3 loaders2 scripts4 other

Types

type

CurrentSkill

no JSDoc:9
export type CurrentSkill = Pick<
	Tables["Skill"],
	"mu" | "sigma" | "matchesCount"
>;
Only used inside the module

Functions & values

function

findCurrentUserSkills

:15

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>;
})
TablesSkill
function

findCurrentTeamSkills

:36

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>;
})
TablesSkill
function

findOrderedUserOrdinalsBySeason

:62

Ordinals of the season's latest skill of every user who has one, best first.

export async function findOrderedUserOrdinalsBySeason(season: number)
TablesSkill
function

existsBySeason

:71

Whether the season has any Skill rows.

export async function existsBySeason(season: number)
TablesSkill
function

findSeedingSkills

:83

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>;
})
function

addInitialSkill

:105

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>,
)
TablesSkill
function

findSeasonProgressionByUserId

:136

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)
function

findSeasonPeakOrdinalByUserId

:156

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;
})
TablesSkill
Unit tests (2)
function

findSeasonActiveDaysByUserId

:175

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" }>>