tods-competition-factory 1.8.9 → 1.8.10

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.
@@ -695,10 +695,6 @@ const INVALID_SCALE_ITEM = {
695
695
  message: "Invalid scaleItem",
696
696
  code: "ERR_INVALID_SCALE_ITEM"
697
697
  };
698
- const SCALE_ITEM_NOT_FOUND = {
699
- message: "No scaleItem found",
700
- code: "ERR_NOT_FOUND_SCALE_ITEM"
701
- };
702
698
  const NO_CANDIDATES = {
703
699
  message: "No Candidates",
704
700
  code: "ERR_UNCHANGED_NO_CANDIDATES"
@@ -1383,7 +1379,7 @@ function getPolicyDefinitions({
1383
1379
  if (policy)
1384
1380
  policyDefinitions[policyType] = policy;
1385
1381
  }
1386
- return Object.keys(policyDefinitions).length ? { policyDefinitions } : { error: POLICY_NOT_FOUND };
1382
+ return Object.keys(policyDefinitions).length ? { policyDefinitions } : { info: POLICY_NOT_FOUND.message };
1387
1383
  }
1388
1384
 
1389
1385
  const WALKOVER = "WALKOVER";
@@ -1444,7 +1440,7 @@ function findPolicy({
1444
1440
  structure,
1445
1441
  event
1446
1442
  });
1447
- return appliedPolicies?.[policyType] ? { policy: appliedPolicies[policyType] } : { error: POLICY_NOT_FOUND };
1443
+ return appliedPolicies?.[policyType] ? { policy: appliedPolicies[policyType] } : { info: POLICY_NOT_FOUND?.message };
1448
1444
  }
1449
1445
 
1450
1446
  const POLICY_TYPE_COMPETITIVE_BANDS = "competitiveBands";
@@ -17936,7 +17932,7 @@ function participantScaleItem({
17936
17932
  return { error: INVALID_VALUES };
17937
17933
  if (!participant.timeItems)
17938
17934
  participant.timeItems = [];
17939
- if (participant && Array.isArray(participant.timeItems)) {
17935
+ if (Array.isArray(participant.timeItems)) {
17940
17936
  const { accessor, scaleType, eventType, scaleName } = scaleAttributes;
17941
17937
  const filterType = [SCALE, scaleType, eventType, scaleName].join(".");
17942
17938
  const filteredTimeItems = participant.timeItems.filter((timeItem2) => timeItem2?.itemType === filterType).filter((timeItem2) => !requireTimeStamp || timeItem2?.itemDate).sort(
@@ -17956,12 +17952,10 @@ function participantScaleItem({
17956
17952
  scaleName: scaleName2,
17957
17953
  scaleType: scaleType2
17958
17954
  };
17959
- return { scaleItem };
17960
- } else {
17961
- return { error: SCALE_ITEM_NOT_FOUND };
17955
+ return { ...SUCCESS, scaleItem };
17962
17956
  }
17963
17957
  }
17964
- return { error: MISSING_PARTICIPANT };
17958
+ return { ...SUCCESS, scaleItem: void 0 };
17965
17959
  }
17966
17960
 
17967
17961
  function getEventSeedAssignments({
@@ -18424,8 +18418,6 @@ function getParticipantEntries(params) {
18424
18418
  participantMap,
18425
18419
  withPotentialMatchUps,
18426
18420
  withRankingProfile,
18427
- withScheduleTimes,
18428
- withScheduleItems,
18429
18421
  scheduleAnalysis,
18430
18422
  withTeamMatchUps,
18431
18423
  withStatistics,
@@ -18435,8 +18427,7 @@ function getParticipantEntries(params) {
18435
18427
  withEvents,
18436
18428
  withDraws
18437
18429
  } = params;
18438
- if (withScheduleItems)
18439
- console.log({ withScheduleItems });
18430
+ const withScheduleTimes = params.withScheduleTimes ?? params.withScheduleItems;
18440
18431
  const targetParticipantIds = participantFilters?.participantIds;
18441
18432
  const getRelevantParticipantIds = (participantId) => {
18442
18433
  const relevantParticipantIds = [participantId];