tods-competition-factory 0.91.0 → 0.93.2

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.
@@ -249,7 +249,7 @@ const matchUpFormatCode = {
249
249
  };
250
250
 
251
251
  function factoryVersion() {
252
- return '0.91.0';
252
+ return '0.93.2';
253
253
  }
254
254
 
255
255
  const FORMAT_STANDARD = 'SET3-S:6/TB7'; // Best of 3 Tiebreak Sets to 6
@@ -7562,7 +7562,7 @@ var collectionDefinitions$8 = [
7562
7562
  matchUpValue: 3
7563
7563
  }
7564
7564
  ];
7565
- var collectionGroups$1 = [
7565
+ var collectionGroups$2 = [
7566
7566
  {
7567
7567
  groupNumber: 1,
7568
7568
  groupName: "Day 1"
@@ -7582,7 +7582,7 @@ var winCriteria$8 = {
7582
7582
  };
7583
7583
  var LAVER_CUP_TIE_FORMAT = {
7584
7584
  collectionDefinitions: collectionDefinitions$8,
7585
- collectionGroups: collectionGroups$1,
7585
+ collectionGroups: collectionGroups$2,
7586
7586
  tieFormatName: tieFormatName$8,
7587
7587
  winCriteria: winCriteria$8
7588
7588
  };
@@ -7658,6 +7658,7 @@ var collectionDefinitions$6 = [
7658
7658
  ageCategoryCode: "14U"
7659
7659
  },
7660
7660
  collectionName: "14U Doubles",
7661
+ collectionGroupNumber: 1,
7661
7662
  matchUpCount: 1,
7662
7663
  matchUpFormat: "SET1-S:8/TB7",
7663
7664
  matchUpType: "DOUBLES",
@@ -7668,6 +7669,7 @@ var collectionDefinitions$6 = [
7668
7669
  ageCategoryCode: "16U"
7669
7670
  },
7670
7671
  collectionName: "16U Doubles",
7672
+ collectionGroupNumber: 1,
7671
7673
  matchUpCount: 1,
7672
7674
  matchUpFormat: "SET1-S:8/TB7",
7673
7675
  matchUpType: "DOUBLES",
@@ -7678,18 +7680,30 @@ var collectionDefinitions$6 = [
7678
7680
  ageCategoryCode: "18U"
7679
7681
  },
7680
7682
  collectionName: "18U Doubles",
7683
+ collectionGroupNumber: 1,
7681
7684
  matchUpCount: 1,
7682
7685
  matchUpFormat: "SET1-S:8/TB7",
7683
7686
  matchUpType: "DOUBLES",
7684
7687
  matchUpValue: 1
7685
7688
  }
7686
7689
  ];
7690
+ var collectionGroups$1 = [
7691
+ {
7692
+ groupNumber: 1,
7693
+ groupName: "Doubles",
7694
+ groupValue: 1,
7695
+ winCriteria: {
7696
+ valueGoal: 2
7697
+ }
7698
+ }
7699
+ ];
7687
7700
  var tieFormatName$6 = "USTA_BREWER_CUP";
7688
7701
  var winCriteria$6 = {
7689
7702
  valueGoal: 5
7690
7703
  };
7691
7704
  var USTA_BREWER_CUP_TIE_FORMAT = {
7692
7705
  collectionDefinitions: collectionDefinitions$6,
7706
+ collectionGroups: collectionGroups$1,
7693
7707
  tieFormatName: tieFormatName$6,
7694
7708
  winCriteria: winCriteria$6
7695
7709
  };
@@ -14193,12 +14207,14 @@ function allDrawMatchUps$1({
14193
14207
  const {
14194
14208
  eventId,
14195
14209
  eventName,
14210
+ eventType,
14196
14211
  category,
14197
14212
  gender,
14198
14213
  matchUpFormat
14199
14214
  } = event || {};
14200
14215
  const additionalContext = { ...context,
14201
14216
  eventId,
14217
+ eventType,
14202
14218
  eventName,
14203
14219
  category,
14204
14220
  gender,
@@ -20492,21 +20508,30 @@ function scoreModification(params) {
20492
20508
  }
20493
20509
 
20494
20510
  function isActiveDownstream(params) {
20495
- var _winnerMatchUp$drawPo;
20511
+ var _targetData$matchUp, _winnerMatchUp$drawPo;
20496
20512
 
20497
20513
  const {
20498
20514
  inContextDrawMatchUps,
20499
20515
  targetData,
20500
- drawDefinition
20516
+ drawDefinition,
20517
+ relevantLink
20501
20518
  } = params;
20519
+ const fmlcBYE = (relevantLink === null || relevantLink === void 0 ? void 0 : relevantLink.linkCondition) === FIRST_MATCHUP && (targetData === null || targetData === void 0 ? void 0 : (_targetData$matchUp = targetData.matchUp) === null || _targetData$matchUp === void 0 ? void 0 : _targetData$matchUp.matchUpStatus) === BYE;
20520
+ if (fmlcBYE) return false;
20502
20521
  const {
20503
20522
  targetMatchUps: {
20504
20523
  loserMatchUp,
20505
20524
  winnerMatchUp
20506
- }
20525
+ },
20526
+ targetLinks
20507
20527
  } = targetData;
20528
+ const loserMatchUpWalkover = [WALKOVER$1].includes(loserMatchUp === null || loserMatchUp === void 0 ? void 0 : loserMatchUp.matchUpStatus);
20508
20529
  const winnerDrawPositionsCount = (winnerMatchUp === null || winnerMatchUp === void 0 ? void 0 : (_winnerMatchUp$drawPo = winnerMatchUp.drawPositions) === null || _winnerMatchUp$drawPo === void 0 ? void 0 : _winnerMatchUp$drawPo.filter(Boolean).length) || 0;
20509
- if (loserMatchUp !== null && loserMatchUp !== void 0 && loserMatchUp.winningSide || winnerDrawPositionsCount === 2 && winnerMatchUp !== null && winnerMatchUp !== void 0 && winnerMatchUp.winningSide) return true;
20530
+
20531
+ if (loserMatchUp !== null && loserMatchUp !== void 0 && loserMatchUp.winningSide && !loserMatchUpWalkover || winnerDrawPositionsCount === 2 && winnerMatchUp !== null && winnerMatchUp !== void 0 && winnerMatchUp.winningSide) {
20532
+ return true;
20533
+ }
20534
+
20510
20535
  let loserTargetData = loserMatchUp && positionTargets({
20511
20536
  matchUpId: loserMatchUp.matchUpId,
20512
20537
  drawDefinition,
@@ -20518,8 +20543,9 @@ function isActiveDownstream(params) {
20518
20543
  drawDefinition
20519
20544
  });
20520
20545
  const loserActive = loserTargetData && isActiveDownstream({
20521
- inContextDrawMatchUps,
20546
+ relevantLink: targetLinks === null || targetLinks === void 0 ? void 0 : targetLinks.loserTargetLink,
20522
20547
  targetData: loserTargetData,
20548
+ inContextDrawMatchUps,
20523
20549
  drawDefinition
20524
20550
  });
20525
20551
  const winnerActive = winnerTargetData && isActiveDownstream({
@@ -22275,7 +22301,8 @@ function deleteVenue({
22275
22301
 
22276
22302
  checkSchedulingProfile$1({
22277
22303
  tournamentRecords
22278
- });
22304
+ }); // NOTE: Consider what to do with references to venueId that are in matchUp timeItems
22305
+
22279
22306
  return deleted ? SUCCESS : {
22280
22307
  error: VENUE_NOT_FOUND
22281
22308
  };
@@ -47126,6 +47153,7 @@ function generateFlightProfile({
47126
47153
  deleteExisting,
47127
47154
  sortDescending,
47128
47155
  drawNames = [],
47156
+ scaledEntries,
47129
47157
  flightsCount,
47130
47158
  flightValues,
47131
47159
  splitMethod,
@@ -47149,16 +47177,19 @@ function generateFlightProfile({
47149
47177
  };
47150
47178
  }
47151
47179
 
47152
- const {
47153
- scaledEntries
47154
- } = getScaledEntries({
47155
- tournamentRecord,
47156
- scaleAttributes,
47157
- scaleSortMethod,
47158
- sortDescending,
47159
- event,
47160
- stage
47161
- });
47180
+ if (!scaledEntries) {
47181
+ ({
47182
+ scaledEntries
47183
+ } = getScaledEntries({
47184
+ tournamentRecord,
47185
+ scaleAttributes,
47186
+ scaleSortMethod,
47187
+ sortDescending,
47188
+ event,
47189
+ stage
47190
+ }));
47191
+ }
47192
+
47162
47193
  const scaledEntryParticipantIds = scaledEntries.map(getParticipantId);
47163
47194
  const unscaledEntries = eventEntries.filter(({
47164
47195
  participantId