tods-competition-factory 0.83.3 → 0.85.1
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.
- package/dist/tods-competition-factory.development.cjs.js +298 -94
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/dist/tods-competition-factory.production.esm.min.js +1 -1
- package/dist/tods-competition-factory.production.esm.min.js.map +1 -1
- package/package.json +3 -2
|
@@ -249,7 +249,7 @@ const matchUpFormatCode = {
|
|
|
249
249
|
};
|
|
250
250
|
|
|
251
251
|
function factoryVersion() {
|
|
252
|
-
return '0.
|
|
252
|
+
return '0.85.1';
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
const FORMAT_STANDARD = 'SET3-S:6/TB7'; // Best of 3 Tiebreak Sets to 6
|
|
@@ -7381,7 +7381,7 @@ const countries = [{
|
|
|
7381
7381
|
phone: '263'
|
|
7382
7382
|
}];
|
|
7383
7383
|
|
|
7384
|
-
var collectionDefinitions$
|
|
7384
|
+
var collectionDefinitions$9 = [
|
|
7385
7385
|
{
|
|
7386
7386
|
collectionName: "Doubles",
|
|
7387
7387
|
matchUpCount: 3,
|
|
@@ -7397,17 +7397,17 @@ var collectionDefinitions$5 = [
|
|
|
7397
7397
|
matchUpValue: 1
|
|
7398
7398
|
}
|
|
7399
7399
|
];
|
|
7400
|
-
var tieFormatName$
|
|
7401
|
-
var winCriteria$
|
|
7400
|
+
var tieFormatName$8 = "COLLEGE_D3";
|
|
7401
|
+
var winCriteria$9 = {
|
|
7402
7402
|
valueGoal: 5
|
|
7403
7403
|
};
|
|
7404
7404
|
var COLLEGE_D3$1 = {
|
|
7405
|
-
collectionDefinitions: collectionDefinitions$
|
|
7406
|
-
tieFormatName: tieFormatName$
|
|
7407
|
-
winCriteria: winCriteria$
|
|
7405
|
+
collectionDefinitions: collectionDefinitions$9,
|
|
7406
|
+
tieFormatName: tieFormatName$8,
|
|
7407
|
+
winCriteria: winCriteria$9
|
|
7408
7408
|
};
|
|
7409
7409
|
|
|
7410
|
-
var collectionDefinitions$
|
|
7410
|
+
var collectionDefinitions$8 = [
|
|
7411
7411
|
{
|
|
7412
7412
|
collectionName: "Doubles",
|
|
7413
7413
|
collectionValue: 1,
|
|
@@ -7423,17 +7423,17 @@ var collectionDefinitions$4 = [
|
|
|
7423
7423
|
matchUpValue: 1
|
|
7424
7424
|
}
|
|
7425
7425
|
];
|
|
7426
|
-
var tieFormatName$
|
|
7427
|
-
var winCriteria$
|
|
7426
|
+
var tieFormatName$7 = "COLLEGE_DEFAULT";
|
|
7427
|
+
var winCriteria$8 = {
|
|
7428
7428
|
valueGoal: 5
|
|
7429
7429
|
};
|
|
7430
7430
|
var COLLEGE_DEFAULT$1 = {
|
|
7431
|
-
collectionDefinitions: collectionDefinitions$
|
|
7432
|
-
tieFormatName: tieFormatName$
|
|
7433
|
-
winCriteria: winCriteria$
|
|
7431
|
+
collectionDefinitions: collectionDefinitions$8,
|
|
7432
|
+
tieFormatName: tieFormatName$7,
|
|
7433
|
+
winCriteria: winCriteria$8
|
|
7434
7434
|
};
|
|
7435
7435
|
|
|
7436
|
-
var collectionDefinitions$
|
|
7436
|
+
var collectionDefinitions$7 = [
|
|
7437
7437
|
{
|
|
7438
7438
|
collectionName: "Doubles",
|
|
7439
7439
|
matchUpCount: 3,
|
|
@@ -7449,17 +7449,17 @@ var collectionDefinitions$3 = [
|
|
|
7449
7449
|
matchUpValue: 1
|
|
7450
7450
|
}
|
|
7451
7451
|
];
|
|
7452
|
-
var tieFormatName$
|
|
7453
|
-
var winCriteria$
|
|
7452
|
+
var tieFormatName$6 = "COLLEGE_JUCO";
|
|
7453
|
+
var winCriteria$7 = {
|
|
7454
7454
|
valueGoal: 5
|
|
7455
7455
|
};
|
|
7456
7456
|
var COLLEGE_JUCO$1 = {
|
|
7457
|
-
collectionDefinitions: collectionDefinitions$
|
|
7458
|
-
tieFormatName: tieFormatName$
|
|
7459
|
-
winCriteria: winCriteria$
|
|
7457
|
+
collectionDefinitions: collectionDefinitions$7,
|
|
7458
|
+
tieFormatName: tieFormatName$6,
|
|
7459
|
+
winCriteria: winCriteria$7
|
|
7460
7460
|
};
|
|
7461
7461
|
|
|
7462
|
-
var collectionDefinitions$
|
|
7462
|
+
var collectionDefinitions$6 = [
|
|
7463
7463
|
{
|
|
7464
7464
|
collectionName: "Doubles",
|
|
7465
7465
|
matchUpCount: 1,
|
|
@@ -7475,20 +7475,20 @@ var collectionDefinitions$2 = [
|
|
|
7475
7475
|
matchUpValue: 1
|
|
7476
7476
|
}
|
|
7477
7477
|
];
|
|
7478
|
-
var tieFormatName$
|
|
7479
|
-
var winCriteria$
|
|
7478
|
+
var tieFormatName$5 = "DOMINANT_DUO";
|
|
7479
|
+
var winCriteria$6 = {
|
|
7480
7480
|
valueGoal: 2
|
|
7481
7481
|
};
|
|
7482
7482
|
var DOMINANT_DUO_TIE_FORMAT = {
|
|
7483
|
-
collectionDefinitions: collectionDefinitions$
|
|
7484
|
-
tieFormatName: tieFormatName$
|
|
7485
|
-
winCriteria: winCriteria$
|
|
7483
|
+
collectionDefinitions: collectionDefinitions$6,
|
|
7484
|
+
tieFormatName: tieFormatName$5,
|
|
7485
|
+
winCriteria: winCriteria$6
|
|
7486
7486
|
};
|
|
7487
7487
|
|
|
7488
|
-
var winCriteria$
|
|
7488
|
+
var winCriteria$5 = {
|
|
7489
7489
|
valueGoal: 13
|
|
7490
7490
|
};
|
|
7491
|
-
var collectionDefinitions$
|
|
7491
|
+
var collectionDefinitions$5 = [
|
|
7492
7492
|
{
|
|
7493
7493
|
collectionGroupNumber: 1,
|
|
7494
7494
|
matchUpType: "DOUBLES",
|
|
@@ -7547,12 +7547,12 @@ var collectionGroups = [
|
|
|
7547
7547
|
}
|
|
7548
7548
|
];
|
|
7549
7549
|
var LAVER_CUP_TIE_FORMAT = {
|
|
7550
|
-
winCriteria: winCriteria$
|
|
7551
|
-
collectionDefinitions: collectionDefinitions$
|
|
7550
|
+
winCriteria: winCriteria$5,
|
|
7551
|
+
collectionDefinitions: collectionDefinitions$5,
|
|
7552
7552
|
collectionGroups: collectionGroups
|
|
7553
7553
|
};
|
|
7554
7554
|
|
|
7555
|
-
var collectionDefinitions = [
|
|
7555
|
+
var collectionDefinitions$4 = [
|
|
7556
7556
|
{
|
|
7557
7557
|
collectionName: "Round 1",
|
|
7558
7558
|
matchUpCount: 3,
|
|
@@ -7575,15 +7575,182 @@ var collectionDefinitions = [
|
|
|
7575
7575
|
scoreValue: 1
|
|
7576
7576
|
}
|
|
7577
7577
|
];
|
|
7578
|
-
var tieFormatName = "Doubles Shuffle";
|
|
7578
|
+
var tieFormatName$4 = "Doubles Shuffle";
|
|
7579
7579
|
var unrestrictedSelections = true;
|
|
7580
|
-
var winCriteria = {
|
|
7580
|
+
var winCriteria$4 = {
|
|
7581
7581
|
aggregateValue: true
|
|
7582
7582
|
};
|
|
7583
7583
|
var TEAM_AGGREGATION_TIE_FORMAT = {
|
|
7584
|
+
collectionDefinitions: collectionDefinitions$4,
|
|
7585
|
+
tieFormatName: tieFormatName$4,
|
|
7586
|
+
unrestrictedSelections: unrestrictedSelections,
|
|
7587
|
+
winCriteria: winCriteria$4
|
|
7588
|
+
};
|
|
7589
|
+
|
|
7590
|
+
var collectionDefinitions$3 = [
|
|
7591
|
+
{
|
|
7592
|
+
collectionName: "Boys Singles",
|
|
7593
|
+
matchUpCount: 6,
|
|
7594
|
+
matchUpFormat: "SET3-S:6/TB7-F:TB10",
|
|
7595
|
+
matchUpType: "SINGLES",
|
|
7596
|
+
matchUpValue: 1
|
|
7597
|
+
},
|
|
7598
|
+
{
|
|
7599
|
+
collectionName: "Girls Singles",
|
|
7600
|
+
matchUpCount: 6,
|
|
7601
|
+
matchUpFormat: "SET3-S:6/TB7-F:TB10",
|
|
7602
|
+
matchUpType: "SINGLES",
|
|
7603
|
+
matchUpValue: 1
|
|
7604
|
+
},
|
|
7605
|
+
{
|
|
7606
|
+
collectionName: "Boys Doubles",
|
|
7607
|
+
matchUpCount: 1,
|
|
7608
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7609
|
+
matchUpType: "DOUBLES",
|
|
7610
|
+
matchUpValue: 1
|
|
7611
|
+
},
|
|
7612
|
+
{
|
|
7613
|
+
collectionName: "Girls Doubles",
|
|
7614
|
+
matchUpCount: 1,
|
|
7615
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7616
|
+
matchUpType: "DOUBLES",
|
|
7617
|
+
matchUpValue: 1
|
|
7618
|
+
},
|
|
7619
|
+
{
|
|
7620
|
+
collectionName: "Mixed Doubles",
|
|
7621
|
+
matchUpCount: 1,
|
|
7622
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7623
|
+
matchUpType: "DOUBLES",
|
|
7624
|
+
matchUpValue: 1
|
|
7625
|
+
}
|
|
7626
|
+
];
|
|
7627
|
+
var tieFormatName$3 = "USTA_INTERSECTIONAL";
|
|
7628
|
+
var winCriteria$3 = {
|
|
7629
|
+
valueGoal: 8
|
|
7630
|
+
};
|
|
7631
|
+
var USTA_INTERSECTIONAL$1 = {
|
|
7632
|
+
collectionDefinitions: collectionDefinitions$3,
|
|
7633
|
+
tieFormatName: tieFormatName$3,
|
|
7634
|
+
winCriteria: winCriteria$3
|
|
7635
|
+
};
|
|
7636
|
+
|
|
7637
|
+
var collectionDefinitions$2 = [
|
|
7638
|
+
{
|
|
7639
|
+
collectionName: "Boys Singles",
|
|
7640
|
+
matchUpCount: 6,
|
|
7641
|
+
matchUpFormat: "SET3-S:6/TB7",
|
|
7642
|
+
matchUpType: "SINGLES",
|
|
7643
|
+
matchUpValue: 1
|
|
7644
|
+
},
|
|
7645
|
+
{
|
|
7646
|
+
collectionName: "Girls Singles",
|
|
7647
|
+
matchUpCount: 6,
|
|
7648
|
+
matchUpFormat: "SET3-S:6/TB7",
|
|
7649
|
+
matchUpType: "SINGLES",
|
|
7650
|
+
matchUpValue: 1
|
|
7651
|
+
},
|
|
7652
|
+
{
|
|
7653
|
+
collectionName: "Boys Doubles",
|
|
7654
|
+
matchUpCount: 3,
|
|
7655
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7656
|
+
matchUpType: "DOUBLES",
|
|
7657
|
+
matchUpValue: 1
|
|
7658
|
+
},
|
|
7659
|
+
{
|
|
7660
|
+
collectionName: "Girls Doubles",
|
|
7661
|
+
matchUpCount: 3,
|
|
7662
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7663
|
+
matchUpType: "DOUBLES",
|
|
7664
|
+
matchUpValue: 1
|
|
7665
|
+
}
|
|
7666
|
+
];
|
|
7667
|
+
var tieFormatName$2 = "USTA_LEVEL_1";
|
|
7668
|
+
var winCriteria$2 = {
|
|
7669
|
+
valueGoal: 10
|
|
7670
|
+
};
|
|
7671
|
+
var USTA_LEVEL_1$1 = {
|
|
7672
|
+
collectionDefinitions: collectionDefinitions$2,
|
|
7673
|
+
tieFormatName: tieFormatName$2,
|
|
7674
|
+
winCriteria: winCriteria$2
|
|
7675
|
+
};
|
|
7676
|
+
|
|
7677
|
+
var collectionDefinitions$1 = [
|
|
7678
|
+
{
|
|
7679
|
+
collectionName: "Boys Singles",
|
|
7680
|
+
matchUpCount: 6,
|
|
7681
|
+
matchUpFormat: "SET3-S:6/TB7-F:TB10",
|
|
7682
|
+
matchUpType: "SINGLES",
|
|
7683
|
+
matchUpValue: 1
|
|
7684
|
+
},
|
|
7685
|
+
{
|
|
7686
|
+
collectionName: "Girls Singles",
|
|
7687
|
+
matchUpCount: 6,
|
|
7688
|
+
matchUpFormat: "SET3-S:6/TB7-F:TB10",
|
|
7689
|
+
matchUpType: "SINGLES",
|
|
7690
|
+
matchUpValue: 1
|
|
7691
|
+
},
|
|
7692
|
+
{
|
|
7693
|
+
collectionName: "Mixed Doubles",
|
|
7694
|
+
matchUpCount: 3,
|
|
7695
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7696
|
+
matchUpType: "DOUBLES",
|
|
7697
|
+
matchUpValue: 1
|
|
7698
|
+
}
|
|
7699
|
+
];
|
|
7700
|
+
var tieFormatName$1 = "USTA_SOUTHERN_LEVEL_5";
|
|
7701
|
+
var winCriteria$1 = {
|
|
7702
|
+
valueGoal: 8
|
|
7703
|
+
};
|
|
7704
|
+
var USTA_SOUTHERN_LEVEL_5$1 = {
|
|
7705
|
+
collectionDefinitions: collectionDefinitions$1,
|
|
7706
|
+
tieFormatName: tieFormatName$1,
|
|
7707
|
+
winCriteria: winCriteria$1
|
|
7708
|
+
};
|
|
7709
|
+
|
|
7710
|
+
var collectionDefinitions = [
|
|
7711
|
+
{
|
|
7712
|
+
collectionName: "Boys Singles",
|
|
7713
|
+
matchUpCount: 6,
|
|
7714
|
+
matchUpFormat: "SET3-S:6/TB7-F:TB10",
|
|
7715
|
+
matchUpType: "SINGLES",
|
|
7716
|
+
matchUpValue: 1
|
|
7717
|
+
},
|
|
7718
|
+
{
|
|
7719
|
+
collectionName: "Girls Singles",
|
|
7720
|
+
matchUpCount: 6,
|
|
7721
|
+
matchUpFormat: "SET3-S:6/TB7-F:TB10",
|
|
7722
|
+
matchUpType: "SINGLES",
|
|
7723
|
+
matchUpValue: 1
|
|
7724
|
+
},
|
|
7725
|
+
{
|
|
7726
|
+
collectionName: "Boys Doubles",
|
|
7727
|
+
matchUpCount: 3,
|
|
7728
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7729
|
+
matchUpType: "DOUBLES",
|
|
7730
|
+
matchUpValue: 1
|
|
7731
|
+
},
|
|
7732
|
+
{
|
|
7733
|
+
collectionName: "Girls Doubles",
|
|
7734
|
+
matchUpCount: 3,
|
|
7735
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7736
|
+
matchUpType: "DOUBLES",
|
|
7737
|
+
matchUpValue: 1
|
|
7738
|
+
},
|
|
7739
|
+
{
|
|
7740
|
+
collectionName: "Mixed Doubles",
|
|
7741
|
+
matchUpCount: 1,
|
|
7742
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7743
|
+
matchUpType: "DOUBLES",
|
|
7744
|
+
matchUpValue: 1
|
|
7745
|
+
}
|
|
7746
|
+
];
|
|
7747
|
+
var tieFormatName = "USTA_ZONAL";
|
|
7748
|
+
var winCriteria = {
|
|
7749
|
+
valueGoal: 10
|
|
7750
|
+
};
|
|
7751
|
+
var USTA_ZONAL$1 = {
|
|
7584
7752
|
collectionDefinitions: collectionDefinitions,
|
|
7585
7753
|
tieFormatName: tieFormatName,
|
|
7586
|
-
unrestrictedSelections: unrestrictedSelections,
|
|
7587
7754
|
winCriteria: winCriteria
|
|
7588
7755
|
};
|
|
7589
7756
|
|
|
@@ -7593,7 +7760,11 @@ const tieFormats = {
|
|
|
7593
7760
|
COLLEGE_JUCO: COLLEGE_JUCO$1,
|
|
7594
7761
|
DOMINANT_DUO: DOMINANT_DUO_TIE_FORMAT,
|
|
7595
7762
|
LAVER_CUP: LAVER_CUP_TIE_FORMAT,
|
|
7596
|
-
TEAM_DOUBLES_3_AGGREGATION: TEAM_AGGREGATION_TIE_FORMAT
|
|
7763
|
+
TEAM_DOUBLES_3_AGGREGATION: TEAM_AGGREGATION_TIE_FORMAT,
|
|
7764
|
+
USTA_INTERSECTIONAL: USTA_INTERSECTIONAL$1,
|
|
7765
|
+
USTA_LEVEL_1: USTA_LEVEL_1$1,
|
|
7766
|
+
USTA_SOUTHERN_LEVEL_5: USTA_SOUTHERN_LEVEL_5$1,
|
|
7767
|
+
USTA_ZONAL: USTA_ZONAL$1
|
|
7597
7768
|
};
|
|
7598
7769
|
|
|
7599
7770
|
const POLICY_AVOIDANCE_COUNTRY = {
|
|
@@ -8424,6 +8595,15 @@ const fixtures = {
|
|
|
8424
8595
|
flagIOC
|
|
8425
8596
|
};
|
|
8426
8597
|
|
|
8598
|
+
function getCourtDateAvailability({
|
|
8599
|
+
court,
|
|
8600
|
+
date
|
|
8601
|
+
}) {
|
|
8602
|
+
const targetDateAvailability = date && court.dateAvailability.find(availability => sameDay(availability.date, date));
|
|
8603
|
+
const defaultAvailability = court.dateAvailability.find(availability => !availability.date);
|
|
8604
|
+
return targetDateAvailability || defaultAvailability;
|
|
8605
|
+
}
|
|
8606
|
+
|
|
8427
8607
|
/**
|
|
8428
8608
|
*
|
|
8429
8609
|
* @param {object} courtDate - object containing court details for a specific date { date, startTime, endTime, bookings }
|
|
@@ -8463,16 +8643,13 @@ function generateTimeSlots({
|
|
|
8463
8643
|
return timeSlots;
|
|
8464
8644
|
}
|
|
8465
8645
|
|
|
8466
|
-
function
|
|
8646
|
+
function getEnoughTime({
|
|
8467
8647
|
includeBookingTypes,
|
|
8468
8648
|
averageMatchUpMinutes,
|
|
8469
8649
|
periodStartTime,
|
|
8470
8650
|
periodEndTime,
|
|
8471
|
-
periodLength
|
|
8472
|
-
date
|
|
8651
|
+
periodLength
|
|
8473
8652
|
}) {
|
|
8474
|
-
const sameDate = courtDate => !courtDate.date || sameDay(courtDate.date, date);
|
|
8475
|
-
|
|
8476
8653
|
const enoughTime = courtDate => {
|
|
8477
8654
|
const timeSlots = generateTimeSlots({
|
|
8478
8655
|
courtDate,
|
|
@@ -8494,7 +8671,6 @@ function getCourtDateFilters({
|
|
|
8494
8671
|
}
|
|
8495
8672
|
|
|
8496
8673
|
return {
|
|
8497
|
-
sameDate,
|
|
8498
8674
|
enoughTime
|
|
8499
8675
|
};
|
|
8500
8676
|
}
|
|
@@ -8510,19 +8686,21 @@ function getCourtsAvailableAtPeriodStart({
|
|
|
8510
8686
|
const periodStartTime = timeToDate(periodStart);
|
|
8511
8687
|
const periodEndTime = addMinutes(periodStartTime, averageMatchUpMinutes);
|
|
8512
8688
|
const {
|
|
8513
|
-
sameDate,
|
|
8514
8689
|
enoughTime
|
|
8515
|
-
} =
|
|
8690
|
+
} = getEnoughTime({
|
|
8516
8691
|
includeBookingTypes,
|
|
8517
8692
|
averageMatchUpMinutes,
|
|
8518
8693
|
periodStartTime,
|
|
8519
8694
|
periodEndTime,
|
|
8520
|
-
periodLength
|
|
8521
|
-
date
|
|
8695
|
+
periodLength
|
|
8522
8696
|
});
|
|
8523
8697
|
const availableCourts = courts.filter(court => {
|
|
8524
|
-
|
|
8525
|
-
|
|
8698
|
+
if (!Array.isArray(court.dateAvailability)) return false;
|
|
8699
|
+
const courtDate = getCourtDateAvailability({
|
|
8700
|
+
date,
|
|
8701
|
+
court
|
|
8702
|
+
});
|
|
8703
|
+
return !!(courtDate && enoughTime(courtDate));
|
|
8526
8704
|
});
|
|
8527
8705
|
return {
|
|
8528
8706
|
availableToScheduleCount: availableCourts.length
|
|
@@ -8579,23 +8757,21 @@ function generateVirtualCourts({
|
|
|
8579
8757
|
courtBookings: {},
|
|
8580
8758
|
unassignedBookings: []
|
|
8581
8759
|
});
|
|
8582
|
-
const {
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
});
|
|
8587
|
-
const inProcessCourts = courts.map(({
|
|
8588
|
-
courtId,
|
|
8589
|
-
dateAvailability
|
|
8590
|
-
}, index) => {
|
|
8760
|
+
const inProcessCourts = courts.map((court, index) => {
|
|
8761
|
+
const {
|
|
8762
|
+
courtId
|
|
8763
|
+
} = court;
|
|
8591
8764
|
const bookingsThisCourt = courtBookings[courtId] || [];
|
|
8592
|
-
const
|
|
8765
|
+
const availability = getCourtDateAvailability({
|
|
8766
|
+
date: scheduleDate,
|
|
8767
|
+
court
|
|
8768
|
+
}) || {};
|
|
8593
8769
|
const {
|
|
8594
8770
|
date,
|
|
8595
8771
|
startTime,
|
|
8596
8772
|
endTime,
|
|
8597
8773
|
bookings: existingBookings = []
|
|
8598
|
-
} =
|
|
8774
|
+
} = availability;
|
|
8599
8775
|
const allocatedTimeBooking = remainingScheduleTimes[index] && {
|
|
8600
8776
|
startTime,
|
|
8601
8777
|
endTime: remainingScheduleTimes[index]
|
|
@@ -8696,44 +8872,41 @@ function getFirstTimeSlotStartTime({
|
|
|
8696
8872
|
courts,
|
|
8697
8873
|
date
|
|
8698
8874
|
}) {
|
|
8699
|
-
|
|
8700
|
-
sameDate
|
|
8701
|
-
} = getCourtDateFilters({
|
|
8702
|
-
date
|
|
8703
|
-
}); // find the first timeSlot across all courts between startTime and endTime that can accommodate averageMatchUpMinutes
|
|
8704
|
-
|
|
8875
|
+
// find the first timeSlot across all courts between startTime and endTime that can accommodate averageMatchUpMinutes
|
|
8705
8876
|
let firstTimeSlotStartTime;
|
|
8706
8877
|
|
|
8707
8878
|
if (startTime && endTime) {
|
|
8708
8879
|
const dateStartTime = timeToDate(startTime);
|
|
8709
8880
|
const dateEndTime = timeToDate(endTime);
|
|
8710
|
-
|
|
8881
|
+
|
|
8882
|
+
for (const court of courts) {
|
|
8711
8883
|
if (!Array.isArray(court.dateAvailability)) return false;
|
|
8712
|
-
const
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8884
|
+
const courtDate = getCourtDateAvailability({
|
|
8885
|
+
court,
|
|
8886
|
+
date
|
|
8887
|
+
});
|
|
8888
|
+
const timeSlots = generateTimeSlots({
|
|
8889
|
+
courtDate
|
|
8890
|
+
});
|
|
8891
|
+
timeSlots.find(timeSlot => {
|
|
8892
|
+
const timeSlotStartTime = timeToDate(timeSlot.startTime);
|
|
8893
|
+
const timeSlotEndTime = timeToDate(timeSlot.endTime);
|
|
8894
|
+
if (timeSlotStartTime > dateEndTime || timeSlotStartTime < dateStartTime) return false;
|
|
8895
|
+
if (timeSlotEndTime < dateStartTime) return false;
|
|
8896
|
+
const timeSlotMinutes = minutesDifference(timeSlotStartTime, timeSlotEndTime);
|
|
8897
|
+
const available = timeSlotMinutes >= averageMinutes;
|
|
8898
|
+
|
|
8899
|
+
if (available) {
|
|
8900
|
+
const timeString = extractTime(timeSlotStartTime.toISOString());
|
|
8901
|
+
|
|
8902
|
+
if (!firstTimeSlotStartTime || timeString < firstTimeSlotStartTime) {
|
|
8903
|
+
firstTimeSlotStartTime = timeString;
|
|
8731
8904
|
}
|
|
8905
|
+
}
|
|
8732
8906
|
|
|
8733
|
-
|
|
8734
|
-
});
|
|
8907
|
+
return available;
|
|
8735
8908
|
});
|
|
8736
|
-
}
|
|
8909
|
+
}
|
|
8737
8910
|
}
|
|
8738
8911
|
|
|
8739
8912
|
return {
|
|
@@ -21371,9 +21544,13 @@ function addCourts$1({
|
|
|
21371
21544
|
dateAvailability = [],
|
|
21372
21545
|
tournamentRecord,
|
|
21373
21546
|
courtNames = [],
|
|
21547
|
+
courtTimings,
|
|
21374
21548
|
courtsCount,
|
|
21549
|
+
startTime,
|
|
21375
21550
|
courtIds,
|
|
21376
|
-
|
|
21551
|
+
endTime,
|
|
21552
|
+
venueId,
|
|
21553
|
+
dates
|
|
21377
21554
|
}) {
|
|
21378
21555
|
if (!venueId) return {
|
|
21379
21556
|
error: MISSING_VENUE_ID
|
|
@@ -21383,9 +21560,21 @@ function addCourts$1({
|
|
|
21383
21560
|
};
|
|
21384
21561
|
courtsCount = courtsCount || courtNames.length;
|
|
21385
21562
|
const courts = generateRange(0, courtsCount).map(i => {
|
|
21563
|
+
const courtTiming = courtTimings === null || courtTimings === void 0 ? void 0 : courtTimings[i];
|
|
21564
|
+
const courtAvailability = courtTiming ? dates.map(date => ({
|
|
21565
|
+
date: formatDate(date),
|
|
21566
|
+
startTime,
|
|
21567
|
+
endTime,
|
|
21568
|
+
...courtTiming
|
|
21569
|
+
})) : dateAvailability; // when courtTiming is provided, also add default availability
|
|
21570
|
+
|
|
21571
|
+
if (courtTiming && startTime && endTime) courtAvailability.push({
|
|
21572
|
+
startTime,
|
|
21573
|
+
endTime
|
|
21574
|
+
});
|
|
21386
21575
|
const court = {
|
|
21387
21576
|
courtName: courtNames[i] || `Court ${i + 1}`,
|
|
21388
|
-
dateAvailability
|
|
21577
|
+
dateAvailability: courtAvailability
|
|
21389
21578
|
};
|
|
21390
21579
|
return court;
|
|
21391
21580
|
});
|
|
@@ -23416,7 +23605,9 @@ function getTournamentParticipants({
|
|
|
23416
23605
|
if (!tournamentRecord.participants) return {
|
|
23417
23606
|
error: MISSING_PARTICIPANTS
|
|
23418
23607
|
};
|
|
23419
|
-
let tournamentParticipants = tournamentRecord.participants.map(participant => makeDeepCopy(participant, convertExtensions, true)
|
|
23608
|
+
let tournamentParticipants = tournamentRecord.participants.map( // (participant) => makeDeepCopy(participant, convertExtensions, true)
|
|
23609
|
+
participant => makeDeepCopy(participant, convertExtensions) // removed until Mongo/Mongoose issues resolved
|
|
23610
|
+
);
|
|
23420
23611
|
if (typeof participantFilters !== 'object') return {
|
|
23421
23612
|
error: INVALID_OBJECT,
|
|
23422
23613
|
participantFilters
|
|
@@ -43196,8 +43387,8 @@ function checkValidEntries({
|
|
|
43196
43387
|
const enteredParticipants = participants.filter(participant => enteredParticipantIds.includes(participant.participantId));
|
|
43197
43388
|
const invalidEntries = enteredParticipants.filter(participant => {
|
|
43198
43389
|
const entryStatus = entryStatusMap[participant.participantId];
|
|
43199
|
-
const
|
|
43200
|
-
const mismatch = participant.participantType !== participantType && !
|
|
43390
|
+
const ungroupedParticipant = [DOUBLES$1, TEAM$3].includes(eventType) && participant.participantType === INDIVIDUAL$1 && (isUngrouped(entryStatus) || entryStatus === WITHDRAWN);
|
|
43391
|
+
const mismatch = participant.participantType !== participantType && !ungroupedParticipant; // TODO: implement gender checking for teams & pairs
|
|
43201
43392
|
|
|
43202
43393
|
const wrongGender = !ignoreGender && eventType === INDIVIDUAL$1 && [MALE, FEMALE].includes(eventGender) && participant.sex !== eventGender;
|
|
43203
43394
|
return mismatch || wrongGender;
|
|
@@ -43453,13 +43644,21 @@ const COLLEGE_D3 = 'COLLEGE_D3';
|
|
|
43453
43644
|
const DOMINANT_DUO = 'DOMINANT_DUO';
|
|
43454
43645
|
const LAVER_CUP = 'LAVER_CUP';
|
|
43455
43646
|
const TEAM_DOUBLES_3_AGGREGATION = 'TEAM_DOUBLES_3_AGGREGATION';
|
|
43647
|
+
const USTA_LEVEL_1 = 'USTA_LEVEL_1';
|
|
43648
|
+
const USTA_ZONAL = 'USTA_ZONAL';
|
|
43649
|
+
const USTA_INTERSECTIONAL = 'USTA_INTERSECTIONAL';
|
|
43650
|
+
const USTA_SOUTHERN_LEVEL_5 = 'USTA_SOUTHERN_LEVEL_5';
|
|
43456
43651
|
const tieFormatConstants = {
|
|
43457
43652
|
COLLEGE_D3,
|
|
43458
43653
|
COLLEGE_DEFAULT,
|
|
43459
43654
|
COLLEGE_JUCO,
|
|
43460
43655
|
DOMINANT_DUO,
|
|
43461
43656
|
LAVER_CUP,
|
|
43462
|
-
TEAM_DOUBLES_3_AGGREGATION
|
|
43657
|
+
TEAM_DOUBLES_3_AGGREGATION,
|
|
43658
|
+
USTA_LEVEL_1,
|
|
43659
|
+
USTA_ZONAL,
|
|
43660
|
+
USTA_INTERSECTIONAL,
|
|
43661
|
+
USTA_SOUTHERN_LEVEL_5
|
|
43463
43662
|
};
|
|
43464
43663
|
|
|
43465
43664
|
const namedFormats = {
|
|
@@ -52788,6 +52987,7 @@ function generateVenues({
|
|
|
52788
52987
|
dateAvailability,
|
|
52789
52988
|
startTime = '07:00',
|
|
52790
52989
|
endTime = '19:00',
|
|
52990
|
+
courtTimings,
|
|
52791
52991
|
courtsCount,
|
|
52792
52992
|
courtNames,
|
|
52793
52993
|
venueName,
|
|
@@ -52813,10 +53013,14 @@ function generateVenues({
|
|
|
52813
53013
|
result = addCourts$1({
|
|
52814
53014
|
tournamentRecord,
|
|
52815
53015
|
dateAvailability,
|
|
53016
|
+
courtTimings,
|
|
52816
53017
|
courtsCount,
|
|
52817
53018
|
courtNames,
|
|
53019
|
+
startTime,
|
|
52818
53020
|
courtIds,
|
|
52819
|
-
|
|
53021
|
+
endTime,
|
|
53022
|
+
venueId,
|
|
53023
|
+
dates
|
|
52820
53024
|
});
|
|
52821
53025
|
if (result.error) return result;
|
|
52822
53026
|
}
|
|
@@ -53114,7 +53318,7 @@ function generateSchedulingProfile({
|
|
|
53114
53318
|
|
|
53115
53319
|
const targetRange = (winnerFinishingPositionRange === null || winnerFinishingPositionRange === void 0 ? void 0 : winnerFinishingPositionRange.indexOf('-')) > 0 && winnerFinishingPositionRange.split('-').map(x => +x);
|
|
53116
53320
|
const range = (_matchUp$finishingPos = matchUp.finishingPositionRange) === null || _matchUp$finishingPos === void 0 ? void 0 : _matchUp$finishingPos.winner;
|
|
53117
|
-
const target = matchUp.drawId === drawId && (!round.roundNumber || matchUp.roundNumber === round.roundNumber) && (!range || !targetRange || intersection(range, targetRange).length === 2);
|
|
53321
|
+
const target = matchUp.drawId === drawId && (!round.roundNumber || matchUp.roundNumber === round.roundNumber) && (!range || !targetRange || intersection(range, targetRange).length === 2 || unique(range).length === unique(targetRange).length && intersection(range, targetRange).length === unique(range).length);
|
|
53118
53322
|
return target;
|
|
53119
53323
|
});
|
|
53120
53324
|
const targetMatchUp = targetMatchUps[0];
|