diff --git a/documentation/docs/apis/draw-engine-api.md b/documentation/docs/apis/draw-engine-api.md index 6c55b7830b..ecd10f4151 100644 --- a/documentation/docs/apis/draw-engine-api.md +++ b/documentation/docs/apis/draw-engine-api.md @@ -300,16 +300,16 @@ Returns categorized matchUps from a single structure. ```js const { upcomingMatchUps, pendingMatchUps, completedMatchUps, abandonedMatchUps, byeMatchUps } = drawEngine.getStructureMatchUps({ - structureId, - context, // optional context to be added into matchUps - inContext, // boolean - add context { drawId, structureId, participant, individualParticipants ... } - nextMatchUps, // optioanl - boolean - to include winnerTo and loserTo - matchUpFilters, // attribute filters - contextFilters, // filters based on context attributes - tournamentParticipants, // optional - provide an array of tournamentParticipants to add into matchUps - requireParticipants, // optional - require that participants be loaded into drawEngine or passed into method tournamentAppliedPolicies, // any policies, such as privacy, to be applied to matchUps scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds } + tournamentParticipants, // optional - provide an array of tournamentParticipants to add into matchUps + requireParticipants, // optional - require that participants be loaded into drawEngine or passed into method + contextFilters, // filters based on context attributes + matchUpFilters, // attribute filters + structureId, + nextMatchUps, // optioanl - boolean - to include winnerTo and loserTo + inContext, // boolean - add context { drawId, structureId, participant, individualParticipants ... } + context, // optional context to be added into matchUps }); ``` diff --git a/documentation/docs/governors/query-governor.md b/documentation/docs/governors/query-governor.md index 8261d7a6a4..8293b58040 100644 --- a/documentation/docs/governors/query-governor.md +++ b/documentation/docs/governors/query-governor.md @@ -30,8 +30,8 @@ Returns all matchUps for an event. ```js const { matchUps } = allEventMatchUps({ + scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds } participantsProfile, // optional - ability to specify additions to context (see parameters of getParticipants()) - scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds } matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []] contextFilters, // filters based on context attributes nextMatchUps: true, // include winner/loser target matchUp details @@ -61,7 +61,7 @@ Return an array of all matchUps contained within a tournament. These matchUps ar ```js const { matchUps, groupInfo } = engine.allTournamentMatchUps({ - scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds } + scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds } participantsProfile, // optional - ability to specify additions to context (see parameters of getParticipants()) matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []] contextFilters, // filters based on context attributes @@ -118,13 +118,13 @@ Returns matchUps for an event grouped by status. ```js const { abandonedMatchUps, byeMatchUps, completedMatchUps, pendingMatchUps, upcomingMatchUps } = engine.eventMatchUps({ - eventId, - nextMatchUps, // optional boolean; include winner/loser target matchUp details - matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []] - contextFilters, + scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds } tournamentAppliedPolicies, - scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds } - inContext: true, // optional - adds context details to all matchUps + contextFilters, // optiona; filter by attributes that are only present after matchUpContext has been added (hydration) + matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []] + nextMatchUps, // optional boolean; include winner/loser target matchUp details + inContext, // optional - adds context details to all matchUps + eventId, }); ``` @@ -660,7 +660,7 @@ const { allocatedCourts: [{ venueId, courtid }], // applies only to TEAM matchUps }, } = engine.getMatchUpScheduleDetails({ - scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds } + scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds } matchUp, }); ``` @@ -1515,9 +1515,9 @@ Returns tournament matchUps grouped by matchUpStatus. These matchUps are returne ```js const { abandonedMatchUps, completedMatchUps, upcomingMatchUps, pendingMatchUps, byeMatchUps, groupInfo } = engine.tournamentMatchUps({ - matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []] + scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds } policyDefinitions, // optional - seeding or avoidance policies to be used when placing participants - scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds } + matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []] }); ``` diff --git a/src/query/matchUp/getMatchUpScheduleDetails.ts b/src/query/matchUp/getMatchUpScheduleDetails.ts index 127eac4999..63284f092c 100644 --- a/src/query/matchUp/getMatchUpScheduleDetails.ts +++ b/src/query/matchUp/getMatchUpScheduleDetails.ts @@ -9,6 +9,7 @@ import { matchUpAssignedVenueId } from '@Query/matchUp/venueAssignment'; import { matchUpTimeModifiers } from '@Query/matchUp/timeModifiers'; import { matchUpDuration } from '@Query/matchUp/matchUpDuration'; import { matchUpCourtOrder } from '@Query/matchUp/courtOrder'; +import { getHomeParticipantId } from './getHomeParticipantId'; import { matchUpStartTime } from '@Query/matchUp/startTime'; import { definedAttributes } from '@Tools/definedAttributes'; import { getVenueData } from '@Query/venues/getVenueData'; @@ -22,7 +23,6 @@ import { Event, Tournament, EventTypeUnion } from '@Types/tournamentTypes'; import { MISSING_MATCHUP } from '@Constants/errorConditionConstants'; import { HydratedMatchUp } from '@Types/hydrated'; import { TEAM } from '@Constants/eventConstants'; -import { getHomeParticipantId } from './getHomeParticipantId'; type GetMatchUpScheduleDetailsArgs = { scheduleVisibilityFilters?: ScheduleVisibilityFilters; diff --git a/src/query/matchUps/getEventMatchUps.ts b/src/query/matchUps/getEventMatchUps.ts index bf0fa7ba46..a8f61f9899 100644 --- a/src/query/matchUps/getEventMatchUps.ts +++ b/src/query/matchUps/getEventMatchUps.ts @@ -1,12 +1,13 @@ -import { getEventPublishStatus } from '../event/getEventPublishStatus'; +import { hydrateParticipants } from '@Query/participants/hydrateParticipants'; +import { getEventPublishStatus } from '@Query/event/getEventPublishStatus'; +import { getContextContent } from '@Query/hierarchical/getContextContent'; +import { getDrawMatchUps } from '@Query/matchUps/drawMatchUps'; import { definedAttributes } from '@Tools/definedAttributes'; -import { hydrateParticipants } from '../participants/hydrateParticipants'; -import { MISSING_EVENT } from '@Constants/errorConditionConstants'; -import { getContextContent } from '../hierarchical/getContextContent'; -import { getDrawMatchUps } from './drawMatchUps'; -import { SUCCESS } from '@Constants/resultConstants'; +// constants and types import { GetMatchUpsArgs, GroupsMatchUpsResult } from '@Types/factoryTypes'; +import { MISSING_EVENT } from '@Constants/errorConditionConstants'; +import { SUCCESS } from '@Constants/resultConstants'; export function eventMatchUps(params: GetMatchUpsArgs): GroupsMatchUpsResult { let { participants: tournamentParticipants, contextContent, participantMap } = params;