tods-competition-factory 2.1.19 → 2.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.1.19';
6
+ return '2.1.20';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -14383,10 +14383,17 @@ function getParticipants(params) {
14383
14383
  const template = isObject(withIndividualParticipants) ? withIndividualParticipants : undefined;
14384
14384
  for (const participant of filteredParticipants) {
14385
14385
  for (const individualParticipantId of participant.individualParticipantIds ?? []) {
14386
- if (!participant.individualParticipants)
14386
+ const mappedParticipant = participantMap[participant.participantId].participant;
14387
+ if (!mappedParticipant?.individualParticipants)
14388
+ mappedParticipant.individualParticipants = [];
14389
+ if (!participant.individualParticipants) {
14387
14390
  participant.individualParticipants = [];
14391
+ }
14388
14392
  const source = ppMap.get(individualParticipantId);
14389
- participant.individualParticipants.push(template ? attributeFilter({ template, source }) : source);
14393
+ const individualParticipant = template ? attributeFilter({ template, source }) : source;
14394
+ if (mappedParticipant?.individualParticipants)
14395
+ mappedParticipant.individualParticipants.push(individualParticipant);
14396
+ participant.individualParticipants.push(individualParticipant);
14390
14397
  }
14391
14398
  }
14392
14399
  }
@@ -22781,7 +22788,7 @@ function modifyMatchUpScore(params) {
22781
22788
  let matchUpFormat = params.matchUpFormat;
22782
22789
  let matchUp = params.matchUp;
22783
22790
  let structure;
22784
- const { matchUpStatusCodes, removeWinningSide, tournamentRecord, drawDefinition, matchUpStatus, removeScore, winningSide, matchUpId, event, notes, score, } = params;
22791
+ const { matchUpStatusCodes, tournamentRecord, drawDefinition, matchUpStatus, removeScore, winningSide, matchUpId, event, notes, score, } = params;
22785
22792
  const hasPolicies = params.appliedPolicies && Object.keys(params.appliedPolicies).length;
22786
22793
  const appliedPolicies = hasPolicies
22787
22794
  ? params.appliedPolicies
@@ -22823,7 +22830,7 @@ function modifyMatchUpScore(params) {
22823
22830
  matchUp.matchUpStatusCodes = matchUpStatusCodes;
22824
22831
  if (winningSide)
22825
22832
  matchUp.winningSide = winningSide;
22826
- if (removeWinningSide)
22833
+ if (params.removeWinningSide)
22827
22834
  matchUp.winningSide = undefined;
22828
22835
  if (!structure && drawDefinition) {
22829
22836
  ({ structure } = findDrawMatchUp({
@@ -22930,9 +22937,10 @@ function modifyMatchUpScore(params) {
22930
22937
  }
22931
22938
 
22932
22939
  function attemptToModifyScore(params) {
22933
- const { matchUpStatusCodes, matchUpStatus, structure, matchUp, dualMatchUp, inContextMatchUp } = params;
22940
+ const { matchUpStatusCodes, matchUpStatus, structure, matchUp, dualMatchUp, inContextMatchUp, autoCalcDisabled } = params;
22934
22941
  const matchUpStatusIsValid = isDirectingMatchUpStatus({ matchUpStatus }) ||
22935
- ([CANCELLED$1, ABANDONED$1].includes(matchUpStatus) && dualMatchUp);
22942
+ ([CANCELLED$1, ABANDONED$1].includes(matchUpStatus) && dualMatchUp) ||
22943
+ autoCalcDisabled;
22936
22944
  const participantsCount = matchUp?.sides?.map((side) => side.participantId).filter(Boolean).length ||
22937
22945
  inContextMatchUp?.sides?.map((side) => side.participantId).filter(Boolean).length;
22938
22946
  const stack = 'attemptToModifyScore';
@@ -44009,7 +44017,7 @@ function noDownstreamDependencies(params) {
44009
44017
  let connectedStructures;
44010
44018
  const { structure, drawDefinition, dualMatchUp, disableAutoCalc } = params;
44011
44019
  if (dualMatchUp?._disableAutoCalc && disableAutoCalc !== false) {
44012
- return attemptToModifyScore(params);
44020
+ return attemptToModifyScore({ ...params, removeWinningSide });
44013
44021
  }
44014
44022
  const { connectedStructureIds } = checkConnectedStructures({
44015
44023
  drawDefinition,