tods-competition-factory 1.8.34 → 1.8.35

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.
@@ -23570,7 +23570,13 @@ const POLICY_SEEDING_USTA = {
23570
23570
  validSeedPositions: { ignore: true },
23571
23571
  duplicateSeedNumbers: true,
23572
23572
  drawSizeProgression: true,
23573
- seedingProfile: { positioning: SEPARATE },
23573
+ seedingProfile: {
23574
+ drawTypes: {
23575
+ [ROUND_ROBIN_WITH_PLAYOFF]: { positioning: WATERFALL },
23576
+ [ROUND_ROBIN]: { positioning: WATERFALL }
23577
+ },
23578
+ positioning: SEPARATE
23579
+ },
23574
23580
  policyName: "USTA SEEDING",
23575
23581
  seedsCountThresholds: [
23576
23582
  { drawSize: 4, minimumParticipantCount: 3, seedsCount: 2 },
@@ -23591,11 +23597,9 @@ function generateDrawDefinition(params) {
23591
23597
  ignoreAllowedDrawTypes,
23592
23598
  voluntaryConsolation,
23593
23599
  hydrateCollections,
23594
- policyDefinitions,
23595
23600
  ignoreStageSpace,
23596
23601
  tournamentRecord,
23597
23602
  qualifyingOnly,
23598
- seedingProfile,
23599
23603
  tieFormatName,
23600
23604
  drawEntries,
23601
23605
  addToEvent,
@@ -23606,8 +23610,19 @@ function generateDrawDefinition(params) {
23606
23610
  tournamentRecord,
23607
23611
  event
23608
23612
  }).appliedPolicies ?? {};
23609
- const drawTypeCoercion = params.drawTypeCoercion ?? appliedPolicies?.[POLICY_TYPE_DRAWS]?.drawTypeCoercion ?? true;
23613
+ const policyDefinitions = params.policyDefinitions ?? {};
23614
+ const drawTypeCoercion = params.drawTypeCoercion ?? policyDefinitions?.[POLICY_TYPE_DRAWS]?.drawTypeCoercion ?? appliedPolicies?.[POLICY_TYPE_DRAWS]?.drawTypeCoercion ?? true;
23610
23615
  const drawType = drawTypeCoercion && params.drawSize === 2 && DrawTypeEnum.SingleElimination || params.drawType || DrawTypeEnum.SingleElimination;
23616
+ const seedingPolicy = policyDefinitions?.[POLICY_TYPE_SEEDING] ?? appliedPolicies?.[POLICY_TYPE_SEEDING];
23617
+ const seedingProfile = params.seedingProfile ?? seedingPolicy?.seedingProfile?.drawTypes?.[drawType] ?? seedingPolicy?.seedingProfile;
23618
+ if (params.seedingProfile) {
23619
+ if (!policyDefinitions[POLICY_TYPE_SEEDING]) {
23620
+ policyDefinitions[POLICY_TYPE_SEEDING] = {
23621
+ ...POLICY_SEEDING_USTA[POLICY_TYPE_SEEDING]
23622
+ };
23623
+ }
23624
+ policyDefinitions[POLICY_TYPE_SEEDING].seedingProfile = seedingProfile;
23625
+ }
23611
23626
  const { participants, participantMap } = getParticipants({
23612
23627
  withIndividualParticipants: true,
23613
23628
  tournamentRecord
@@ -23740,7 +23755,7 @@ function generateDrawDefinition(params) {
23740
23755
  }
23741
23756
  }
23742
23757
  }
23743
- if (!appliedPolicies[POLICY_TYPE_SEEDING]) {
23758
+ if (!appliedPolicies[POLICY_TYPE_SEEDING] && !policyDefinitions[POLICY_TYPE_SEEDING]) {
23744
23759
  attachPolicies({ drawDefinition, policyDefinitions: POLICY_SEEDING_USTA });
23745
23760
  Object.assign(appliedPolicies, POLICY_SEEDING_USTA);
23746
23761
  }