tods-competition-factory 2.1.14 → 2.1.16

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.14';
6
+ return '2.1.16';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -9652,11 +9652,14 @@ function getCourtInfo({ tournamentRecord, internalUse, courtId }) {
9652
9652
  return { ...SUCCESS, courtInfo: makeDeepCopy(courtInfo, false, internalUse) };
9653
9653
  }
9654
9654
 
9655
- function getVenueData({ tournamentRecord, venueId }) {
9656
- if (!tournamentRecord)
9657
- return { error: MISSING_TOURNAMENT_RECORD };
9658
- if (!venueId)
9659
- return { error: MISSING_VENUE_ID };
9655
+ function getVenueData(params) {
9656
+ const paramsCheck = checkRequiredParameters(params, [
9657
+ { [TOURNAMENT_RECORD]: true },
9658
+ { venueId: true, [ERROR]: MISSING_VENUE_ID },
9659
+ ]);
9660
+ if (paramsCheck.error)
9661
+ return paramsCheck;
9662
+ const { tournamentRecord, venueId } = params;
9660
9663
  const result = findVenue({ tournamentRecord, venueId });
9661
9664
  if (result.error)
9662
9665
  return result;
@@ -12224,13 +12227,10 @@ function pushGlobalLog(value, devContextOverride) {
12224
12227
  }
12225
12228
  function getGlobalLog(purge) {
12226
12229
  const globalLogCopy = globalLog.slice();
12227
- if (purge) {
12228
- globalLog.length = 0;
12229
- }
12230
12230
  return globalLogCopy;
12231
12231
  }
12232
12232
  function printGlobalLog(purge) {
12233
- const globalLogCopy = getGlobalLog(purge);
12233
+ const globalLogCopy = getGlobalLog();
12234
12234
  const modifiedText = globalLogCopy.map((line) => {
12235
12235
  const { color, keyColors, method, newline } = line;
12236
12236
  const methodColor = Object.keys(logColors).includes(color) ? logColors[color] : logColors.cyan;
@@ -35023,13 +35023,12 @@ function getEventData(params) {
35023
35023
  })
35024
35024
  .filter((drawData) => drawData.structures?.length)
35025
35025
  : undefined;
35026
- const { tournamentInfo } = getTournamentInfo({ tournamentRecord });
35027
- const venues = tournamentRecord.venues || [];
35026
+ const venues = Array.isArray(tournamentRecord.venues) ? tournamentRecord.venues : [];
35028
35027
  const venuesData = venues.map((venue) => (({ venueData }) => ({
35029
35028
  ...venueData,
35030
35029
  }))(getVenueData({
35031
- tournamentRecord,
35032
35030
  venueId: venue.venueId,
35031
+ tournamentRecord,
35033
35032
  })));
35034
35033
  const eventInfo = (({ eventId, eventName, eventType, eventLevel, surfaceCategory, matchUpFormat, category, gender, startDate, endDate, ballType, discipline, }) => ({
35035
35034
  eventId,
@@ -35049,6 +35048,7 @@ function getEventData(params) {
35049
35048
  element: event,
35050
35049
  name: DISPLAY,
35051
35050
  }).extension?.value;
35051
+ const { tournamentInfo } = getTournamentInfo({ tournamentRecord });
35052
35052
  const eventData = {
35053
35053
  tournamentInfo,
35054
35054
  venuesData,
@@ -35073,6 +35073,87 @@ var query$5 = {
35073
35073
  getVenueData: getVenueData
35074
35074
  };
35075
35075
 
35076
+ function processNextMatchUps({ matchUpPotentialParticipantIds, matchUpNotBeforeTimes, timeAfterRecovery, matchUp, }) {
35077
+ const { individualParticipantIds } = getIndividualParticipantIds(matchUp);
35078
+ timeAfterRecovery = timeAfterRecovery ?? matchUp.schedule?.timeAfterRecovery;
35079
+ const addPotentialParticipantIds = (targetMatchUpId) => {
35080
+ if (!matchUpPotentialParticipantIds[targetMatchUpId])
35081
+ matchUpPotentialParticipantIds[targetMatchUpId] = [];
35082
+ matchUpPotentialParticipantIds[targetMatchUpId] = unique(matchUpPotentialParticipantIds[targetMatchUpId].concat(...individualParticipantIds));
35083
+ };
35084
+ const updateNotBeforeTime = (matchUpId) => {
35085
+ if (timeAfterRecovery &&
35086
+ (!matchUpNotBeforeTimes[matchUpId] || timeAfterRecovery > matchUpNotBeforeTimes[matchUpId])) {
35087
+ matchUpNotBeforeTimes[matchUpId] = timeAfterRecovery;
35088
+ }
35089
+ };
35090
+ const winnerMatchUpId = matchUp.winnerTo?.matchUpId || matchUp.winnerMatchUpId;
35091
+ if (winnerMatchUpId) {
35092
+ timeAfterRecovery && updateNotBeforeTime(winnerMatchUpId);
35093
+ addPotentialParticipantIds(winnerMatchUpId);
35094
+ }
35095
+ const loserMatchUpId = matchUp.loserTo?.matchUpId || matchUp.loserMatchUpId;
35096
+ if (loserMatchUpId) {
35097
+ timeAfterRecovery && updateNotBeforeTime(loserMatchUpId);
35098
+ addPotentialParticipantIds(loserMatchUpId);
35099
+ }
35100
+ if (matchUp.sidesTo?.length) {
35101
+ matchUp.sidesTo.forEach(({ matchUpId }) => {
35102
+ if (matchUpId) {
35103
+ timeAfterRecovery && updateNotBeforeTime(matchUpId);
35104
+ addPotentialParticipantIds(matchUpId);
35105
+ }
35106
+ });
35107
+ }
35108
+ }
35109
+
35110
+ function getMatchUpsToSchedule(params) {
35111
+ const paramsCheck = checkRequiredParameters(params, [{ [MATCHUPS]: true }]);
35112
+ if (paramsCheck.error)
35113
+ return paramsCheck;
35114
+ const { matchUpPotentialParticipantIds, scheduleCompletedMatchUps, dateScheduledMatchUpIds, matchUpNotBeforeTimes, matchUpScheduleTimes, orderedMatchUpIds, clearDate, matchUps, } = params;
35115
+ const alreadyScheduledMatchUpIds = Object.keys(matchUpScheduleTimes);
35116
+ const matchUpsToSchedule = (orderedMatchUpIds ?? [])
35117
+ .map((matchUpId) => matchUps.find((matchUp) => matchUp.matchUpId === matchUpId))
35118
+ .filter(Boolean)
35119
+ .filter((matchUp) => {
35120
+ const alreadyScheduled = !clearDate &&
35121
+ (dateScheduledMatchUpIds.includes(matchUp.matchUpId) || alreadyScheduledMatchUpIds.includes(matchUp.matchUpId));
35122
+ const doNotSchedule = [
35123
+ BYE,
35124
+ DEFAULTED,
35125
+ COMPLETED$1,
35126
+ ABANDONED$1,
35127
+ RETIRED$1,
35128
+ WALKOVER$2,
35129
+ DOUBLE_WALKOVER,
35130
+ DOUBLE_DEFAULT,
35131
+ ].includes(matchUp?.matchUpStatus);
35132
+ return (scheduleCompletedMatchUps ||
35133
+ (!alreadyScheduled && !matchUp.winningSide && !doNotSchedule));
35134
+ });
35135
+ const matchUpMap = matchUpPotentialParticipantIds && matchUpNotBeforeTimes
35136
+ ? matchUpsToSchedule.reduce((aggregator, matchUp) => {
35137
+ const { drawId, tournamentId } = matchUp;
35138
+ if (!aggregator.matchUpMap[tournamentId])
35139
+ aggregator.matchUpMap[tournamentId] = {};
35140
+ if (!aggregator.matchUpMap[tournamentId][drawId]) {
35141
+ aggregator.matchUpMap[tournamentId][drawId] = [matchUp];
35142
+ }
35143
+ else {
35144
+ aggregator.matchUpMap[tournamentId][drawId].push(matchUp);
35145
+ }
35146
+ processNextMatchUps({
35147
+ matchUpPotentialParticipantIds,
35148
+ matchUpNotBeforeTimes,
35149
+ matchUp,
35150
+ });
35151
+ return aggregator;
35152
+ }, { matchUpMap: {} }).matchUpMap
35153
+ : {};
35154
+ return { matchUpsToSchedule, matchUpMap };
35155
+ }
35156
+
35076
35157
  function findMatchUpFormatTiming({ defaultRecoveryMinutes = 0, defaultAverageMinutes, tournamentRecords, matchUpFormat, categoryName, categoryType, tournamentId, eventType, eventId, }) {
35077
35158
  if (!isValidMatchUpFormat({ matchUpFormat }))
35078
35159
  return { error: UNRECOGNIZED_MATCHUP_FORMAT };
@@ -35100,23 +35181,27 @@ function findMatchUpFormatTiming({ defaultRecoveryMinutes = 0, defaultAverageMin
35100
35181
  };
35101
35182
  }
35102
35183
 
35103
- function getScheduledRoundsDetails({ scheduleCompletedMatchUps, containedStructureIds, tournamentRecords, periodLength = 30, matchUps, rounds, }) {
35184
+ function getScheduledRoundsDetails(params) {
35185
+ const paramsCheck = checkRequiredParameters(params, [
35186
+ { [ANY_OF]: { tournamentRecords: false, tournamentRecord: false } },
35187
+ { rounds: true, [OF_TYPE]: ARRAY },
35188
+ ]);
35189
+ if (paramsCheck.error)
35190
+ return paramsCheck;
35191
+ const { scheduleCompletedMatchUps, periodLength = 30 } = params;
35192
+ const tournamentRecords = params.tournamentRecords ||
35193
+ (params.tournamentRecord && {
35194
+ [params.tournamentRecord.tournamentId]: params.tournamentRecord,
35195
+ }) ||
35196
+ {};
35104
35197
  if (typeof tournamentRecords !== 'object')
35105
35198
  return { error: MISSING_TOURNAMENT_RECORDS };
35106
- if (!Array.isArray(rounds))
35107
- return { error: MISSING_VALUE, info: mustBeAnArray('rounds') };
35108
35199
  const matchUpFormatCohorts = {};
35109
35200
  const orderedMatchUpIds = [];
35110
- rounds.sort((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0));
35111
- containedStructureIds =
35112
- containedStructureIds ??
35113
- Object.assign({}, ...Object.values(tournamentRecords).map((tournamentRecord) => getContainedStructures({ tournamentRecord }).containedStructures));
35114
- if (!matchUps) {
35115
- ({ matchUps } = allCompetitionMatchUps({
35116
- nextMatchUps: true,
35117
- tournamentRecords,
35118
- }));
35119
- }
35201
+ const rounds = params.rounds.toSorted((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0));
35202
+ const containedStructureIds = params.containedStructureIds ??
35203
+ Object.assign({}, ...Object.values(tournamentRecords).map((tournamentRecord) => getContainedStructures({ tournamentRecord }).containedStructures));
35204
+ const matchUps = params.matchUps ?? allCompetitionMatchUps({ nextMatchUps: true, tournamentRecords }).matchUps;
35120
35205
  let greatestAverageMinutes = 0;
35121
35206
  const recoveryMinutesMap = {};
35122
35207
  const averageMinutesMap = {};
@@ -35761,6 +35846,7 @@ var query$4 = {
35761
35846
  __proto__: null,
35762
35847
  courtGridRows: courtGridRows,
35763
35848
  findVenue: findVenue,
35849
+ getMatchUpsToSchedule: getMatchUpsToSchedule,
35764
35850
  getPersonRequests: getPersonRequests,
35765
35851
  getProfileRounds: getProfileRounds,
35766
35852
  getScheduledRoundsDetails: getScheduledRoundsDetails,
@@ -37787,6 +37873,7 @@ var index$f = {
37787
37873
  getMatchUpType: getMatchUpType,
37788
37874
  getMatchUpsMap: getMatchUpsMap,
37789
37875
  getMatchUpsStats: getMatchUpsStats,
37876
+ getMatchUpsToSchedule: getMatchUpsToSchedule,
37790
37877
  getMaxEntryPosition: getMaxEntryPosition,
37791
37878
  getModifiedMatchUpFormatTiming: getModifiedMatchUpFormatTiming,
37792
37879
  getPairedParticipant: getPairedParticipant,
@@ -46187,40 +46274,6 @@ function checkDependenciesScheduled({ matchUpScheduleTimes, matchUpDependencies,
46187
46274
  return { dependenciesScheduled, remainingDependencies };
46188
46275
  }
46189
46276
 
46190
- function processNextMatchUps({ matchUpPotentialParticipantIds, matchUpNotBeforeTimes, timeAfterRecovery, matchUp, }) {
46191
- const { individualParticipantIds } = getIndividualParticipantIds(matchUp);
46192
- timeAfterRecovery = timeAfterRecovery ?? matchUp.schedule?.timeAfterRecovery;
46193
- const addPotentialParticipantIds = (targetMatchUpId) => {
46194
- if (!matchUpPotentialParticipantIds[targetMatchUpId])
46195
- matchUpPotentialParticipantIds[targetMatchUpId] = [];
46196
- matchUpPotentialParticipantIds[targetMatchUpId] = unique(matchUpPotentialParticipantIds[targetMatchUpId].concat(...individualParticipantIds));
46197
- };
46198
- const updateNotBeforeTime = (matchUpId) => {
46199
- if (timeAfterRecovery &&
46200
- (!matchUpNotBeforeTimes[matchUpId] || timeAfterRecovery > matchUpNotBeforeTimes[matchUpId])) {
46201
- matchUpNotBeforeTimes[matchUpId] = timeAfterRecovery;
46202
- }
46203
- };
46204
- const winnerMatchUpId = matchUp.winnerTo?.matchUpId || matchUp.winnerMatchUpId;
46205
- if (winnerMatchUpId) {
46206
- timeAfterRecovery && updateNotBeforeTime(winnerMatchUpId);
46207
- addPotentialParticipantIds(winnerMatchUpId);
46208
- }
46209
- const loserMatchUpId = matchUp.loserTo?.matchUpId || matchUp.loserMatchUpId;
46210
- if (loserMatchUpId) {
46211
- timeAfterRecovery && updateNotBeforeTime(loserMatchUpId);
46212
- addPotentialParticipantIds(loserMatchUpId);
46213
- }
46214
- if (matchUp.sidesTo?.length) {
46215
- matchUp.sidesTo.forEach(({ matchUpId }) => {
46216
- if (matchUpId) {
46217
- timeAfterRecovery && updateNotBeforeTime(matchUpId);
46218
- addPotentialParticipantIds(matchUpId);
46219
- }
46220
- });
46221
- }
46222
- }
46223
-
46224
46277
  function checkParticipantProfileInitialization({ individualParticipantProfiles, participantId }) {
46225
46278
  if (!individualParticipantProfiles[participantId]) {
46226
46279
  individualParticipantProfiles[participantId] = {
@@ -46458,47 +46511,6 @@ function processAlreadyScheduledMatchUps({ matchUpPotentialParticipantIds, indiv
46458
46511
  };
46459
46512
  }
46460
46513
 
46461
- function getMatchUpsToSchedule({ matchUpPotentialParticipantIds, scheduleCompletedMatchUps, dateScheduledMatchUpIds, matchUpNotBeforeTimes, matchUpScheduleTimes, orderedMatchUpIds, clearDate, matchUps, }) {
46462
- const alreadyScheduledMatchUpIds = Object.keys(matchUpScheduleTimes);
46463
- const matchUpsToSchedule = orderedMatchUpIds
46464
- .map((matchUpId) => matchUps.find((matchUp) => matchUp.matchUpId === matchUpId))
46465
- .filter(Boolean)
46466
- .filter((matchUp) => {
46467
- const alreadyScheduled = !clearDate &&
46468
- (dateScheduledMatchUpIds.includes(matchUp.matchUpId) || alreadyScheduledMatchUpIds.includes(matchUp.matchUpId));
46469
- const doNotSchedule = [
46470
- BYE,
46471
- DEFAULTED,
46472
- COMPLETED$1,
46473
- ABANDONED$1,
46474
- RETIRED$1,
46475
- WALKOVER$2,
46476
- DOUBLE_WALKOVER,
46477
- DOUBLE_DEFAULT,
46478
- ].includes(matchUp?.matchUpStatus);
46479
- return (scheduleCompletedMatchUps ||
46480
- (!alreadyScheduled && !matchUp.winningSide && !doNotSchedule));
46481
- });
46482
- const { matchUpMap } = matchUpsToSchedule.reduce((aggregator, matchUp) => {
46483
- const { drawId, tournamentId } = matchUp;
46484
- if (!aggregator.matchUpMap[tournamentId])
46485
- aggregator.matchUpMap[tournamentId] = {};
46486
- if (!aggregator.matchUpMap[tournamentId][drawId]) {
46487
- aggregator.matchUpMap[tournamentId][drawId] = [matchUp];
46488
- }
46489
- else {
46490
- aggregator.matchUpMap[tournamentId][drawId].push(matchUp);
46491
- }
46492
- processNextMatchUps({
46493
- matchUpPotentialParticipantIds,
46494
- matchUpNotBeforeTimes,
46495
- matchUp,
46496
- });
46497
- return aggregator;
46498
- }, { matchUpMap: {} });
46499
- return { matchUpsToSchedule, matchUpMap };
46500
- }
46501
-
46502
46514
  function generateBookings({ defaultRecoveryMinutes = 0, averageMatchUpMinutes = 90, dateScheduledMatchUps, tournamentRecords, venueIds = [], periodLength, scheduleDate, matchUps, }) {
46503
46515
  if (typeof tournamentRecords !== 'object')
46504
46516
  return { error: MISSING_TOURNAMENT_RECORDS };
@@ -46793,6 +46805,41 @@ function checkRecoveryTime({ individualParticipantProfiles, matchUpNotBeforeTime
46793
46805
  return { enoughTime };
46794
46806
  }
46795
46807
 
46808
+ function auditAutoScheduling({ autoSchedulingAudit, tournamentRecords }) {
46809
+ addNotice({ topic: AUDIT, payload: autoSchedulingAudit });
46810
+ const getCount = (obj) => {
46811
+ if (!obj)
46812
+ return 0;
46813
+ const values = Object.values(obj);
46814
+ return values.reduce((count, value) => count + value.length || 0, 0);
46815
+ };
46816
+ const profileRoundsCount = (autoSchedulingAudit?.schedulingProfile || []).reduce((count, dateProfile) => count + dateProfile.venues.reduce((vc, venue) => vc + venue.rounds.length, 0), 0);
46817
+ const itemValue = {
46818
+ scheduledDatesCount: autoSchedulingAudit.scheduledDates?.length,
46819
+ noTimeMatchUpIdsCount: getCount(autoSchedulingAudit?.noTimeMatchUpIds),
46820
+ scheduledMatchUpIdsCount: getCount(autoSchedulingAudit?.scheduledMatchUpIds),
46821
+ overLimitMatchUpIdsCount: getCount(autoSchedulingAudit?.overLimitMatchUpIds),
46822
+ requestConflictsCount: getCount(autoSchedulingAudit?.requestConflicts),
46823
+ profileRoundsCount,
46824
+ };
46825
+ const timeItem = {
46826
+ itemType: AUTO_SCHEDULING_AUDIT,
46827
+ itemValue,
46828
+ };
46829
+ for (const tournamentRecord of Object.values(tournamentRecords)) {
46830
+ const tournamentId = tournamentRecord.tournamentId;
46831
+ if (hasTopic(AUDIT)) {
46832
+ addNotice({
46833
+ payload: { type: AUTO_SCHEDULING_AUDIT, tournamentId, detail: itemValue },
46834
+ topic: AUDIT,
46835
+ });
46836
+ }
46837
+ else {
46838
+ addTournamentTimeItem({ tournamentRecord, timeItem });
46839
+ }
46840
+ }
46841
+ }
46842
+
46796
46843
  function checkDailyLimits({ matchUpPotentialParticipantIds, individualParticipantProfiles, matchUpDailyLimits = {}, matchUp, }) {
46797
46844
  const { enteredIndividualParticipantIds } = getIndividualParticipantIds(matchUp);
46798
46845
  const { matchUpId, matchUpType } = matchUp;
@@ -46946,41 +46993,6 @@ function bulkScheduleMatchUps(params) {
46946
46993
  return warnings.length ? { ...SUCCESS, scheduled, warnings } : { ...SUCCESS, scheduled };
46947
46994
  }
46948
46995
 
46949
- function auditAutoScheduling({ autoSchedulingAudit, tournamentRecords }) {
46950
- addNotice({ topic: AUDIT, payload: autoSchedulingAudit });
46951
- const getCount = (obj) => {
46952
- if (!obj)
46953
- return 0;
46954
- const values = Object.values(obj);
46955
- return values.reduce((count, value) => count + value.length || 0, 0);
46956
- };
46957
- const profileRoundsCount = (autoSchedulingAudit?.schedulingProfile || []).reduce((count, dateProfile) => count + dateProfile.venues.reduce((vc, venue) => vc + venue.rounds.length, 0), 0);
46958
- const itemValue = {
46959
- scheduledDatesCount: autoSchedulingAudit.scheduledDates?.length,
46960
- noTimeMatchUpIdsCount: getCount(autoSchedulingAudit?.noTimeMatchUpIds),
46961
- scheduledMatchUpIdsCount: getCount(autoSchedulingAudit?.scheduledMatchUpIds),
46962
- overLimitMatchUpIdsCount: getCount(autoSchedulingAudit?.overLimitMatchUpIds),
46963
- requestConflictsCount: getCount(autoSchedulingAudit?.requestConflicts),
46964
- profileRoundsCount,
46965
- };
46966
- const timeItem = {
46967
- itemType: AUTO_SCHEDULING_AUDIT,
46968
- itemValue,
46969
- };
46970
- for (const tournamentRecord of Object.values(tournamentRecords)) {
46971
- const tournamentId = tournamentRecord.tournamentId;
46972
- if (hasTopic(AUDIT)) {
46973
- addNotice({
46974
- payload: { type: AUTO_SCHEDULING_AUDIT, tournamentId, detail: itemValue },
46975
- topic: AUDIT,
46976
- });
46977
- }
46978
- else {
46979
- addTournamentTimeItem({ tournamentRecord, timeItem });
46980
- }
46981
- }
46982
- }
46983
-
46984
46996
  function jinnScheduler({ schedulingProfileModifications, checkPotentialRequestConflicts, scheduleCompletedMatchUps, schedulingProfileIssues, dateSchedulingProfiles, containedStructureIds, matchUpDependencies, matchUpDailyLimits, clearScheduleDates, tournamentRecords, schedulingProfile, personRequests, periodLength, matchUps, courts, dryRun, }) {
46985
46997
  const scheduleTimesRemaining = {};
46986
46998
  const skippedScheduleTimes = {};
@@ -48258,6 +48270,7 @@ var lastNames = [
48258
48270
  "Cassidy",
48259
48271
  "Catton",
48260
48272
  "Calvino",
48273
+ "Carlin",
48261
48274
  "Carson",
48262
48275
  "Chip",
48263
48276
  "Constant",
@@ -54917,6 +54930,7 @@ var index$5 = {
54917
54930
  findVenue: findVenue,
54918
54931
  generateBookings: generateBookings,
54919
54932
  generateVirtualCourts: generateVirtualCourts,
54933
+ getMatchUpsToSchedule: getMatchUpsToSchedule,
54920
54934
  getPersonRequests: getPersonRequests,
54921
54935
  getProfileRounds: getProfileRounds,
54922
54936
  getScheduledRoundsDetails: getScheduledRoundsDetails,
@@ -56627,11 +56641,11 @@ function copyTournamentRecord(params) {
56627
56641
  const tournamentRecord = {
56628
56642
  participants: params.copyParticipants ? params.tournamentRecord.participants?.map(copyParticipant) ?? [] : [],
56629
56643
  parentOrganisation: makeDeepCopy({ ...params.tournamentRecord.parentOrganisation }, false, true),
56644
+ venues: makeDeepCopy(params.tournamentRecord.venues ?? [], false, true),
56630
56645
  extensions: filteredExtensions(params.tournamentRecord.extensions),
56631
56646
  timeItems: filteredTimeItems(params.tournamentRecord.timeItems),
56632
56647
  events: params.tournamentRecord.events?.map(copyEvent) ?? [],
56633
- weekdays: { ...params.tournamentRecord.weekdays },
56634
- venues: { ...params.tournamentRecord.venues },
56648
+ weekdays: [...(params.tournamentRecord.weekdays ?? [])],
56635
56649
  tournamentName: params.tournamentName,
56636
56650
  startDate: params.startDate,
56637
56651
  tournamentId: UUID(),