Skip to content

SendouQ · Repositories

1 module · 8 exports · 2 repositories · 16 e2e tests · 9 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.

PrivateUserNoteRepository

app/features/sendouq/PrivateUserNoteRepository.server.ts
Tables
PrivateUserNote
Calls
no other repositories
Imports
no other modules
Used by
1 route1 script

Functions & values

function

findAllOwn

no JSDoc:6
export function findAllOwn(
	/** Which users to get notes for, if omitted all notes for the author are returned */
	targetUserIds: number[] = [],
)
function

upsertOwnNote

no JSDoc:32
export function upsertOwnNote(
	args: Omit<TablesInsertable["PrivateUserNote"], "authorId">,
)
Unit tests (2)
function

deleteOwnNoteById

no JSDoc:54
export function deleteOwnNoteById(targetId: number)
Unit tests not about one export (2)

SQGroupRepository

app/features/sendouq/SQGroupRepository.server.ts
Tables
AllTeamAllTeamMemberFriendshipGroupGroupLikeGroupMatchGroupMatchContinueVoteGroupMemberGroupReadyCheckGroupReadyCheckConfirmationGroupSuggestionSkillTeamTeamMemberWithSecondaryTenStarWeaponUserUserSubmittedImageUserWeaponPool
Calls
AdminRepositoryModAuditLogRepositoryChatRepository
Imports
no other modules
Used by
4 loaders7 actions1 route1 repository1 module3 routines1 script8 other

Functions & values

function

findMapModePreferencesByGroupId

no JSDoc:29
export async function findMapModePreferencesByGroupId(groupId: number)
function

findAllByChatRoomIds

:65

Groups owning the given chat rooms, with their members' user ids.

export async function findAllByChatRoomIds(chatRoomIds: number[])
function

findCurrentGroups

no JSDoc:85
export async function findCurrentGroups()
function

findActiveGroupMembers

no JSDoc:125
export async function findActiveGroupMembers()
function

syncTeamId

:276

Stamps the group as a team's when a full group's worth of members share one, else clears it. A team's group queues on the team's own map & mode preferences.

export async function syncTeamId(groupId: number, trx: Transaction<DB>)
Unit tests (4)
function

deleteLikesAndSuggestionsByGroupId

:339

Deletes every like and suggestion with the group on either side, for when they stop being actionable (roster changed, match started).

export async function deleteLikesAndSuggestionsByGroupId(
	groupId: number,
	trx: Transaction<DB>,
)
function

morphGroups

no JSDoc:372
export function morphGroups({
	survivingGroupId,
	otherGroupId,
}: {
	survivingGroupId: number;
	otherGroupId: number;
})
Unit tests (1)
Actions/q/looking
function

insertMember

:470

Adds the user to the group. addedByUserId is the member who quick added them as their friend, null when they joined on their own.

export async function insertMember(
	groupId: number,
	{
		userId,
		addedByUserId = null,
	}: { userId: number; addedByUserId?: number | null },
)
Unit tests (1)
function

findCurrentReceivedLikerGroupIds

:503

Ids of the groups that have pending likes on each non-inactive group, keyed by the liked group's id.

export async function findCurrentReceivedLikerGroupIds()
function

findAllLikesByGroupId

no JSDoc:521
export async function findAllLikesByGroupId(groupId: number)
function

findAllSuggestionsByGroupId

:557

Suggestions the given group's members have made to each other, newest first.

export async function findAllSuggestionsByGroupId(groupId: number)
function

rechallenge

no JSDoc:575
export function rechallenge({
	likerGroupId,
	targetGroupId,
}: {
	likerGroupId: number;
	targetGroupId: number;
})
TablesGroupLike
Actions/q/looking
function

setOldGroupsAsInactive

no JSDoc:661
export async function setOldGroupsAsInactive()
Unit tests (1)
function

closeExpiredContinueVotes

no JSDoc:710
export async function closeExpiredContinueVotes()
function

findAllMapModePreferencesBySeasonNth

no JSDoc:778
export async function findAllMapModePreferencesBySeasonNth(seasonNth: number)
TablesSkillUser
function

findRecentlyFinishedMatches

no JSDoc:796
export async function findRecentlyFinishedMatches()
function

insertLike

no JSDoc:825
export function insertLike({
	likerGroupId,
	targetGroupId,
	createdByUserId,
}: {
	likerGroupId: number;
	targetGroupId: number;
	createdByUserId: number;
})
function

insertSuggestion

:862

Marks a group as worth a look for the suggester's own teammates. Suggesting twice is a no-op.

export function insertSuggestion({
	suggesterGroupId,
	targetGroupId,
	createdByUserId,
}: {
	suggesterGroupId: number;
	targetGroupId: number;
	createdByUserId: number;
})
function

deleteLike

no JSDoc:891
export function deleteLike({
	likerGroupId,
	targetGroupId,
}: {
	likerGroupId: number;
	targetGroupId: number;
})
Actions/q/looking
function

deleteAllLikesByGroupId

:910

Deletes every like where the given group is the liker or the target.

export function deleteAllLikesByGroupId(groupId: number)
TablesGroupLike
function

leaveGroup

:921

Removes the user from their group (deleting it if they were last) along with the members they quick added, and in turn the ones those quick added. With keepQuickAddedMembers only the user is removed, for when they are kicked rather than leave, and the members they quick added stay as regular members. A ready check the group was in is called off. Challenges the group received and challenges/suggestions the leavers made are cleared.

  • @returns

    the ids of the groups that were in the called off ready check and the ids of the users who left

export function leaveGroup(
	userId: number,
	{ keepQuickAddedMembers = false }: { keepQuickAddedMembers?: boolean } = {},
)
Unit tests (7)
Actions/q/looking
function

refreshGroup

no JSDoc:1025
export function refreshGroup(groupId: number, trx?: Transaction<DB>)
TablesGroup
Actions/q/looking
function

updateOwnMemberNote

no JSDoc:1033
export function updateOwnMemberNote({
	groupId,
	value,
}: {
	groupId: number;
	value: string | null;
})
Actions/q/looking
function

findAllMissedReadyCheckUserIdsByGroupId

:1060

User ids of the group's members who let a ready check expire without confirming, and can thus be kicked by the rest of the group.

export async function findAllMissedReadyCheckUserIdsByGroupId(groupId: number)
function

findReadyCheckByGroupId

:1072

The ready check the group is in, with each member of both groups and when (if at all) they confirmed being ready.

export async function findReadyCheckByGroupId(groupId: number)
function

findAllReadyChecksStartedBefore

:1113

Ready checks that were started before the given time.

export function findAllReadyChecksStartedBefore(date: Date)
function

insertReadyCheck

:1145

Starts a ready check between two groups, taking both and everything they had pending out of the looking pool. The starter counts as ready right away.

export function insertReadyCheck({
	alphaGroupId,
	bravoGroupId,
	confirmedByUserId,
}: {
	alphaGroupId: number;
	bravoGroupId: number;
	confirmedByUserId: number;
})
function

insertReadyCheckConfirmation

:1197

Records the user as ready to play. Confirming twice is a no-op.

  • @returns

    Whether every member of both groups has now confirmed, or null if the ready check no longer exists

export function insertReadyCheckConfirmation({
	readyCheckId,
	userId,
}: {
	readyCheckId: number;
	userId: number;
})
function

deleteReadyCheck

:1237

Ends a ready check, returning both groups to the looking pool. markMissedMembers marks the unconfirmed as having missed it, which lets the rest of their group kick them.

export function deleteReadyCheck(
	{ id, markMissedMembers }: { id: number; markMissedMembers: boolean },
	trx?: Transaction<DB>,
)
function

setPreparingGroupAsActive

no JSDoc:1247
export function setPreparingGroupAsActive(groupId: number)
TablesGroup
function

setAsInactive

no JSDoc:1256
export function setAsInactive(groupId: number, trx?: Transaction<DB>)
TablesGroup