tods-competition-factory 0.69.3 → 0.69.4

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.69.3';
252
+ return '0.69.4';
253
253
  }
254
254
 
255
255
  const FORMAT_STANDARD = 'SET3-S:6/TB7'; // Best of 3 Tiebreak Sets to 6
@@ -9540,7 +9540,11 @@ function getRoundMatchUps$1({
9540
9540
  roundIndex += 1;
9541
9541
  }
9542
9542
  });
9543
+ const hasOddMatchUpsCount = Object.values(roundProfile).find(({
9544
+ matchUpsCount
9545
+ }) => !isPowerOf2(matchUpsCount));
9543
9546
  return {
9547
+ hasOddMatchUpsCount,
9544
9548
  maxMatchUpsCount,
9545
9549
  roundMatchUps,
9546
9550
  roundNumbers,
@@ -10698,7 +10702,7 @@ function isLucky({
10698
10702
 
10699
10703
  if (!structure) return false;
10700
10704
  const {
10701
- roundProfile,
10705
+ hasOddMatchUpsCount,
10702
10706
  roundMatchUps
10703
10707
  } = getRoundMatchUps$1({
10704
10708
  matchUps: structure.matchUps || []
@@ -10709,9 +10713,6 @@ function isLucky({
10709
10713
  const noSecondRoundDrawPositions = !(roundMatchUps !== null && roundMatchUps !== void 0 && (_roundMatchUps$2 = roundMatchUps[2]) !== null && _roundMatchUps$2 !== void 0 && _roundMatchUps$2.find(({
10710
10714
  drawPositions
10711
10715
  }) => drawPositions));
10712
- const hasOddMatchUpsCount = Object.values(roundProfile).find(({
10713
- matchUpsCount
10714
- }) => !isPowerOf2(matchUpsCount));
10715
10716
  return hasOddMatchUpsCount && !(structure !== null && structure !== void 0 && structure.structures) && hasFirstRoundDrawPositions && noSecondRoundDrawPositions && !(drawDefinition !== null && drawDefinition !== void 0 && drawDefinition.drawType && drawDefinition.drawType !== LUCKY_DRAW);
10716
10717
  }
10717
10718
 
@@ -12046,10 +12047,10 @@ function addMatchUpScheduleItems$2({
12046
12047
 
12047
12048
  if (scheduledDate !== undefined) {
12048
12049
  const result = addMatchUpScheduledDate$2({
12050
+ disableNotice: true,
12049
12051
  drawDefinition,
12050
- matchUpId,
12051
12052
  scheduledDate,
12052
- disableNotice: true
12053
+ matchUpId
12053
12054
  });
12054
12055
  if (result !== null && result !== void 0 && result.error) return {
12055
12056
  error: result.error,
@@ -12059,10 +12060,10 @@ function addMatchUpScheduleItems$2({
12059
12060
 
12060
12061
  if (scheduledTime !== undefined) {
12061
12062
  const result = addMatchUpScheduledTime$2({
12063
+ disableNotice: true,
12062
12064
  drawDefinition,
12063
- matchUpId,
12064
12065
  scheduledTime,
12065
- disableNotice: true
12066
+ matchUpId
12066
12067
  });
12067
12068
  if (result !== null && result !== void 0 && result.error) return {
12068
12069
  error: result.error,
@@ -12177,9 +12178,9 @@ function addMatchUpScheduleItems$2({
12177
12178
  }
12178
12179
  function addMatchUpScheduledDate$2({
12179
12180
  drawDefinition,
12180
- matchUpId,
12181
12181
  disableNotice,
12182
- scheduledDate
12182
+ scheduledDate,
12183
+ matchUpId
12183
12184
  }) {
12184
12185
  if (!matchUpId) return {
12185
12186
  error: MISSING_MATCHUP_ID
@@ -12196,18 +12197,18 @@ function addMatchUpScheduledDate$2({
12196
12197
  itemValue: scheduledDate
12197
12198
  };
12198
12199
  return addMatchUpTimeItem({
12200
+ duplicateValues: false,
12199
12201
  drawDefinition,
12200
- matchUpId,
12201
- timeItem,
12202
12202
  disableNotice,
12203
- duplicateValues: false
12203
+ matchUpId,
12204
+ timeItem
12204
12205
  });
12205
12206
  }
12206
12207
  function addMatchUpScheduledTime$2({
12207
12208
  drawDefinition,
12208
- matchUpId,
12209
12209
  disableNotice,
12210
- scheduledTime
12210
+ scheduledTime,
12211
+ matchUpId
12211
12212
  }) {
12212
12213
  if (!matchUpId) return {
12213
12214
  error: MISSING_MATCHUP_ID
@@ -12223,19 +12224,19 @@ function addMatchUpScheduledTime$2({
12223
12224
  itemValue
12224
12225
  };
12225
12226
  return addMatchUpTimeItem({
12227
+ duplicateValues: false,
12226
12228
  drawDefinition,
12227
- matchUpId,
12228
- timeItem,
12229
12229
  disableNotice,
12230
- duplicateValues: false
12230
+ matchUpId,
12231
+ timeItem
12231
12232
  });
12232
12233
  }
12233
12234
  function addMatchUpOfficial$2({
12234
12235
  drawDefinition,
12235
- matchUpId,
12236
12236
  disableNotice,
12237
12237
  participantId,
12238
- officialType
12238
+ officialType,
12239
+ matchUpId
12239
12240
  }) {
12240
12241
  if (!matchUpId) return {
12241
12242
  error: MISSING_MATCHUP_ID
@@ -12247,11 +12248,11 @@ function addMatchUpOfficial$2({
12247
12248
  itemValue: participantId
12248
12249
  };
12249
12250
  return addMatchUpTimeItem({
12251
+ duplicateValues: false,
12250
12252
  drawDefinition,
12251
- matchUpId,
12252
- timeItem,
12253
12253
  disableNotice,
12254
- duplicateValues: false
12254
+ matchUpId,
12255
+ timeItem
12255
12256
  });
12256
12257
  }
12257
12258
  function addMatchUpStartTime$2({
@@ -12288,11 +12289,11 @@ function addMatchUpStartTime$2({
12288
12289
  itemValue: startTime
12289
12290
  };
12290
12291
  return addMatchUpTimeItem({
12292
+ duplicateValues: false,
12291
12293
  drawDefinition,
12292
- matchUpId,
12293
- timeItem,
12294
12294
  disableNotice,
12295
- duplicateValues: false
12295
+ matchUpId,
12296
+ timeItem
12296
12297
  });
12297
12298
  } else {
12298
12299
  return {
@@ -12334,11 +12335,11 @@ function addMatchUpEndTime$2({
12334
12335
  itemValue: endTime
12335
12336
  };
12336
12337
  return addMatchUpTimeItem({
12338
+ duplicateValues: false,
12337
12339
  drawDefinition,
12338
- matchUpId,
12339
- timeItem,
12340
12340
  disableNotice,
12341
- duplicateValues: false
12341
+ matchUpId,
12342
+ timeItem
12342
12343
  });
12343
12344
  } else {
12344
12345
  return {
@@ -12391,11 +12392,11 @@ function addMatchUpStopTime$2({
12391
12392
  itemValue: stopTime
12392
12393
  };
12393
12394
  return addMatchUpTimeItem({
12395
+ duplicateValues: true,
12394
12396
  drawDefinition,
12395
- matchUpId,
12396
- timeItem,
12397
12397
  disableNotice,
12398
- duplicateValues: true
12398
+ matchUpId,
12399
+ timeItem
12399
12400
  });
12400
12401
  } else {
12401
12402
  return {
@@ -12448,11 +12449,11 @@ function addMatchUpResumeTime$2({
12448
12449
  itemValue: resumeTime
12449
12450
  };
12450
12451
  return addMatchUpTimeItem({
12452
+ duplicateValues: true,
12451
12453
  drawDefinition,
12452
- matchUpId,
12453
- timeItem,
12454
12454
  disableNotice,
12455
- duplicateValues: true
12455
+ matchUpId,
12456
+ timeItem
12456
12457
  });
12457
12458
  } else {
12458
12459
  return {
@@ -15714,12 +15715,12 @@ function drawPositionRemovals({
15714
15715
  }
15715
15716
 
15716
15717
  function removeSubsequentRoundsParticipant({
15717
- drawDefinition,
15718
- structureId,
15719
- roundNumber,
15718
+ inContextDrawMatchUps,
15720
15719
  targetDrawPosition,
15720
+ drawDefinition,
15721
15721
  matchUpsMap,
15722
- inContextDrawMatchUps
15722
+ roundNumber,
15723
+ structureId
15723
15724
  }) {
15724
15725
  var _matchUpsMap;
15725
15726
 
@@ -15749,24 +15750,24 @@ function removeSubsequentRoundsParticipant({
15749
15750
  structureId
15750
15751
  });
15751
15752
  relevantMatchUps === null || relevantMatchUps === void 0 ? void 0 : relevantMatchUps.forEach(matchUp => removeDrawPosition({
15752
- targetMatchUp: matchUp,
15753
15753
  drawPosition: targetDrawPosition,
15754
+ targetMatchUp: matchUp,
15755
+ inContextDrawMatchUps,
15754
15756
  positionAssignments,
15755
15757
  drawDefinition,
15756
- structure,
15757
15758
  matchUpsMap,
15758
- inContextDrawMatchUps
15759
+ structure
15759
15760
  }));
15760
15761
  }
15761
15762
 
15762
15763
  function removeDrawPosition({
15764
+ inContextDrawMatchUps,
15763
15765
  positionAssignments,
15766
+ drawDefinition,
15764
15767
  targetMatchUp,
15765
15768
  drawPosition,
15766
- drawDefinition,
15767
- structure,
15768
- inContextDrawMatchUps,
15769
- matchUpsMap
15769
+ matchUpsMap,
15770
+ structure
15770
15771
  }) {
15771
15772
  matchUpsMap = matchUpsMap || getMatchUpsMap({
15772
15773
  drawDefinition
@@ -16696,9 +16697,6 @@ function removeDirectedLoser({
16696
16697
 
16697
16698
  if (targetSide) {
16698
16699
  delete targetSide.lineUp;
16699
- console.log('remove loser lineUp', {
16700
- targetSide
16701
- });
16702
16700
  modifyMatchUpNotice({
16703
16701
  drawDefinition,
16704
16702
  matchUp: targetMatchUp
@@ -40985,17 +40983,21 @@ function modifyParticipant({
40985
40983
  });
40986
40984
  const {
40987
40985
  individualParticipantIds,
40986
+ participantOtherName,
40988
40987
  participantName,
40989
40988
  participantRole,
40990
40989
  participantType,
40991
40990
  onlineProfiles,
40992
40991
  // TODO: validate onlineProfiles
40992
+ contacts,
40993
40993
  person
40994
40994
  } = participant;
40995
40995
  const newValues = {}; // validate participant attributes
40996
40996
 
40997
+ if (contacts) newValues.contacts = contacts;
40997
40998
  if (onlineProfiles) newValues.onlineProfiles = onlineProfiles;
40998
40999
  if (participantName && typeof participantName === 'string') newValues.participantName = participantName;
41000
+ if (participantOtherName && typeof participantOtherName === 'string') newValues.participantOtherName = participantOtherName;
40999
41001
 
41000
41002
  if (Array.isArray(individualParticipantIds)) {
41001
41003
  const {
@@ -41038,7 +41040,7 @@ function modifyParticipant({
41038
41040
  });
41039
41041
  }
41040
41042
 
41041
- Object.assign(existingParticipant, newValues);
41043
+ Object.assign(existingParticipant, definedAttributes(newValues));
41042
41044
 
41043
41045
  if (groupingParticipantId) {
41044
41046
  addIndividualParticipantIds({