tods-competition-factory 1.8.28 → 1.8.30

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.
@@ -2929,7 +2929,7 @@ var matchUpFormatCode = {
2929
2929
  };
2930
2930
 
2931
2931
  function factoryVersion() {
2932
- return '1.8.28';
2932
+ return '1.8.30';
2933
2933
  }
2934
2934
 
2935
2935
  function getObjectTieFormat(obj) {
@@ -3588,8 +3588,7 @@ function genderValidityCheck(_a) {
3588
3588
  var stack = 'genderValidityCheck';
3589
3589
  if (referenceGender &&
3590
3590
  gender &&
3591
- [GenderEnum.Male, GenderEnum.Female].includes(referenceGender) &&
3592
- [GenderEnum.Male, GenderEnum.Female].includes(gender)) {
3591
+ [GenderEnum.Male, GenderEnum.Female].includes(referenceGender)) {
3593
3592
  var valid = gender === referenceGender;
3594
3593
  return valid
3595
3594
  ? { valid: true }
@@ -4187,8 +4186,8 @@ var validMatchUpStatuses = [
4187
4186
  ];
4188
4187
  var directingMatchUpStatuses = [
4189
4188
  BYE,
4190
- DOUBLE_WALKOVER,
4191
- DOUBLE_DEFAULT,
4189
+ DOUBLE_WALKOVER, // directing because of a produced WALKOVER
4190
+ DOUBLE_DEFAULT, // directing because of a produced WALKOVER
4192
4191
  COMPLETED$1,
4193
4192
  DEFAULTED,
4194
4193
  RETIRED$1,
@@ -5506,31 +5505,31 @@ var TIE_FORMAT_MODIFICATIONS = 'tieFormatModification';
5506
5505
  var extensionConstants = {
5507
5506
  APPLIED_POLICIES: APPLIED_POLICIES,
5508
5507
  AUDIT_POSITION_ACTIONS: AUDIT_POSITION_ACTIONS,
5509
- CONTEXT: CONTEXT,
5508
+ CONTEXT: CONTEXT, // used to capture, e.g. context in which a venue was added
5510
5509
  DELEGATED_OUTCOME: DELEGATED_OUTCOME,
5511
5510
  DISABLED: DISABLED,
5512
5511
  DISABLE_LINKS: DISABLE_LINKS,
5513
5512
  DISABLE_AUTO_CALC: DISABLE_AUTO_CALC,
5514
5513
  DRAW_DELETIONS: DRAW_DELETIONS,
5515
5514
  DRAW_PROFILE: DRAW_PROFILE,
5516
- ENTRY_PROFILE: ENTRY_PROFILE,
5515
+ ENTRY_PROFILE: ENTRY_PROFILE, // used for drawGeneration; not relevant for anonymized tournaments
5517
5516
  EVENT_PROFILE: EVENT_PROFILE,
5518
5517
  FLIGHT_PROFILE: FLIGHT_PROFILE,
5519
- GROUPING_ATTRIBUTE: GROUPING_ATTRIBUTE,
5518
+ GROUPING_ATTRIBUTE: GROUPING_ATTRIBUTE, // for generating teams; not relevant for anonymized tournaments
5520
5519
  LINEUPS: LINEUPS,
5521
5520
  LINKED_TOURNAMENTS: LINKED_TOURNAMENTS,
5522
5521
  MATCHUP_HISTORY: MATCHUP_HISTORY,
5523
5522
  PARTICIPANT_REPRESENTATIVES: PARTICIPANT_REPRESENTATIVES,
5524
5523
  PERSON_REQUESTS: PERSON_REQUESTS,
5525
- RANKING_POINTS: RANKING_POINTS,
5524
+ RANKING_POINTS: RANKING_POINTS, // for attaching points awarded to tournamentRecord
5526
5525
  ROUND_TARGET: ROUND_TARGET,
5527
5526
  SCHEDULE_LIMITS: SCHEDULE_LIMITS,
5528
5527
  SCHEDULE_TIMING: SCHEDULE_TIMING,
5529
5528
  SCHEDULING_PROFILE: SCHEDULING_PROFILE,
5530
- STATUS_DETAIL: STATUS_DETAIL,
5529
+ STATUS_DETAIL: STATUS_DETAIL, // attached to event.entries
5531
5530
  SUB_ORDER: SUB_ORDER,
5532
5531
  TALLY: TALLY,
5533
- TIE_FORMAT_MODIFICATIONS: TIE_FORMAT_MODIFICATIONS,
5532
+ TIE_FORMAT_MODIFICATIONS: TIE_FORMAT_MODIFICATIONS, // for auditing, not important when anonymized
5534
5533
  FACTORY: FACTORY$1,
5535
5534
  };
5536
5535
  var internalExtensions = [
@@ -6638,8 +6637,8 @@ var topicConstants = {
6638
6637
  DELETED_DRAW_IDS: DELETED_DRAW_IDS,
6639
6638
  DELETED_MATCHUP_IDS: DELETED_MATCHUP_IDS,
6640
6639
  MODIFY_DRAW_DEFINITION: MODIFY_DRAW_DEFINITION,
6641
- MODIFY_DRAW_ENTRIES: MODIFY_DRAW_ENTRIES,
6642
- MODIFY_EVENT_ENTRIES: MODIFY_EVENT_ENTRIES,
6640
+ MODIFY_DRAW_ENTRIES: MODIFY_DRAW_ENTRIES, // TODO
6641
+ MODIFY_EVENT_ENTRIES: MODIFY_EVENT_ENTRIES, // TODO
6643
6642
  MODIFY_MATCHUP: MODIFY_MATCHUP,
6644
6643
  MODIFY_PARTICIPANTS: MODIFY_PARTICIPANTS,
6645
6644
  MODIFY_POSITION_ASSIGNMENTS: MODIFY_POSITION_ASSIGNMENTS,
@@ -8526,7 +8525,7 @@ function getStructureSeedAssignments(_a) {
8526
8525
  return {
8527
8526
  participantId: entry.participantId,
8528
8527
  seedValue: seedNumber,
8529
- seedProxy: true,
8528
+ seedProxy: true, // flag so that proxy seeding information doesn't get used externally
8530
8529
  seedNumber: seedNumber,
8531
8530
  };
8532
8531
  })
@@ -11197,7 +11196,7 @@ function targetByRoundOutcome(_a) {
11197
11196
  function targetByWinRatio(_a) {
11198
11197
  var matchUp = _a.matchUp;
11199
11198
  return {
11200
- targetLinks: { loserTargetLink: undefined, winnerTargetLink: undefined },
11199
+ targetLinks: { loserTargetLink: undefined, winnerTargetLink: undefined }, // returned for testing
11201
11200
  targetMatchUps: { loserMatchUp: undefined, winnerMatchUp: undefined },
11202
11201
  matchUp: matchUp,
11203
11202
  };
@@ -11749,7 +11748,7 @@ function modifyMatchUpScore(_a) {
11749
11748
  // participantsProfile: { withGroupings: true },
11750
11749
  matchUpFilters: { matchUpIds: [matchUpId] },
11751
11750
  nextMatchUps: true,
11752
- tournamentRecord: tournamentRecord,
11751
+ tournamentRecord: tournamentRecord, // required to hydrate participants
11753
11752
  inContext: true,
11754
11753
  drawDefinition: drawDefinition,
11755
11754
  matchUpsMap: matchUpsMap,
@@ -16693,14 +16692,14 @@ var POLICY_POSITION_ACTIONS_DEFAULT = (_a$e = {},
16693
16692
  // enabledStructures: [] => all structures are enabled
16694
16693
  enabledStructures: [
16695
16694
  {
16696
- stages: [QUALIFYING, MAIN],
16697
- stageSequences: [1],
16698
- enabledActions: [],
16695
+ stages: [QUALIFYING, MAIN], // stages to which this policy applies
16696
+ stageSequences: [1], // stageSequences to which this policy applies
16697
+ enabledActions: [], // enabledActions: [] => all actions are enabled
16699
16698
  disabledActions: [], // disabledActions: [] => no actions are disabled
16700
16699
  },
16701
16700
  {
16702
- stages: [],
16703
- stageSequences: [],
16701
+ stages: [], // stages: [] => applies to all stages
16702
+ stageSequences: [], // stageSequences: [] => applies to all stageSequences
16704
16703
  enabledActions: [
16705
16704
  ADD_NICKNAME,
16706
16705
  ADD_PENALTY,
@@ -16738,8 +16737,8 @@ var POLICY_POSITION_ACTIONS_NO_MOVEMENT = (_a$c = {},
16738
16737
  // enabledStructures: [] => all structures are enabled
16739
16738
  enabledStructures: [
16740
16739
  {
16741
- stages: [],
16742
- stageSequences: [],
16740
+ stages: [], // stages: [] => applies to all stages
16741
+ stageSequences: [], // stageSequences: [] => applies to all stageSequences
16743
16742
  enabledActions: [SEED_VALUE, ADD_NICKNAME, ADD_PENALTY],
16744
16743
  disabledActions: [], // disabledActions: [] => no actions are disabled
16745
16744
  },
@@ -16863,7 +16862,7 @@ var POLICY_SCHEDULING_DEFAULT = (_a$9 = {},
16863
16862
  _c),
16864
16863
  matchUpAverageTimes: [
16865
16864
  {
16866
- matchUpFormatCodes: [FORMAT_STANDARD],
16865
+ matchUpFormatCodes: [FORMAT_STANDARD], // Best of 3 tiebreak sets
16867
16866
  averageTimes: [
16868
16867
  {
16869
16868
  categoryNames: [],
@@ -16876,31 +16875,31 @@ var POLICY_SCHEDULING_DEFAULT = (_a$9 = {},
16876
16875
  ],
16877
16876
  },
16878
16877
  {
16879
- matchUpFormatCodes: ['SET3-S:6/TB7-F:TB10'],
16878
+ matchUpFormatCodes: ['SET3-S:6/TB7-F:TB10'], // Two tiebreak sets, 10-point match tiebreak at one set all
16880
16879
  averageTimes: [{ categoryNames: [], minutes: { default: 85 } }],
16881
16880
  },
16882
16881
  {
16883
- matchUpFormatCodes: ['SET3-S:6/TB7-F:TB7'],
16882
+ matchUpFormatCodes: ['SET3-S:6/TB7-F:TB7'], // Two tiebreak sets, 7-point match tiebreak at one set all
16884
16883
  averageTimes: [{ categoryNames: [], minutes: { default: 70 } }],
16885
16884
  },
16886
16885
  {
16887
- matchUpFormatCodes: ['SET3-S:4NOAD-F:TB7'],
16886
+ matchUpFormatCodes: ['SET3-S:4NOAD-F:TB7'], // Two short sets to 4 with deciding game at 3-3, 7-point match tiebreak at one set all
16888
16887
  averageTimes: [{ categoryNames: [], minutes: { default: 55 } }],
16889
16888
  },
16890
16889
  {
16891
- matchUpFormatCodes: ['SET3-S:4/TB7'],
16890
+ matchUpFormatCodes: ['SET3-S:4/TB7'], // Best of 3 sets to 4
16892
16891
  averageTimes: [{ categoryNames: [], minutes: { default: 60 } }],
16893
16892
  },
16894
16893
  {
16895
- matchUpFormatCodes: ['SET3-S:4/TB7-F:TB7'],
16894
+ matchUpFormatCodes: ['SET3-S:4/TB7-F:TB7'], // Two short sets to 4, 7-point match tiebreak at one set all
16896
16895
  averageTimes: [{ categoryNames: [], minutes: { default: 50 } }],
16897
16896
  },
16898
16897
  {
16899
- matchUpFormatCodes: ['SET3-S:4/TB7-F:TB10'],
16898
+ matchUpFormatCodes: ['SET3-S:4/TB7-F:TB10'], // Two short sets to 4, 10-point match tiebreak at one set all
16900
16899
  averageTimes: [{ categoryNames: [], minutes: { default: 55 } }],
16901
16900
  },
16902
16901
  {
16903
- matchUpFormatCodes: ['SET3-S:4/TB5@3'],
16902
+ matchUpFormatCodes: ['SET3-S:4/TB5@3'], // Two out of three short sets to 4 with 5-point tiebreak at 3 games all
16904
16903
  averageTimes: [{ categoryNames: [], minutes: { default: 45 } }],
16905
16904
  },
16906
16905
  {
@@ -16911,15 +16910,15 @@ var POLICY_SCHEDULING_DEFAULT = (_a$9 = {},
16911
16910
  averageTimes: [{ categoryNames: [], minutes: { default: 40 } }],
16912
16911
  },
16913
16912
  {
16914
- matchUpFormatCodes: ['SET1-S:5/TB9@4'],
16913
+ matchUpFormatCodes: ['SET1-S:5/TB9@4'], // One no advantage set to 5, tiebreak to 9 at 4-4
16915
16914
  averageTimes: [{ categoryNames: [], minutes: { default: 30 } }],
16916
16915
  },
16917
16916
  {
16918
- matchUpFormatCodes: ['SET1-S:6/TB7'],
16917
+ matchUpFormatCodes: ['SET1-S:6/TB7'], // One standard tiebreak set to 6, 7-point tiebreak at 6 games all
16919
16918
  averageTimes: [{ categoryNames: [], minutes: { default: 30 } }],
16920
16919
  },
16921
16920
  {
16922
- matchUpFormatCodes: ['SET1-S:6NOAD'],
16921
+ matchUpFormatCodes: ['SET1-S:6NOAD'], // One set to 6 with deciding game at 5 games all
16923
16922
  averageTimes: [{ categoryNames: [], minutes: { default: 30 } }],
16924
16923
  },
16925
16924
  {
@@ -16932,11 +16931,11 @@ var POLICY_SCHEDULING_DEFAULT = (_a$9 = {},
16932
16931
  averageTimes: [{ categoryNames: [], minutes: { default: 20 } }],
16933
16932
  },
16934
16933
  {
16935
- matchUpFormatCodes: ['SET1-S:4NOAD'],
16934
+ matchUpFormatCodes: ['SET1-S:4NOAD'], // One short set to 4, deciding game is played at 3 games all
16936
16935
  averageTimes: [{ categoryNames: [], minutes: { default: 20 } }],
16937
16936
  },
16938
16937
  {
16939
- matchUpFormatCodes: ['SET1-S:TB10'],
16938
+ matchUpFormatCodes: ['SET1-S:TB10'], // One 10-point tiebreak game
16940
16939
  averageTimes: [{ categoryNames: [], minutes: { default: 10 } }],
16941
16940
  },
16942
16941
  ],
@@ -16997,7 +16996,7 @@ var POLICY_SCHEDULING_DEFAULT = (_a$9 = {},
16997
16996
  ],
16998
16997
  },
16999
16998
  {
17000
- matchUpFormatCodes: ['SET1-S:4/TB5@3'],
16999
+ matchUpFormatCodes: ['SET1-S:4/TB5@3'], // One short set to 4, 5-point tiebreak at 3 games all
17001
17000
  recoveryTimes: [
17002
17001
  {
17003
17002
  categoryTypes: [ADULT, JUNIOR],
@@ -17010,7 +17009,7 @@ var POLICY_SCHEDULING_DEFAULT = (_a$9 = {},
17010
17009
  ],
17011
17010
  },
17012
17011
  {
17013
- matchUpFormatCodes: ['SET1-S:TB10'],
17012
+ matchUpFormatCodes: ['SET1-S:TB10'], // One 10-point tiebreak game
17014
17013
  recoveryTimes: [
17015
17014
  {
17016
17015
  categoryNames: [],
@@ -18122,7 +18121,7 @@ function addFinishingRounds(_a) {
18122
18121
  if (!validMatchUps(matchUps))
18123
18122
  return [];
18124
18123
  var _d = getRoundMatchUps$1({
18125
- interpolate: true,
18124
+ interpolate: true, // for structures which do not contain a final round of one matchUps (structure winner)
18126
18125
  matchUps: matchUps,
18127
18126
  }), roundProfile = _d.roundProfile, _e = _d.roundNumbers, roundNumbers = _e === void 0 ? [] : _e;
18128
18127
  roundsCount = roundsCount || Math.max.apply(Math, __spreadArray(__spreadArray([], __read(roundNumbers), false), [0], false));
@@ -19080,7 +19079,7 @@ var baseAttributeKeys = [
19080
19079
  'tieMatchUps',
19081
19080
  'roundPosition',
19082
19081
  'score',
19083
- 'sides',
19082
+ 'sides', // can be removed only if drawPositions is present and is not a TEAM matchUp
19084
19083
  'winnerMatchUpId',
19085
19084
  'loserMatchUpId',
19086
19085
  'matchUpDuration',
@@ -21586,8 +21585,8 @@ function tidyScore(params) {
21586
21585
  var doProcess = function (methods) {
21587
21586
  methods.forEach(function (method) {
21588
21587
  result = transforms[method]({
21589
- profile: profile,
21590
- identifier: identifier,
21588
+ profile: profile, // config object compatible with provider profiles
21589
+ identifier: identifier, // optional identifier (used in test harness)
21591
21590
  matchUpStatus: matchUpStatus,
21592
21591
  attributes: attributes,
21593
21592
  applied: applied,
@@ -25716,7 +25715,7 @@ function roundRobinMatchUps(_a) {
25716
25715
  matchUpStatus: roundNumber
25717
25716
  ? MatchUpStatusEnum.ToBePlayed
25718
25717
  : MatchUpStatusEnum.Bye,
25719
- matchUpType: matchUpType,
25718
+ matchUpType: matchUpType, // does not (perhaps) need to be included; but because structures[].structure unsure about derivation inContext
25720
25719
  // finishingPositionRange in RR is not very useful, but provided for consistency
25721
25720
  finishingPositionRange: { winner: range, loser: range },
25722
25721
  drawPositions: drawPositions,
@@ -28047,7 +28046,7 @@ function setMatchUpStatus$2(params) {
28047
28046
  var matchUpTieId = inContextMatchUp === null || inContextMatchUp === void 0 ? void 0 : inContextMatchUp.matchUpTieId;
28048
28047
  // Get winner/loser position targets ----------------------------------------
28049
28048
  var targetData = positionTargets({
28050
- matchUpId: matchUpTieId || matchUpId,
28049
+ matchUpId: matchUpTieId || matchUpId, // get targets for TEAM matchUp if tieMatchUp
28051
28050
  inContextDrawMatchUps: inContextDrawMatchUps,
28052
28051
  drawDefinition: drawDefinition,
28053
28052
  });
@@ -28755,7 +28754,7 @@ function addDrawDefinition$1(params) {
28755
28754
  else {
28756
28755
  var flights = (flightProfile === null || flightProfile === void 0 ? void 0 : flightProfile.flights) || [];
28757
28756
  flights.push({
28758
- manuallyAdded: true,
28757
+ manuallyAdded: true, // this drawDefinition was not part of automated split
28759
28758
  flightNumber: drawOrder,
28760
28759
  drawEntries: drawEntries,
28761
28760
  drawName: drawName,
@@ -29101,7 +29100,7 @@ function getEventPublishStatuses(_a) {
29101
29100
  if ((_b = timeItem === null || timeItem === void 0 ? void 0 : timeItem.itemValue) === null || _b === void 0 ? void 0 : _b.PUBLIC) {
29102
29101
  var _c = timeItem.itemValue.PUBLIC || {}, _d = _c.drawIds, publishedDrawIds = _d === void 0 ? [] : _d, seeding = _c.seeding;
29103
29102
  var publishedSeeding = {
29104
- published: undefined,
29103
+ published: undefined, // seeding can be present for all entries in an event when no flights have been defined
29105
29104
  seedingScaleNames: [],
29106
29105
  drawIds: [], // seeding can be specific to drawIds
29107
29106
  };
@@ -33210,7 +33209,7 @@ var competitionGovernor = {
33210
33209
  unlinkTournament: unlinkTournament,
33211
33210
  unlinkTournaments: unlinkTournaments,
33212
33211
  getLinkedTournamentIds: getLinkedTournamentIds,
33213
- addDrawDefinition: addDrawDefinition,
33212
+ addDrawDefinition: addDrawDefinition, // test
33214
33213
  getCompetitionParticipants: getCompetitionParticipants,
33215
33214
  getParticipants: getParticipants,
33216
33215
  addParticipant: addParticipant,
@@ -33218,10 +33217,10 @@ var competitionGovernor = {
33218
33217
  setMatchUpStatus: setMatchUpStatus,
33219
33218
  bulkMatchUpStatusUpdate: bulkMatchUpStatusUpdate,
33220
33219
  bulkScheduleMatchUps: bulkScheduleMatchUps,
33221
- addPenalty: addPenalty,
33222
- removePenalty: removePenalty,
33223
- modifyPenalty: modifyPenalty,
33224
- getCompetitionPenalties: getCompetitionPenalties,
33220
+ addPenalty: addPenalty, // test
33221
+ removePenalty: removePenalty, // test
33222
+ modifyPenalty: modifyPenalty, // test
33223
+ getCompetitionPenalties: getCompetitionPenalties, // test
33225
33224
  findParticipant: publicFindParticipant,
33226
33225
  };
33227
33226
 
@@ -34522,8 +34521,8 @@ function competitionScheduleMatchUps(params) {
34522
34521
  courtsData: courtsData,
34523
34522
  completedMatchUps: alwaysReturnCompleted
34524
34523
  ? allCompletedMatchUps
34525
- : completedMatchUps,
34526
- dateMatchUps: dateMatchUps,
34524
+ : completedMatchUps, // completed matchUps for the filter date
34525
+ dateMatchUps: dateMatchUps, // all incomplete matchUps for the filter date
34527
34526
  venues: venues,
34528
34527
  };
34529
34528
  if (withCourtGridRows) {
@@ -34677,7 +34676,7 @@ function calculateScheduleTimes(_a) {
34677
34676
  // need to reduce courts available for a given time period by the number of matchUps scheduled at a given venue
34678
34677
  var matchUpFilters = { scheduledDate: scheduleDate, venueIds: venueIds };
34679
34678
  var matchUpsWithSchedule = competitionScheduleMatchUps({
34680
- sortDateMatchUps: false,
34679
+ sortDateMatchUps: false, // unnecessary for extracting bookings; reduce processing overhead;
34681
34680
  tournamentRecords: tournamentRecords,
34682
34681
  matchUpFilters: matchUpFilters,
34683
34682
  });
@@ -34797,8 +34796,8 @@ function checkParticipantProfileInitialization(_a) {
34797
34796
  typeChangeTimeAfterRecovery: undefined,
34798
34797
  timeAfterRecovery: undefined,
34799
34798
  priorMatchUpType: undefined,
34800
- potentialRecovery: {},
34801
- potentialCounted: {},
34799
+ potentialRecovery: {}, // { [drawId]: [timeString] } - timeAfterRecovery for potential matchUps by drawId
34800
+ potentialCounted: {}, // whether a potential matchUp has been counted for daily limits for a specific drawId
34802
34801
  potentialBookings: {},
34803
34802
  bookings: [],
34804
34803
  counters: {},
@@ -35406,7 +35405,7 @@ function getVenueSchedulingDetails(_a) {
35406
35405
  }), matchUpsToSchedule = _g.matchUpsToSchedule, matchUpMap = _g.matchUpMap;
35407
35406
  var venueCourts = courts.filter(function (court) { return court.venueId === venueId; });
35408
35407
  venueScheduledRoundDetails[venueId] = {
35409
- previousRemainingScheduleTimes: [],
35408
+ previousRemainingScheduleTimes: [], // keep track of sheduleTimes not used on previous iteration
35410
35409
  courtsCount: venueCourts.length,
35411
35410
  greatestAverageMinutes: greatestAverageMinutes,
35412
35411
  scheduledRoundsDetails: scheduledRoundsDetails,
@@ -37671,10 +37670,10 @@ function getRoundId(obj) {
37671
37670
  var relevantStructureId = isRoundRobin ? containerStructureId : structureId;
37672
37671
  // retain order
37673
37672
  var id = [
37674
- tournamentId,
37675
- eventId,
37676
- drawId,
37677
- relevantStructureId,
37673
+ tournamentId, // 1
37674
+ eventId, // 2
37675
+ drawId, // 3
37676
+ relevantStructureId, // 4
37678
37677
  roundNumber, // 5
37679
37678
  ].join('|');
37680
37679
  return definedAttributes({
@@ -38827,7 +38826,7 @@ var scheduleGovernor$1 = {
38827
38826
  getMatchUpFormatTimingUpdate: getMatchUpFormatTimingUpdate$1,
38828
38827
  getEventMatchUpFormatTiming: getEventMatchUpFormatTiming,
38829
38828
  removeEventMatchUpFormatTiming: removeEventMatchUpFormatTiming,
38830
- getMatchUpDailyLimitsUpdate: getMatchUpDailyLimitsUpdate$1,
38829
+ getMatchUpDailyLimitsUpdate: getMatchUpDailyLimitsUpdate$1, // document
38831
38830
  getMatchUpDailyLimits: getMatchUpDailyLimits,
38832
38831
  setMatchUpDailyLimits: setMatchUpDailyLimits,
38833
38832
  getProfileRounds: getProfileRounds,
@@ -38835,7 +38834,7 @@ var scheduleGovernor$1 = {
38835
38834
  assignMatchUpVenue: assignMatchUpVenue,
38836
38835
  assignMatchUpCourt: assignMatchUpCourt,
38837
38836
  allocateTeamMatchUpCourts: allocateTeamMatchUpCourts,
38838
- addMatchUpScheduleItems: addMatchUpScheduleItems,
38837
+ addMatchUpScheduleItems: addMatchUpScheduleItems, // test
38839
38838
  addMatchUpScheduledDate: addMatchUpScheduledDate,
38840
38839
  addMatchUpScheduledTime: addMatchUpScheduledTime,
38841
38840
  addMatchUpCourtOrder: addMatchUpCourtOrder,
@@ -38843,7 +38842,7 @@ var scheduleGovernor$1 = {
38843
38842
  addMatchUpStopTime: addMatchUpStopTime,
38844
38843
  addMatchUpResumeTime: addMatchUpResumeTime,
38845
38844
  addMatchUpEndTime: addMatchUpEndTime,
38846
- addMatchUpOfficial: addMatchUpOfficial,
38845
+ addMatchUpOfficial: addMatchUpOfficial, // test
38847
38846
  getSchedulingProfile: getSchedulingProfile$1,
38848
38847
  setSchedulingProfile: setSchedulingProfile$1,
38849
38848
  addSchedulingProfileRound: addSchedulingProfileRound,
@@ -39235,14 +39234,14 @@ var POLICY_MATCHUP_ACTIONS_DEFAULT = (_a$2 = {},
39235
39234
  // enabledStructures: [] => all structures are enabled
39236
39235
  enabledStructures: [
39237
39236
  {
39238
- stages: [],
39239
- stageSequences: [],
39237
+ stages: [], // stages: [] => applies to all stages
39238
+ stageSequences: [], // stageSequences: [] => applies to all stageSequences
39240
39239
  enabledActions: [],
39241
39240
  disabledActions: [], // disabledActions: [] => no actions are disabled
39242
39241
  },
39243
39242
  ],
39244
39243
  participants: {
39245
- enforceCategory: true,
39244
+ enforceCategory: true, // validate collectionDefinition.category against event.category
39246
39245
  enforceGender: true, // disallow placing FEMALEs in MALE events and vice versa
39247
39246
  },
39248
39247
  processCodes: {
@@ -39628,7 +39627,7 @@ function matchUpActions$2(_a) {
39628
39627
  };
39629
39628
  validActions.push({
39630
39629
  info: 'set outcome and winningSide',
39631
- method: SCHEDULE_METHOD,
39630
+ method: SCHEDULE_METHOD, // setMatchUpStatus
39632
39631
  type: SCORE,
39633
39632
  payload: payload,
39634
39633
  });
@@ -41921,7 +41920,7 @@ function generateQualifyingLink(_a) {
41921
41920
  finishingPositions: finishingPositions,
41922
41921
  },
41923
41922
  target: {
41924
- feedProfile: DRAW,
41923
+ feedProfile: DRAW, // positions are not automatically placed
41925
41924
  roundNumber: targetEntryRound,
41926
41925
  structureId: targetStructureId,
41927
41926
  },
@@ -42139,7 +42138,7 @@ function generateQualifyingStructures(_a) {
42139
42138
  matchUpFormat: matchUpFormat,
42140
42139
  stageSequence: stageSequence,
42141
42140
  matchUpType: matchUpType,
42142
- roundLimit: roundLimit,
42141
+ roundLimit: roundLimit, // redundant
42143
42142
  matchUps: matchUps,
42144
42143
  });
42145
42144
  if (roundTarget) {
@@ -42450,7 +42449,7 @@ function getAvailablePlayoffProfiles$1(_a) {
42450
42449
  else {
42451
42450
  return {
42452
42451
  availablePlayoffProfiles: Object.values(available),
42453
- availablePlayoffRounds: Object.values(available),
42452
+ availablePlayoffRounds: Object.values(available), // to be deprecated
42454
42453
  positionsPlayedOff: positionsPlayedOff,
42455
42454
  };
42456
42455
  }
@@ -47248,7 +47247,7 @@ function generateQualifyingStructure$1(params) {
47248
47247
  matchUpFormat: matchUpFormat,
47249
47248
  stageSequence: stageSequence,
47250
47249
  matchUpType: matchUpType,
47251
- roundLimit: roundLimit,
47250
+ roundLimit: roundLimit, // redundant
47252
47251
  matchUps: matchUps,
47253
47252
  });
47254
47253
  if (roundTarget) {
@@ -48144,7 +48143,7 @@ var structureGovernor = {
48144
48143
  generateQualifyingStructure: generateQualifyingStructure$1,
48145
48144
  attachQualifyingStructure: attachQualifyingStructure$1,
48146
48145
  addQualifyingStructure: addQualifyingStructure$1,
48147
- getAvailablePlayoffRounds: getAvailablePlayoffProfiles$1,
48146
+ getAvailablePlayoffRounds: getAvailablePlayoffProfiles$1, // to be deprecated,
48148
48147
  getAvailablePlayoffProfiles: getAvailablePlayoffProfiles$1,
48149
48148
  getSourceRounds: getSourceRounds,
48150
48149
  getDrawStructures: getDrawStructures,
@@ -48157,7 +48156,7 @@ var structureGovernor = {
48157
48156
  addVoluntaryConsolationStage: addVoluntaryConsolationStage$1,
48158
48157
  addVoluntaryConsolationStructure: addVoluntaryConsolationStructure$1,
48159
48158
  generateVoluntaryConsolation: generateVoluntaryConsolation$1,
48160
- buildDrawHierarchy: buildDrawHierarchy,
48159
+ buildDrawHierarchy: buildDrawHierarchy, // obsolete
48161
48160
  generateDrawTypeAndModifyDrawDefinition: generateDrawTypeAndModifyDrawDefinition$1,
48162
48161
  generateDrawStructuresAndLinks: generateDrawStructuresAndLinks$1,
48163
48162
  };
@@ -49551,7 +49550,7 @@ function addEventEntries(params) {
49551
49550
  removedEntries.push.apply(removedEntries, __spreadArray([], __read(ungroupedParticipantIdsToRemove), false));
49552
49551
  removeEventEntries({
49553
49552
  participantIds: ungroupedParticipantIdsToRemove,
49554
- autoEntryPositions: false,
49553
+ autoEntryPositions: false, // because the method will be called below if necessary
49555
49554
  event: event,
49556
49555
  });
49557
49556
  }
@@ -52169,16 +52168,16 @@ function getValidQualifiersAction(_a) {
52169
52168
  // disallow placing qualifiers until source structure is completed
52170
52169
  var requireCompletedStructures = policy === null || policy === void 0 ? void 0 : policy.requireCompletedStructures;
52171
52170
  var _h = getSourceStructureIdsAndRelevantLinks({
52172
- targetRoundNumber: targetRoundNumber,
52173
- linkType: WINNER,
52171
+ targetRoundNumber: targetRoundNumber, // look for soure structrues targeting roundNumber
52172
+ linkType: WINNER, // WINNER of qualifying structures will traverse link
52174
52173
  drawDefinition: drawDefinition,
52175
52174
  structureId: structureId,
52176
52175
  }) || {}, eliminationSoureStructureIds = _h.sourceStructureIds, eliminationSourceLinks = _h.relevantLinks;
52177
52176
  if (eliminationSoureStructureIds === null || eliminationSoureStructureIds === void 0 ? void 0 : eliminationSoureStructureIds.length)
52178
52177
  sourceStructureIds.push.apply(sourceStructureIds, __spreadArray([], __read(eliminationSoureStructureIds), false));
52179
52178
  var _j = getSourceStructureIdsAndRelevantLinks({
52180
- targetRoundNumber: targetRoundNumber,
52181
- linkType: POSITION,
52179
+ targetRoundNumber: targetRoundNumber, // look for soure structrues targeting roundNumber
52180
+ linkType: POSITION, // link will define how many finishingPositions traverse the link
52182
52181
  drawDefinition: drawDefinition,
52183
52182
  structureId: structureId,
52184
52183
  }) || {}, roundRobinSourceStructureIds = _j.sourceStructureIds, roundRobinSourceLinks = _j.relevantLinks;
@@ -52307,7 +52306,7 @@ function getValidQualifiersAction(_a) {
52307
52306
  if (qualifyingParticipantIds.length) {
52308
52307
  validAssignmentActions.push(definedAttributes({
52309
52308
  payload: {
52310
- qualifyingParticipantId: undefined,
52309
+ qualifyingParticipantId: undefined, // to be provided by client
52311
52310
  drawPosition: drawPosition,
52312
52311
  structureId: structureId,
52313
52312
  drawId: drawId,
@@ -54969,7 +54968,7 @@ function addParticipantContext(params) {
54969
54968
  if ((event === null || event === void 0 ? void 0 : event.eventType) === TEAM$2) {
54970
54969
  // add back lineUps extension for team resolution when { matchUpType: TEAM } is missing side.lineUps
54971
54970
  var extension = findExtension$2({
54972
- element: rawEvent.drawDefinitions[i],
54971
+ element: rawEvent.drawDefinitions[i], // rawEvent because deepCopy has converted extensions
54973
54972
  name: LINEUPS,
54974
54973
  }).extension;
54975
54974
  if (extension)
@@ -54989,7 +54988,7 @@ function addParticipantContext(params) {
54989
54988
  if ((_c = timeItem === null || timeItem === void 0 ? void 0 : timeItem.itemValue) === null || _c === void 0 ? void 0 : _c.PUBLIC) {
54990
54989
  var _h = timeItem.itemValue.PUBLIC || {}, _j = _h.drawIds, publishedDrawIds = _j === void 0 ? [] : _j, seeding = _h.seeding;
54991
54990
  var publishedSeeding = {
54992
- published: undefined,
54991
+ published: undefined, // seeding can be present for all entries in an event when no flights have been defined
54993
54992
  seedingScaleNames: [],
54994
54993
  drawIds: [], // seeding can be specific to drawIds
54995
54994
  };
@@ -58752,9 +58751,9 @@ function analyzeDraws(_a) {
58752
58751
  if (!tournamentRecord)
58753
58752
  return { error: MISSING_TOURNAMENT_RECORD };
58754
58753
  var drawsAnalysis = {
58755
- positionsNoOutcomes: [],
58756
- canBePruned: [],
58757
- matchPlay: [],
58754
+ positionsNoOutcomes: [], // all positions assigned and no outcomes
58755
+ canBePruned: [], // partially assigned positions with outcomes => drawSizes can be reduced
58756
+ matchPlay: [], // only first round has active matchUps; some unassigned positions
58758
58757
  inactive: [],
58759
58758
  drawAnalysis: {},
58760
58759
  };
@@ -59293,9 +59292,9 @@ var scheduleGovernor = {
59293
59292
  removeEventMatchUpFormatTiming: removeEventMatchUpFormatTiming$1,
59294
59293
  getMatchUpFormatTimingUpdate: getMatchUpFormatTimingUpdate,
59295
59294
  getMatchUpDependencies: getMatchUpDependencies,
59296
- getMatchUpDailyLimits: getMatchUpDailyLimits$1,
59297
- setMatchUpDailyLimits: setMatchUpDailyLimits$1,
59298
- getMatchUpDailyLimitsUpdate: getMatchUpDailyLimitsUpdate,
59295
+ getMatchUpDailyLimits: getMatchUpDailyLimits$1, // document
59296
+ setMatchUpDailyLimits: setMatchUpDailyLimits$1, // document
59297
+ getMatchUpDailyLimitsUpdate: getMatchUpDailyLimitsUpdate, // document
59299
59298
  validateSchedulingProfile: validateSchedulingProfile,
59300
59299
  setSchedulingProfile: setSchedulingProfile,
59301
59300
  getSchedulingProfile: getSchedulingProfile,
@@ -59402,7 +59401,7 @@ function getEntryStatusReports(_a) {
59402
59401
  var tournamentId = tournamentRecord.tournamentId;
59403
59402
  var participantMap = getParticipants$1({
59404
59403
  withScaleValues: true,
59405
- withEvents: true,
59404
+ withEvents: true, // so that event rankings will be present
59406
59405
  withSeeding: true,
59407
59406
  tournamentRecord: tournamentRecord,
59408
59407
  withDraws: true,
@@ -59757,18 +59756,19 @@ function getParticipantStats(_a) {
59757
59756
  if (teamParticipantId) {
59758
59757
  var processForTeam = !opponentParticipantId ||
59759
59758
  sides.every(function (side) {
59760
- side.participant &&
59759
+ return (side.participant &&
59761
59760
  (getCompetitorIds({
59762
- side: side,
59763
59761
  individualParticipantIds: teamMap.get(teamParticipantId),
59762
+ side: side,
59764
59763
  }) ||
59765
59764
  getCompetitorIds({
59766
- side: side,
59767
59765
  individualParticipantIds: teamMap.get(opponentParticipantId),
59768
- }));
59766
+ side: side,
59767
+ })));
59769
59768
  });
59770
- if (processForTeam)
59769
+ if (processForTeam) {
59771
59770
  processSides(teamParticipantId, teamMap.get(teamParticipantId));
59771
+ }
59772
59772
  }
59773
59773
  else {
59774
59774
  try {
@@ -62493,7 +62493,7 @@ function setEntryPositions(_a) {
62493
62493
  var positioning = entryPositions_1_1.value;
62494
62494
  var participantId = positioning.participantId, entryPosition = positioning.entryPosition;
62495
62495
  var result = setEntryPosition({
62496
- skipRefresh: true,
62496
+ skipRefresh: true, // avoid redundant processing
62497
62497
  tournamentRecord: tournamentRecord,
62498
62498
  drawDefinition: drawDefinition,
62499
62499
  participantId: participantId,
@@ -65033,7 +65033,7 @@ var eventGovernor = {
65033
65033
  addDrawEntries: addDrawEntries,
65034
65034
  removeSeeding: removeSeeding,
65035
65035
  autoSeeding: autoSeeding,
65036
- getAvailablePlayoffRounds: getAvailablePlayoffProfiles,
65036
+ getAvailablePlayoffRounds: getAvailablePlayoffProfiles, // to be deprecated
65037
65037
  getAvailablePlayoffProfiles: getAvailablePlayoffProfiles,
65038
65038
  getAssignedParticipantIds: getAssignedParticipantIds,
65039
65039
  deleteDrawDefinitions: deleteDrawDefinitions,
@@ -66045,7 +66045,7 @@ function getEventProperties(_a) {
66045
66045
  hasRatedParticipants = !!(hasRatedParticipants || rating);
66046
66046
  return {
66047
66047
  participantId: participantId,
66048
- participantName: participantName || name,
66048
+ participantName: participantName || name, // support legacy
66049
66049
  seed: seed,
66050
66050
  ranking: ranking,
66051
66051
  rating: rating,
@@ -67034,10 +67034,10 @@ function kSet(maxCountables, counted) {
67034
67034
  return isNaN(kset) ? eloConfig.kDefault() : kset;
67035
67035
  }
67036
67036
  var eloConfig = {
67037
- nSpread: 400,
67037
+ nSpread: 400, // determines the 'spread' of the scale
67038
67038
  diffThreshold: 0.125,
67039
- kCalc: k538,
67040
- kMultiplier: kSet,
67039
+ kCalc: k538, // use calculation defined by FiveThirtyEight.com
67040
+ kMultiplier: kSet, // change to kDefault for value of 1
67041
67041
  kDefault: kDefault,
67042
67042
  };
67043
67043
  function calculateNewRatings(params) {
@@ -68665,7 +68665,7 @@ function anonymizeTournamentRecord(_a) {
68665
68665
  var _b;
68666
68666
  return (_a = {},
68667
68667
  _a[gender] = ((_b = generatePersons({
68668
- category: { ageCategoryCode: 'O18' },
68668
+ category: { ageCategoryCode: 'O18' }, // ageCategoryCode is unimportant since birthYear will be replaced
68669
68669
  count: gendersCount[gender],
68670
68670
  addressProps: { citiesCount: 10 },
68671
68671
  personExtensions: [],