Skip to content

Top search · Repositories

0 modules · 0 exports · 1 repository · 2 e2e tests · 2 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.

XRankPlacementRepository

app/features/top-search/XRankPlacementRepository.server.ts
Tables
SplatoonPlayerTenStarWeaponUserXRankPlacement
Calls
no other repositories
Imports
no other modules
Used by
3 loaders1 action1 route1 repository1 component2 scripts2 other

Types

type

XRankPlacementInsertArgs

no JSDoc:9
export type XRankPlacementInsertArgs = Omit<
	Tables["XRankPlacement"],
	"id" | "playerId"
> & {
	/** In-game id of the player the placement belongs to. */
	playerSplId: string;
	/** For sources that already know the pairing; claiming later goes through `AdminRepository.linkUserAndPlayer`. */
	playerUserId?: number;
};
type

FindPlacement

no JSDoc:232
export type FindPlacement = InferResult<
	ReturnType<typeof xRankPlacementsQueryBase>
>[number];

Functions & values

function

insertMany

:20

Inserts placements, creating SplatoonPlayer rows for new in-game ids. Returns ids in insertion order.

export function insertMany(placements: XRankPlacementInsertArgs[])
function

deleteAllByMonthYear

:56

Removes every placement of the given month.

export function deleteAllByMonthYear(
	args: Pick<Tables["XRankPlacement"], "month" | "year">,
)
function

unlinkPlayerByUserId

no JSDoc:66
export function unlinkPlayerByUserId(userId: number)
function

isPlayerLinkedByUserId

:75

Whether the user has a linked Splatoon player (i.e. has claimed their X Rank results).

export async function isPlayerLinkedByUserId(userId: number): Promise<boolean>
function

findTenStarWeaponSplIdsByUserId

:86

Weapons the user has a ten-star badge for, from their linked X Rank placements.

export async function findTenStarWeaponSplIdsByUserId(userId: number)
function

findPeakVerifiedXpByUserId

:97

From the linked player's denormalized SplatoonPlayer.peakXp (see {@link refreshAllPeakXp}); null without one.

export async function findPeakVerifiedXpByUserId(
	userId: Tables["User"]["id"],
): Promise<number | null>
function

findPlacementsOfMonth

no JSDoc:129
export async function findPlacementsOfMonth(
	args: Pick<Tables["XRankPlacement"], "mode" | "region" | "month" | "year">,
)
function

findPlacementsByPlayerId

no JSDoc:141
export async function findPlacementsByPlayerId(
	playerId: Tables["XRankPlacement"]["playerId"],
)
function

findPlacementsByUserId

no JSDoc:153
export async function findPlacementsByUserId(
	userId: Tables["User"]["id"],
	options?: {
		limit?: number;
		weaponId?: MainWeaponId;
		weaponIds?: readonly MainWeaponId[];
	},
)
Unit tests (1)
function

findAllMonthYears

:184

Every month with placements, newest first.

export async function findAllMonthYears()
function

findPeaksByUserId

no JSDoc:194
export async function findPeaksByUserId(
	userId: Tables["User"]["id"],
	division?: "both" | "tentatek" | "takoroka",
)
Unit tests not about one export (1)