-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add function for qualifier progression #3480
Conversation
ed5f856
to
1c29daf
Compare
); | ||
if (structure?.stage !== QUALIFYING) continue; | ||
|
||
const structureCompleted = isCompletedStructure({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Round Robins structures must always be completed because otherwise there will be no finishingPosition available, so checking whether completion is required is irrelevant
}: QualifierProgressionArgs): ResultType { | ||
const qualifyingParticipantIds: string[] = []; | ||
|
||
const structure = findStructure({ drawDefinition, structureId: mainStructureId })?.structure ?? ({} as Structure); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be more comfortable if this were explicitly mainStructure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can we trust that the value passed in as mainStructureI
is actually the structure
id of MAIN? I think we should check that the found structure.stage === MAIN and structure.stageSequence === 1 or throw an error.
And, why even require the mainstructureId to be passed in? Since it is always the only structure we're interested in, why not just derive it from the drawDefinition since we want to check anyway?
event, | ||
mainStructureId, | ||
tournamentRecord, | ||
}: QualifierProgressionArgs): ResultType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could usefully add:
const paramsCheck = checkRequiredParameters(params, [{ [DRAW_DEFINITION]: true, [EVENT]: true, [TOURNAMENT_RECORD]: true }]);
if (paramsCheck.error) return paramsCheck;
}); | ||
|
||
return decorateResult({ | ||
result: definedAttributes({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to return an array of assignedParticipantIds
It doesn't look like qualifiedDrawPositionAssignment
returns the position to which the assignment was made...
@@ -5,7 +5,7 @@ import { findStructure } from '@Acquire/findStructure'; | |||
type GetSourceStructureDetailArgs = { | |||
drawDefinition: DrawDefinition; | |||
finishingPosition?: string; | |||
targetRoundNumber: number; | |||
targetRoundNumber?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think that targetRoundNumber
should be required to be passed by new function qualifierProgression
and should be a parameter of qualifierProgression
with a default value of 1
Automatically add qualified participants to main draw structure qualifier draw positions