- Tables
- AllTeamAllTeamMemberFriendshipGroupGroupLikeGroupMatchGroupMatchContinueVoteGroupMemberGroupReadyCheckGroupReadyCheckConfirmationGroupSuggestionSkillTeamTeamMemberWithSecondaryTenStarWeaponUserUserSubmittedImageUserWeaponPool
- Calls
- AdminRepositoryModAuditLogRepositoryChatRepository
- Imports
- no other modules
- Used by
- 4 loaders7 actions1 route1 repository1 module3 routines1 script8 other
Functions & values
functionfindMapModePreferencesByGroupId
no JSDoc:29 export async function findMapModePreferencesByGroupId(groupId: number)
functionfindAllByChatRoomIds
:65 Groups owning the given chat rooms, with their members' user ids.
export async function findAllByChatRoomIds(chatRoomIds: number[])
functionfindCurrentGroups
no JSDoc:85 export async function findCurrentGroups()
functionfindActiveGroupMembers
no JSDoc:125 export async function findActiveGroupMembers()
functioninsert
no JSDoc:138 export async function insert(args: CreateGroupArgs)
Unit tests (8)
functioninsertFromPrevious
no JSDoc:184 export async function insertFromPrevious(
args: CreateGroupFromPreviousGroupArgs,
)
Unit tests (2)
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)
functiondeleteLikesAndSuggestionsByGroupId
: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>,
)
functionmorphGroups
no JSDoc:372 export function morphGroups({
survivingGroupId,
otherGroupId,
}: {
survivingGroupId: number;
otherGroupId: number;
})Unit tests (1)
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)
functionfindCurrentReceivedLikerGroupIds
: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()
functionfindAllLikesByGroupId
no JSDoc:521 export async function findAllLikesByGroupId(groupId: number)
functionfindAllSuggestionsByGroupId
:557 Suggestions the given group's members have made to each other, newest first.
export async function findAllSuggestionsByGroupId(groupId: number)
functionrechallenge
no JSDoc:575 export function rechallenge({
likerGroupId,
targetGroupId,
}: {
likerGroupId: number;
targetGroupId: number;
})functionfindFriendsAndTeammates
no JSDoc:590 export async function findFriendsAndTeammates(userId: number)
functionsetOldGroupsAsInactive
no JSDoc:661 export async function setOldGroupsAsInactive()
Unit tests (1)
functioncloseExpiredContinueVotes
no JSDoc:710 export async function closeExpiredContinueVotes()
functionfindAllMapModePreferencesBySeasonNth
no JSDoc:778 export async function findAllMapModePreferencesBySeasonNth(seasonNth: number)
functionfindRecentlyFinishedMatches
no JSDoc:796 export async function findRecentlyFinishedMatches()
functioninsertLike
no JSDoc:825 export function insertLike({
likerGroupId,
targetGroupId,
createdByUserId,
}: {
likerGroupId: number;
targetGroupId: number;
createdByUserId: number;
})functioninsertSuggestion
: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;
})functiondeleteLike
no JSDoc:891 export function deleteLike({
likerGroupId,
targetGroupId,
}: {
likerGroupId: number;
targetGroupId: number;
})functiondeleteAllLikesByGroupId
:910 Deletes every like where the given group is the liker or the target.
export function deleteAllLikesByGroupId(groupId: number)
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.
export function leaveGroup(
userId: number,
{ keepQuickAddedMembers = false }: { keepQuickAddedMembers?: boolean } = {},
)Unit tests (7)
functionrefreshGroup
no JSDoc:1025 export function refreshGroup(groupId: number, trx?: Transaction<DB>)
functionupdateOwnMemberNote
no JSDoc:1033 export function updateOwnMemberNote({
groupId,
value,
}: {
groupId: number;
value: string | null;
})functionfindAllMissedReadyCheckUserIdsByGroupId
: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)
functionfindReadyCheckByGroupId
: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)
functionfindAllReadyChecksStartedBefore
:1113 Ready checks that were started before the given time.
export function findAllReadyChecksStartedBefore(date: Date)
functioninsertReadyCheck
: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;
})functioninsertReadyCheckConfirmation
:1197 Records the user as ready to play. Confirming twice is a no-op.
export function insertReadyCheckConfirmation({
readyCheckId,
userId,
}: {
readyCheckId: number;
userId: number;
})functiondeleteReadyCheck
: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>,
)functionsetPreparingGroupAsActive
no JSDoc:1247 export function setPreparingGroupAsActive(groupId: number)
functionsetAsInactive
no JSDoc:1256 export function setAsInactive(groupId: number, trx?: Transaction<DB>)