tods-competition-factory 2.1.22 → 2.1.24

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.1.22';
6
+ return '2.1.24';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -36309,8 +36309,8 @@ function participantScheduledMatchUps({ scheduleAttributes = ['scheduledDate', '
36309
36309
  }
36310
36310
 
36311
36311
  function getCompetitionPublishedDrawDetails({ tournamentRecords }) {
36312
- const drawIds = [];
36313
36312
  const detailsMap = {};
36313
+ const drawIds = [];
36314
36314
  for (const tournamentRecord of Object.values(tournamentRecords)) {
36315
36315
  for (const event of tournamentRecord.events ?? []) {
36316
36316
  const eventPubStatus = getEventPublishStatus({ event });
@@ -36593,9 +36593,7 @@ function competitionScheduleMatchUps(params) {
36593
36593
  }
36594
36594
  let publishedDrawIds, detailsMap;
36595
36595
  if (usePublishState) {
36596
- ({ drawIds: publishedDrawIds, detailsMap } = getCompetitionPublishedDrawDetails({
36597
- tournamentRecords,
36598
- }));
36596
+ ({ drawIds: publishedDrawIds, detailsMap } = getCompetitionPublishedDrawDetails({ tournamentRecords }));
36599
36597
  }
36600
36598
  if (publishedDrawIds?.length) {
36601
36599
  if (!params.contextFilters)
@@ -36655,7 +36653,7 @@ function competitionScheduleMatchUps(params) {
36655
36653
  contextFilters: params.contextFilters,
36656
36654
  });
36657
36655
  let relevantMatchUps = [...(upcomingMatchUps ?? []), ...(pendingMatchUps ?? [])];
36658
- if (detailsMap && Object.keys(detailsMap).length) {
36656
+ if (detailsMap && (!publishedDrawIds?.length || Object.keys(detailsMap).length)) {
36659
36657
  relevantMatchUps = relevantMatchUps.filter((matchUp) => {
36660
36658
  const { drawId, structureId, stage } = matchUp;
36661
36659
  if (!detailsMap?.[drawId]?.publishingDetail?.published)
@@ -38107,7 +38105,6 @@ function generateDrawDefinition(params) {
38107
38105
  return decorateResult({ result: { error: INVALID_VALUES }, stack });
38108
38106
  const genResult = generateOrGetExisting({
38109
38107
  ...params,
38110
- isMock: params.isMock ?? true,
38111
38108
  policyDefinitions,
38112
38109
  tournamentRecord,
38113
38110
  appliedPolicies,
@@ -45110,9 +45107,9 @@ function setMatchUpState(params) {
45110
45107
  method: stack,
45111
45108
  winningSide,
45112
45109
  });
45113
- const result = ((!activeDownstream || params.autoCalcDisabled) && noDownstreamDependencies(params)) ||
45110
+ const result = (!activeDownstream && noDownstreamDependencies(params)) ||
45114
45111
  (matchUpWinner && winningSideWithDownstreamDependencies(params)) ||
45115
- (directingMatchUpStatus && applyMatchUpValues(params)) || {
45112
+ ((directingMatchUpStatus || params.autoCalcDisabled) && applyMatchUpValues(params)) || {
45116
45113
  error: NO_VALID_ACTIONS,
45117
45114
  };
45118
45115
  return decorateResult({ result, stack });
@@ -45137,7 +45134,7 @@ function applyMatchUpValues(params) {
45137
45134
  !params.winningSide &&
45138
45135
  !checkScoreHasValue({ score: params.score });
45139
45136
  const newMatchUpStatus = params.isCollectionMatchUp
45140
- ? params.matchUpStatus || (removeWinningSide && TO_BE_PLAYED) || COMPLETED$1
45137
+ ? params.matchUpStatus || (removeWinningSide && TO_BE_PLAYED) || (params.winningSide && COMPLETED$1) || INCOMPLETE
45141
45138
  : params.matchUpStatus || COMPLETED$1;
45142
45139
  const removeScore = params.removeScore ||
45143
45140
  ([CANCELLED$1, WALKOVER$2].includes(newMatchUpStatus) && ![INCOMPLETE, ABANDONED$1].includes(newMatchUpStatus));
@@ -48327,6 +48324,7 @@ var lastNames = [
48327
48324
  "Eisenstein",
48328
48325
  "Eldritch",
48329
48326
  "Elliot",
48327
+ "Ellul",
48330
48328
  "Escher",
48331
48329
  "Eyre",
48332
48330
  "Faulkner",
@@ -48500,6 +48498,7 @@ var firstMale = [
48500
48498
  "Inigo",
48501
48499
  "Italo",
48502
48500
  "Ivan",
48501
+ "Jacques",
48503
48502
  "James",
48504
48503
  "Jared",
48505
48504
  "Jerry",