tods-competition-factory 1.7.16 → 1.7.18

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.
@@ -7765,6 +7765,9 @@ function initializeParticipantId({ participantMap, participantId }) {
7765
7765
  groupParticipantIds: [],
7766
7766
  pairParticipantIds: [],
7767
7767
  teamParticipantIds: [],
7768
+ seedings: {},
7769
+ rankings: {},
7770
+ ratings: {},
7768
7771
  groups: [],
7769
7772
  teams: []
7770
7773
  },
@@ -17632,17 +17635,19 @@ function generateAndPopulatePlayoffStructures(params) {
17632
17635
  loserMatchUp
17633
17636
  }
17634
17637
  } = targetData;
17635
- const targetStructureId = loserTargetLink.target.structureId;
17636
- const targetDrawPosition = loserMatchUp.drawPositions[loserMatchUpDrawPositionIndex];
17637
- const result = assignDrawPositionBye({
17638
- drawPosition: targetDrawPosition,
17639
- structureId: targetStructureId,
17640
- tournamentRecord,
17641
- drawDefinition,
17642
- event
17643
- });
17644
- if (result.error)
17645
- console.log(result.error);
17638
+ if (loserTargetLink && loserMatchUp) {
17639
+ const targetStructureId = loserTargetLink.target.structureId;
17640
+ const targetDrawPosition = loserMatchUp.drawPositions[loserMatchUpDrawPositionIndex];
17641
+ const result = assignDrawPositionBye({
17642
+ drawPosition: targetDrawPosition,
17643
+ structureId: targetStructureId,
17644
+ tournamentRecord,
17645
+ drawDefinition,
17646
+ event
17647
+ });
17648
+ if (result.error)
17649
+ console.log(result.error);
17650
+ }
17646
17651
  });
17647
17652
  const matchUpModifications = [];
17648
17653
  const goesToMap = addGoesTo({
@@ -21287,7 +21292,7 @@ function newDrawDefinition({
21287
21292
  return Object.assign(drawDefinition, { drawId, drawType, matchUpType });
21288
21293
  }
21289
21294
 
21290
- var collectionDefinitions$f = [
21295
+ var collectionDefinitions$g = [
21291
21296
  {
21292
21297
  collectionName: "Male Singles",
21293
21298
  matchUpFormat: "SET3-S:6/TB7",
@@ -21329,17 +21334,17 @@ var collectionDefinitions$f = [
21329
21334
  gender: "MIXED"
21330
21335
  }
21331
21336
  ];
21332
- var tieFormatName$f = "USTA_GOLD_TEAM_CHALLENGE";
21333
- var winCriteria$f = {
21337
+ var tieFormatName$g = "USTA_GOLD_TEAM_CHALLENGE";
21338
+ var winCriteria$g = {
21334
21339
  valueGoal: 9
21335
21340
  };
21336
21341
  var USTA_GOLD_TEAM_CHALLENGE_FORMAT = {
21337
- collectionDefinitions: collectionDefinitions$f,
21338
- tieFormatName: tieFormatName$f,
21339
- winCriteria: winCriteria$f
21342
+ collectionDefinitions: collectionDefinitions$g,
21343
+ tieFormatName: tieFormatName$g,
21344
+ winCriteria: winCriteria$g
21340
21345
  };
21341
21346
 
21342
- var collectionDefinitions$e = [
21347
+ var collectionDefinitions$f = [
21343
21348
  {
21344
21349
  collectionName: "Round 1",
21345
21350
  matchUpCount: 3,
@@ -21362,19 +21367,19 @@ var collectionDefinitions$e = [
21362
21367
  scoreValue: 1
21363
21368
  }
21364
21369
  ];
21365
- var tieFormatName$e = "Doubles Shuffle";
21370
+ var tieFormatName$f = "Doubles Shuffle";
21366
21371
  var unrestrictedSelections = true;
21367
- var winCriteria$e = {
21372
+ var winCriteria$f = {
21368
21373
  aggregateValue: true
21369
21374
  };
21370
21375
  var TEAM_AGGREGATION_TIE_FORMAT = {
21371
- collectionDefinitions: collectionDefinitions$e,
21372
- tieFormatName: tieFormatName$e,
21376
+ collectionDefinitions: collectionDefinitions$f,
21377
+ tieFormatName: tieFormatName$f,
21373
21378
  unrestrictedSelections: unrestrictedSelections,
21374
- winCriteria: winCriteria$e
21379
+ winCriteria: winCriteria$f
21375
21380
  };
21376
21381
 
21377
- var collectionDefinitions$d = [
21382
+ var collectionDefinitions$e = [
21378
21383
  {
21379
21384
  collectionName: "Male Singles",
21380
21385
  gender: "MALE",
@@ -21400,17 +21405,17 @@ var collectionDefinitions$d = [
21400
21405
  matchUpValue: 1
21401
21406
  }
21402
21407
  ];
21403
- var tieFormatName$d = "USTA_SOUTHERN_LEVEL_5";
21404
- var winCriteria$d = {
21408
+ var tieFormatName$e = "USTA_SOUTHERN_LEVEL_5";
21409
+ var winCriteria$e = {
21405
21410
  valueGoal: 8
21406
21411
  };
21407
21412
  var USTA_SOUTHERN_LEVEL_5_TIE_FORMAT = {
21408
- collectionDefinitions: collectionDefinitions$d,
21409
- tieFormatName: tieFormatName$d,
21410
- winCriteria: winCriteria$d
21413
+ collectionDefinitions: collectionDefinitions$e,
21414
+ tieFormatName: tieFormatName$e,
21415
+ winCriteria: winCriteria$e
21411
21416
  };
21412
21417
 
21413
- var collectionDefinitions$c = [
21418
+ var collectionDefinitions$d = [
21414
21419
  {
21415
21420
  category: {
21416
21421
  ageCategoryCode: "16U"
@@ -21462,17 +21467,17 @@ var collectionDefinitions$c = [
21462
21467
  ]
21463
21468
  }
21464
21469
  ];
21465
- var tieFormatName$c = "USTA_SECTION_BATTLE";
21466
- var winCriteria$c = {
21470
+ var tieFormatName$d = "USTA_SECTION_BATTLE";
21471
+ var winCriteria$d = {
21467
21472
  valueGoal: 9
21468
21473
  };
21469
21474
  var USTA_SECTION_BATTLE_TIE_FORMAT = {
21470
- collectionDefinitions: collectionDefinitions$c,
21471
- tieFormatName: tieFormatName$c,
21472
- winCriteria: winCriteria$c
21475
+ collectionDefinitions: collectionDefinitions$d,
21476
+ tieFormatName: tieFormatName$d,
21477
+ winCriteria: winCriteria$d
21473
21478
  };
21474
21479
 
21475
- var collectionDefinitions$b = [
21480
+ var collectionDefinitions$c = [
21476
21481
  {
21477
21482
  collectionName: "Male Singles",
21478
21483
  gender: "MALE",
@@ -21514,11 +21519,47 @@ var collectionDefinitions$b = [
21514
21519
  matchUpValue: 1
21515
21520
  }
21516
21521
  ];
21517
- var tieFormatName$b = "USTA_INTERSECTIONAL";
21518
- var winCriteria$b = {
21522
+ var tieFormatName$c = "USTA_INTERSECTIONAL";
21523
+ var winCriteria$c = {
21519
21524
  valueGoal: 8
21520
21525
  };
21521
21526
  var USTA_INTERSECTIONAL_TIE_FORMAT = {
21527
+ collectionDefinitions: collectionDefinitions$c,
21528
+ tieFormatName: tieFormatName$c,
21529
+ winCriteria: winCriteria$c
21530
+ };
21531
+
21532
+ var collectionDefinitions$b = [
21533
+ {
21534
+ scoreValue: 1,
21535
+ matchUpType: "SINGLES",
21536
+ collectionName: "Men's Singles",
21537
+ matchUpFormat: "SET1-S:T60",
21538
+ gender: "MALE",
21539
+ matchUpCount: 1
21540
+ },
21541
+ {
21542
+ scoreValue: 1,
21543
+ matchUpType: "SINGLES",
21544
+ collectionName: "Women's Singles",
21545
+ matchUpFormat: "SET1-S:T60",
21546
+ gender: "FEMALE",
21547
+ matchUpCount: 1
21548
+ },
21549
+ {
21550
+ matchUpValue: 1,
21551
+ matchUpType: "DOUBLES",
21552
+ collectionName: "Mixed Doubles",
21553
+ matchUpFormat: "SET1-S:T60",
21554
+ gender: "MIXED",
21555
+ matchUpCount: 1
21556
+ }
21557
+ ];
21558
+ var tieFormatName$b = "Time Tennis Pro Circuit";
21559
+ var winCriteria$b = {
21560
+ aggregateValue: true
21561
+ };
21562
+ var TIME_TENNIS_PRO_TIE_FORMAT = {
21522
21563
  collectionDefinitions: collectionDefinitions$b,
21523
21564
  tieFormatName: tieFormatName$b,
21524
21565
  winCriteria: winCriteria$b
@@ -21561,6 +21602,58 @@ var DOMINANT_DUO_MIXED_TIE_FORMAT = {
21561
21602
  };
21562
21603
 
21563
21604
  var collectionDefinitions$9 = [
21605
+ {
21606
+ scoreValue: 1,
21607
+ matchUpType: "SINGLES",
21608
+ collectionName: "Men's Singles",
21609
+ matchUpFormat: "SET1-S:T60",
21610
+ gender: "MALE",
21611
+ matchUpCount: 3
21612
+ },
21613
+ {
21614
+ scoreValue: 1,
21615
+ matchUpType: "SINGLES",
21616
+ collectionName: "Women's Singles",
21617
+ matchUpFormat: "SET1-S:T60",
21618
+ gender: "FEMALE",
21619
+ matchUpCount: 3
21620
+ },
21621
+ {
21622
+ scoreValue: 1,
21623
+ matchUpType: "DOUBLES",
21624
+ collectionName: "Men's Doubles",
21625
+ matchUpFormat: "SET1-S:T60",
21626
+ gender: "MALE",
21627
+ matchUpCount: 1
21628
+ },
21629
+ {
21630
+ matchUpValue: 1,
21631
+ matchUpType: "DOUBLES",
21632
+ collectionName: "Women's Doubles",
21633
+ matchUpFormat: "SET1-S:T60",
21634
+ gender: "FEMALE",
21635
+ matchUpCount: 1
21636
+ },
21637
+ {
21638
+ matchUpValue: 1,
21639
+ matchUpType: "DOUBLES",
21640
+ collectionName: "Mixed Doubles",
21641
+ matchUpFormat: "SET1-S:T60",
21642
+ gender: "MIXED",
21643
+ matchUpCount: 1
21644
+ }
21645
+ ];
21646
+ var tieFormatName$9 = "Time Tennis Dual";
21647
+ var winCriteria$9 = {
21648
+ aggregateValue: true
21649
+ };
21650
+ var TIME_TENNIS_DUAL_TIE_FORMAT = {
21651
+ collectionDefinitions: collectionDefinitions$9,
21652
+ tieFormatName: tieFormatName$9,
21653
+ winCriteria: winCriteria$9
21654
+ };
21655
+
21656
+ var collectionDefinitions$8 = [
21564
21657
  {
21565
21658
  category: {
21566
21659
  ageCategoryCode: "14U"
@@ -21635,22 +21728,22 @@ var collectionGroups$1 = [
21635
21728
  }
21636
21729
  }
21637
21730
  ];
21638
- var tieFormatName$9 = "USTA_BREWER_CUP";
21639
- var winCriteria$9 = {
21731
+ var tieFormatName$8 = "USTA_BREWER_CUP";
21732
+ var winCriteria$8 = {
21640
21733
  valueGoal: 4
21641
21734
  };
21642
21735
  var USTA_BREWER_CUP_TIE_FORMAT = {
21643
- collectionDefinitions: collectionDefinitions$9,
21736
+ collectionDefinitions: collectionDefinitions$8,
21644
21737
  collectionGroups: collectionGroups$1,
21645
- tieFormatName: tieFormatName$9,
21646
- winCriteria: winCriteria$9
21738
+ tieFormatName: tieFormatName$8,
21739
+ winCriteria: winCriteria$8
21647
21740
  };
21648
21741
 
21649
- var winCriteria$8 = {
21742
+ var winCriteria$7 = {
21650
21743
  valueGoal: 23
21651
21744
  };
21652
- var tieFormatName$8 = "USTA_OZAKI_CUP";
21653
- var collectionDefinitions$8 = [
21745
+ var tieFormatName$7 = "USTA_OZAKI_CUP";
21746
+ var collectionDefinitions$7 = [
21654
21747
  {
21655
21748
  category: {
21656
21749
  ageCategoryCode: "18U"
@@ -21873,12 +21966,12 @@ var collectionDefinitions$8 = [
21873
21966
  }
21874
21967
  ];
21875
21968
  var USTA_OZAKI_CUP_TIE_FORMAT = {
21876
- winCriteria: winCriteria$8,
21877
- tieFormatName: tieFormatName$8,
21878
- collectionDefinitions: collectionDefinitions$8
21969
+ winCriteria: winCriteria$7,
21970
+ tieFormatName: tieFormatName$7,
21971
+ collectionDefinitions: collectionDefinitions$7
21879
21972
  };
21880
21973
 
21881
- var collectionDefinitions$7 = [
21974
+ var collectionDefinitions$6 = [
21882
21975
  {
21883
21976
  collectionName: "Doubles",
21884
21977
  matchUpCount: 1,
@@ -21894,17 +21987,17 @@ var collectionDefinitions$7 = [
21894
21987
  matchUpValue: 1
21895
21988
  }
21896
21989
  ];
21897
- var tieFormatName$7 = "DOMINANT_DUO";
21898
- var winCriteria$7 = {
21990
+ var tieFormatName$6 = "DOMINANT_DUO";
21991
+ var winCriteria$6 = {
21899
21992
  valueGoal: 2
21900
21993
  };
21901
21994
  var DOMINANT_DUO_TIE_FORMAT = {
21902
- collectionDefinitions: collectionDefinitions$7,
21903
- tieFormatName: tieFormatName$7,
21904
- winCriteria: winCriteria$7
21995
+ collectionDefinitions: collectionDefinitions$6,
21996
+ tieFormatName: tieFormatName$6,
21997
+ winCriteria: winCriteria$6
21905
21998
  };
21906
21999
 
21907
- var collectionDefinitions$6 = [
22000
+ var collectionDefinitions$5 = [
21908
22001
  {
21909
22002
  collectionName: "Doubles",
21910
22003
  matchUpCount: 3,
@@ -21920,17 +22013,17 @@ var collectionDefinitions$6 = [
21920
22013
  matchUpValue: 1
21921
22014
  }
21922
22015
  ];
21923
- var tieFormatName$6 = "USTA_COLLEGE";
21924
- var winCriteria$6 = {
22016
+ var tieFormatName$5 = "USTA_COLLEGE";
22017
+ var winCriteria$5 = {
21925
22018
  valueGoal: 4
21926
22019
  };
21927
22020
  var USTA_COLLEGE_TIE_FORMAT = {
21928
- collectionDefinitions: collectionDefinitions$6,
21929
- tieFormatName: tieFormatName$6,
21930
- winCriteria: winCriteria$6
22021
+ collectionDefinitions: collectionDefinitions$5,
22022
+ tieFormatName: tieFormatName$5,
22023
+ winCriteria: winCriteria$5
21931
22024
  };
21932
22025
 
21933
- var collectionDefinitions$5 = [
22026
+ var collectionDefinitions$4 = [
21934
22027
  {
21935
22028
  collectionName: "Male Singles",
21936
22029
  matchUpCount: 6,
@@ -21960,17 +22053,17 @@ var collectionDefinitions$5 = [
21960
22053
  matchUpValue: 1
21961
22054
  }
21962
22055
  ];
21963
- var tieFormatName$5 = "USTA_LEVEL_1";
21964
- var winCriteria$5 = {
22056
+ var tieFormatName$4 = "USTA_LEVEL_1";
22057
+ var winCriteria$4 = {
21965
22058
  valueGoal: 10
21966
22059
  };
21967
22060
  var USTA_LEVEL_1_TIE_FORMAT = {
21968
- collectionDefinitions: collectionDefinitions$5,
21969
- tieFormatName: tieFormatName$5,
21970
- winCriteria: winCriteria$5
22061
+ collectionDefinitions: collectionDefinitions$4,
22062
+ tieFormatName: tieFormatName$4,
22063
+ winCriteria: winCriteria$4
21971
22064
  };
21972
22065
 
21973
- var collectionDefinitions$4 = [
22066
+ var collectionDefinitions$3 = [
21974
22067
  {
21975
22068
  collectionName: "Female Doubles",
21976
22069
  gender: "FEMALE",
@@ -22028,63 +22121,11 @@ var collectionDefinitions$4 = [
22028
22121
  scoreValue: 1
22029
22122
  }
22030
22123
  ];
22031
- var tieFormatName$4 = "USTA_WTT_ITT";
22032
- var winCriteria$4 = {
22033
- aggregateValue: true
22034
- };
22035
- var USTA_WTT_ITT_TIE_FORMAT = {
22036
- collectionDefinitions: collectionDefinitions$4,
22037
- tieFormatName: tieFormatName$4,
22038
- winCriteria: winCriteria$4
22039
- };
22040
-
22041
- var collectionDefinitions$3 = [
22042
- {
22043
- scoreValue: 1,
22044
- matchUpType: "SINGLES",
22045
- collectionName: "Men's Singles",
22046
- matchUpFormat: "SET1-S:T60",
22047
- gender: "MALE",
22048
- matchUpCount: 3
22049
- },
22050
- {
22051
- scoreValue: 1,
22052
- matchUpType: "SINGLES",
22053
- collectionName: "Women's Singles",
22054
- matchUpFormat: "SET1-S:T60",
22055
- gender: "FEMALE",
22056
- matchUpCount: 3
22057
- },
22058
- {
22059
- scoreValue: 1,
22060
- matchUpType: "DOUBLES",
22061
- collectionName: "Men's Doubles",
22062
- matchUpFormat: "SET1-S:T60",
22063
- gender: "MALE",
22064
- matchUpCount: 1
22065
- },
22066
- {
22067
- matchUpValue: 1,
22068
- matchUpType: "DOUBLES",
22069
- collectionName: "Women's Doubles",
22070
- matchUpFormat: "SET1-S:T60",
22071
- gender: "FEMALE",
22072
- matchUpCount: 1
22073
- },
22074
- {
22075
- matchUpValue: 1,
22076
- matchUpType: "DOUBLES",
22077
- collectionName: "Mixed Doubles",
22078
- matchUpFormat: "SET1-S:T60",
22079
- gender: "MIXED",
22080
- matchUpCount: 1
22081
- }
22082
- ];
22083
- var tieFormatName$3 = "Time Tennis";
22124
+ var tieFormatName$3 = "USTA_WTT_ITT";
22084
22125
  var winCriteria$3 = {
22085
22126
  aggregateValue: true
22086
22127
  };
22087
- var TIME_TENNIS_TIE_FORMAT = {
22128
+ var USTA_WTT_ITT_TIE_FORMAT = {
22088
22129
  collectionDefinitions: collectionDefinitions$3,
22089
22130
  tieFormatName: tieFormatName$3,
22090
22131
  winCriteria: winCriteria$3
@@ -22278,7 +22319,8 @@ const DOMINANT_DUO = "DOMINANT_DUO";
22278
22319
  const DOMINANT_DUO_MIXED = "DOMINANT_DUO_MIXED";
22279
22320
  const LAVER_CUP = "LAVER_CUP";
22280
22321
  const TEAM_DOUBLES_3_AGGREGATION = "TEAM_DOUBLES_3_AGGREGATION";
22281
- const TIME_TENNIS = "TIME_TENNIS";
22322
+ const TIME_TENNIS_DUAL = "TIME_TENNIS_DUAL";
22323
+ const TIME_TENNIS_PRO_CIRCUIT = "TIME_TENNIS_PRO_CIRCUIT";
22282
22324
  const USTA_BREWER_CUP = "USTA_BREWER_CUP";
22283
22325
  const USTA_OZAKI_CUP = "USTA_OZAKI_CUP";
22284
22326
  const USTA_COLLEGE = "USTA_COLLEGE";
@@ -22348,7 +22390,8 @@ const namedFormats = {
22348
22390
  [DOMINANT_DUO]: DOMINANT_DUO_TIE_FORMAT,
22349
22391
  [DOMINANT_DUO_MIXED]: DOMINANT_DUO_MIXED_TIE_FORMAT,
22350
22392
  [TEAM_DOUBLES_3_AGGREGATION]: TEAM_AGGREGATION_TIE_FORMAT,
22351
- [TIME_TENNIS]: TIME_TENNIS_TIE_FORMAT,
22393
+ [TIME_TENNIS_DUAL]: TIME_TENNIS_DUAL_TIE_FORMAT,
22394
+ [TIME_TENNIS_PRO_CIRCUIT]: TIME_TENNIS_PRO_TIE_FORMAT,
22352
22395
  [USTA_BREWER_CUP]: USTA_BREWER_CUP_TIE_FORMAT,
22353
22396
  [USTA_OZAKI_CUP]: USTA_OZAKI_CUP_TIE_FORMAT,
22354
22397
  [USTA_COLLEGE]: USTA_COLLEGE_TIE_FORMAT,
@@ -22365,7 +22408,7 @@ const tieFormatDefaults = (params) => {
22365
22408
  const namedFormat = params?.namedFormat && Object.keys(namedFormats).includes(params.namedFormat) ? params.namedFormat : STANDARD;
22366
22409
  const uuids = Array.isArray(params?.uuids) ? params?.uuids : [];
22367
22410
  let tieFormat;
22368
- const { category, gender } = params?.event || {};
22411
+ const { category, gender } = params?.event ?? {};
22369
22412
  const template = makeDeepCopy(namedFormats[namedFormat], false, true);
22370
22413
  if (!template.hydrate) {
22371
22414
  template.collectionDefinitions.forEach(
@@ -22379,14 +22422,14 @@ const tieFormatDefaults = (params) => {
22379
22422
  },
22380
22423
  collectionDefinitions: [
22381
22424
  {
22382
- collectionId: uuids?.pop() || UUID(),
22425
+ collectionId: uuids?.pop() ?? UUID(),
22383
22426
  matchUpFormat: FORMAT_ATP_DOUBLES,
22384
22427
  matchUpType: TypeEnum.Doubles,
22385
22428
  collectionName: "Doubles",
22386
22429
  ...template.doubles
22387
22430
  },
22388
22431
  {
22389
- collectionId: uuids?.pop() || UUID(),
22432
+ collectionId: uuids?.pop() ?? UUID(),
22390
22433
  matchUpType: TypeEnum.Singles,
22391
22434
  matchUpFormat: FORMAT_STANDARD,
22392
22435
  collectionName: "Singles",