Skip to content

Trophies · Repositories

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

TrophyRepository

app/features/trophies/TrophyRepository.server.ts
Tables
CalendarEventCalendarEventDatePendingTrophyPendingTrophyApprovalReportedWeaponSpecialTrophyOwnerSplatoonPlayerTournamentTournamentDivisionTierTournamentMatchTournamentOrganizationTournamentResultTournamentStageTournamentTeamTrophyTrophyOwnerUnvalidatedUserSubmittedImageUserUserSubmittedImageXRankPlacement
Calls
TournamentOrganizationRepository
Imports
XpTrophy
Used by
6 loaders3 actions4 routes2 repositories1 module2 scripts2 other

Functions & values

function

all

:39

Tournament trophies, special ones are listed by their own functions.

export async function all()
function

findByOrganizationId

no JSDoc:181
export async function findByOrganizationId(organizationId: number)
Loaders/org/:slug
function

findByOrganizationIds

no JSDoc:191
export async function findByOrganizationIds(organizationIds: number[])
TablesTrophy
function

findByOwnerUserIdIncludingHidden

no JSDoc:289
export async function findByOwnerUserIdIncludingHidden(userId: number)
function

findById

no JSDoc:297
export async function findById(trophyId: number)
function

findTournamentsByTrophyId

no JSDoc:326
export async function findTournamentsByTrophyId(trophyId: number)
function

isAwardableByOrganization

:473

Whether the trophy is a regular (not special) trophy of the organization, i.e. one its tournaments can award.

export async function isAwardableByOrganization({
	trophyId,
	organizationId,
}: {
	trophyId: number;
	organizationId: number;
})
TablesTrophy
function

existsByName

:492

Whether the name is taken by a trophy or a submission still awaiting review.

export async function existsByName(args: {
	name: string;
	excludeTrophyId?: number;
})
Unit tests (4)
function

findAllXp

no JSDoc:529
export function findAllXp()
TablesTrophy
Loaders/trophies
function

findCodeById

no JSDoc:537
export async function findCodeById(trophyId: number)
TablesTrophy
function

findXpWeaponCountsById

no JSDoc:547
export function findXpWeaponCountsById({
	trophyId,
	weaponIds,
	milestone,
}: {
	trophyId: number;
	weaponIds: readonly MainWeaponId[];
	milestone: number;
})
Unit tests (1)
function

findAllForEditing

no JSDoc:576
export async function findAllForEditing()
TablesTrophy
PermissionsEDIT
function

findAllBackfillableTournaments

no JSDoc:589
export function findAllBackfillableTournaments({
	organizationId,
	substringMatches,
}: {
	organizationId: number;
	substringMatches: string[];
})
function

insertTournamentOwners

no JSDoc:642
export async function insertTournamentOwners(
	awards: TournamentOwnersArgs[],
	trx: Transaction<DB>,
)
function

backfill

no JSDoc:687
export function backfill({
	trophyId,
	awards,
}: {
	trophyId: number;
	awards: Array<Omit<TournamentOwnersArgs, "trophyId">>;
})
Unit tests (3)
function

syncSpecialTrophies

:721

Recomputes X Power trophy ownership from the Top 500 placements of linked players (see {@link XpTrophy.awards}). Still-eligible owners keep their createdAt.

export function syncSpecialTrophies()
Unit tests (4)
function

createPending

no JSDoc:794
export async function createPending(args: {
	name: string;
	model: string;
	description: string;
	organizationId: number;
	submitterUserId: number;
	targetTrophyId?: number;
	managerId?: number;
	creatorId?: number;
})
function

findPendingById

no JSDoc:932
export async function findPendingById(id: number)
function

allPending

no JSDoc:940
export async function allPending()
function

pendingBySubmitter

no JSDoc:946
export async function pendingBySubmitter(submitterUserId: number)
function

unreviewedCountBySubmitter

no JSDoc:953
export async function unreviewedCountBySubmitter(submitterUserId: number)
function

deletePending

no JSDoc:965
export async function deletePending(id: number)
function

declinePending

no JSDoc:969
export async function declinePending(args: {
	id: number;
	reason: string;
	declinedByUserId: number;
})
function

addApproval

no JSDoc:1004
export async function addApproval(args: {
	pendingTrophyId: number;
	userId: number;
})
Unit tests not about one export (14)