tods-competition-factory 1.8.10 → 1.8.11

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.
@@ -18162,7 +18162,7 @@ function addStructureParticipation({
18162
18162
 
18163
18163
  function processSides(params) {
18164
18164
  const {
18165
- withScheduleTimes,
18165
+ withScheduleItems,
18166
18166
  scheduleAnalysis,
18167
18167
  withTeamMatchUps,
18168
18168
  participantMap,
@@ -18272,7 +18272,7 @@ function processSides(params) {
18272
18272
  stage
18273
18273
  });
18274
18274
  }
18275
- if (scheduleAnalysis || withScheduleTimes) {
18275
+ if (scheduleAnalysis || withScheduleItems) {
18276
18276
  addScheduleItem({
18277
18277
  participantMap,
18278
18278
  participantId: participantId2,
@@ -18418,6 +18418,7 @@ function getParticipantEntries(params) {
18418
18418
  participantMap,
18419
18419
  withPotentialMatchUps,
18420
18420
  withRankingProfile,
18421
+ withScheduleItems,
18421
18422
  scheduleAnalysis,
18422
18423
  withTeamMatchUps,
18423
18424
  withStatistics,
@@ -18427,7 +18428,6 @@ function getParticipantEntries(params) {
18427
18428
  withEvents,
18428
18429
  withDraws
18429
18430
  } = params;
18430
- const withScheduleTimes = params.withScheduleTimes ?? params.withScheduleItems;
18431
18431
  const targetParticipantIds = participantFilters?.participantIds;
18432
18432
  const getRelevantParticipantIds = (participantId) => {
18433
18433
  const relevantParticipantIds = [participantId];
@@ -18445,7 +18445,7 @@ function getParticipantEntries(params) {
18445
18445
  withDraws: withDraws || withRankingProfile,
18446
18446
  withPotentialMatchUps,
18447
18447
  withRankingProfile,
18448
- withScheduleTimes,
18448
+ withScheduleItems,
18449
18449
  scheduleAnalysis,
18450
18450
  withTeamMatchUps,
18451
18451
  withStatistics,
@@ -18765,7 +18765,7 @@ function getParticipantEntries(params) {
18765
18765
  matchUpType: matchUpType2
18766
18766
  });
18767
18767
  }
18768
- if (Array.isArray(potentialParticipants) && (nextMatchUps || !!scheduleAnalysis || withScheduleTimes)) {
18768
+ if (Array.isArray(potentialParticipants) && (nextMatchUps || !!scheduleAnalysis || withScheduleItems)) {
18769
18769
  const potentialParticipantIds = potentialParticipants.flat().map(extractAttributes("participantId")).filter(Boolean);
18770
18770
  potentialParticipantIds?.forEach((participantId) => {
18771
18771
  const relevantParticipantIds = getRelevantParticipantIds(participantId);
@@ -18780,7 +18780,7 @@ function getParticipantEntries(params) {
18780
18780
  drawId
18781
18781
  });
18782
18782
  });
18783
- if (!!scheduleAnalysis || withScheduleTimes) {
18783
+ if (!!scheduleAnalysis || withScheduleItems) {
18784
18784
  addScheduleItem({
18785
18785
  potential: true,
18786
18786
  participantMap,
@@ -18889,13 +18889,18 @@ function getParticipantEntries(params) {
18889
18889
  const notBeforeTime = typeChange ? typeChangeTimeAfterRecovery || timeAfterRecovery : timeAfterRecovery;
18890
18890
  const sameDraw = scheduleItem.drawId === consideredItem.drawId;
18891
18891
  const bothPotential = potentialMatchUps[scheduleItem.matchUpId] && potentialMatchUps[consideredItem.matchUpId];
18892
- const nextMinutes = timeStringMinutes(consideredItem.scheduledTime);
18893
- const minutesDifference = Math.abs(nextMinutes - scheduledMinutes);
18894
- const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : timeStringMinutes(notBeforeTime) > timeStringMinutes(consideredItem.scheduledTime);
18895
- if (timeOverlap && !(bothPotential && sameDraw)) {
18892
+ const consideredMinutes = timeStringMinutes(
18893
+ consideredItem.scheduledTime
18894
+ );
18895
+ const minutesDifference = Math.abs(
18896
+ consideredMinutes - scheduledMinutes
18897
+ );
18898
+ const itemIsPrior = consideredMinutes > scheduledMinutes;
18899
+ const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : itemIsPrior && timeStringMinutes(consideredItem.scheduledTime) < timeStringMinutes(notBeforeTime);
18900
+ if (timeOverlap && !(bothPotential && sameDraw) && itemIsPrior) {
18896
18901
  participantAggregator.scheduleConflicts.push({
18897
- priorScheduledMatchUpId: consideredItem.matchUpId,
18898
- matchUpIdWithConflict: scheduleItem.matchUpId
18902
+ priorScheduledMatchUpId: scheduleItem.matchUpId,
18903
+ matchUpIdWithConflict: consideredItem.matchUpId
18899
18904
  });
18900
18905
  }
18901
18906
  }
@@ -19111,6 +19116,7 @@ function getParticipants(params) {
19111
19116
  ({
19112
19117
  potentialMatchUps,
19113
19118
  scheduleConflicts,
19119
+ scheduleItems,
19114
19120
  participant,
19115
19121
  statistics,
19116
19122
  opponents,
@@ -19136,7 +19142,8 @@ function getParticipants(params) {
19136
19142
  matchUps: withMatchUps || withRankingProfile ? Object.values(matchUps2) : void 0,
19137
19143
  opponents: withOpponents ? participantOpponents : void 0,
19138
19144
  potentialMatchUps: nextMatchUps ? Object.values(potentialMatchUps) : void 0,
19139
- statistics: withStatistics ? Object.values(statistics) : void 0
19145
+ statistics: withStatistics ? Object.values(statistics) : void 0,
19146
+ scheduleItems: withScheduleItems ? scheduleItems : void 0
19140
19147
  },
19141
19148
  false,
19142
19149
  false,
@@ -23639,7 +23646,7 @@ function generateDrawDefinition(params) {
23639
23646
  drawDefinition.links = [];
23640
23647
  drawDefinition.links.push(link);
23641
23648
  }
23642
- drawDefinition.drawName = params.drawName ?? drawType;
23649
+ drawDefinition.drawName = params.drawName ?? (drawType && constantToString(drawType));
23643
23650
  if (typeof voluntaryConsolation === "object") {
23644
23651
  addVoluntaryConsolationStructure({
23645
23652
  ...voluntaryConsolation,