tods-competition-factory 2.2.18 → 2.2.19

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.2.18';
6
+ return '2.2.19';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -10261,14 +10261,14 @@ function addMatchUpContext({ scheduleVisibilityFilters, sourceDrawPositionRanges
10261
10261
  tournamentRecord?.processCodes;
10262
10262
  const competitiveProfile = contextProfile?.withCompetitiveness && getMatchUpCompetitiveProfile({ ...contextContent, matchUp });
10263
10263
  const finishingPositionRange = matchUp.finishingPositionRange ?? additionalContext.finishingPositionRange;
10264
+ const roundOfPlay = stage !== QUALIFYING && isConvertableInteger(initialRoundOfPlay) && initialRoundOfPlay + (roundNumber || 0);
10264
10265
  const onlyDefined = (obj) => definedAttributes(obj, undefined, true);
10265
10266
  const matchUpWithContext = {
10266
10267
  ...onlyDefined(context),
10267
10268
  ...onlyDefined({
10268
- matchUpFormat: matchUp.matchUpType === TEAM$1 ? undefined : matchUpFormat,
10269
- tieFormat: matchUp.matchUpType !== TEAM$1 ? undefined : tieFormat,
10269
+ matchUpFormat: matchUpType === TEAM$1 ? undefined : matchUpFormat,
10270
+ tieFormat: matchUpType !== TEAM$1 ? undefined : tieFormat,
10270
10271
  gender: collectionDefinition?.gender ?? event?.gender,
10271
- roundOfPlay: stage !== QUALIFYING && isConvertableInteger(initialRoundOfPlay) && initialRoundOfPlay + (roundNumber || 0),
10272
10272
  endDate: matchUp.endDate ?? endDate,
10273
10273
  discipline: event?.discipline,
10274
10274
  category: matchUpCategory,
@@ -10289,6 +10289,7 @@ function addMatchUpContext({ scheduleVisibilityFilters, sourceDrawPositionRanges
10289
10289
  roundOffset,
10290
10290
  structureId,
10291
10291
  roundNumber,
10292
+ roundOfPlay,
10292
10293
  feedRound,
10293
10294
  roundName,
10294
10295
  drawName,
@@ -58490,7 +58491,7 @@ function executeFunction(engine, method, params, methodName, engineType) {
58490
58491
  const augmentedParams = params ? paramsMiddleware(tournamentRecords, params) : undefined;
58491
58492
  if (augmentedParams?.error)
58492
58493
  return augmentedParams;
58493
- const result = invoke({
58494
+ const result = invoke$1({
58494
58495
  params: augmentedParams,
58495
58496
  tournamentRecords,
58496
58497
  tournamentRecord,
@@ -58501,7 +58502,7 @@ function executeFunction(engine, method, params, methodName, engineType) {
58501
58502
  engineLogging({ result, methodName, elapsed, params: paramsToLog, engineType });
58502
58503
  return result;
58503
58504
  }
58504
- function invoke({ tournamentRecords, tournamentRecord, params, methodName, method }) {
58505
+ function invoke$1({ tournamentRecords, tournamentRecord, params, methodName, method }) {
58505
58506
  if (getDevContext()) {
58506
58507
  return method({ tournamentRecords, tournamentRecord, ...params });
58507
58508
  }
@@ -59009,58 +59010,58 @@ const matchUpEngine = (() => {
59009
59010
  }
59010
59011
  return engine;
59011
59012
  }
59012
- importGovernors([scoreGovernor]);
59013
+ importGovernors(engine, [scoreGovernor]);
59013
59014
  return engine;
59014
- function importGovernors(governors) {
59015
- governors.forEach((governor) => {
59016
- Object.keys(governor).forEach((methodName) => {
59017
- engine[methodName] = (params) => {
59018
- if (getDevContext()) {
59019
- return invoke({ params, governor, methodName });
59015
+ })();
59016
+ function importGovernors(engine, governors) {
59017
+ governors.forEach((governor) => {
59018
+ Object.keys(governor).forEach((methodName) => {
59019
+ engine[methodName] = (params) => {
59020
+ if (getDevContext()) {
59021
+ return invoke(engine, { params, governor, methodName });
59022
+ }
59023
+ else {
59024
+ try {
59025
+ return invoke(engine, { params, governor, methodName });
59020
59026
  }
59021
- else {
59022
- try {
59023
- return invoke({ params, governor, methodName });
59024
- }
59025
- catch (err) {
59026
- handleCaughtError({
59027
- engineName: 'matchUpEngine',
59028
- methodName,
59029
- params,
59030
- err,
59031
- });
59032
- }
59027
+ catch (err) {
59028
+ handleCaughtError({
59029
+ engineName: 'matchUpEngine',
59030
+ methodName,
59031
+ params,
59032
+ err,
59033
+ });
59033
59034
  }
59034
- };
59035
- });
59035
+ }
59036
+ };
59036
59037
  });
59038
+ });
59039
+ }
59040
+ function invoke(engine, { params, governor, methodName }) {
59041
+ engine.error = undefined;
59042
+ engine.success = false;
59043
+ const matchUp = params?.matchUp || getMatchUp();
59044
+ const matchUps = params?.matchUps || getMatchUps();
59045
+ const snapshot = params?.rollbackOnError && makeDeepCopy(matchUp, false, true);
59046
+ params = {
59047
+ ...params,
59048
+ matchUpId: matchUp?.matchUpId,
59049
+ matchUps,
59050
+ matchUp,
59051
+ };
59052
+ const result = governor[methodName](params);
59053
+ if (result?.error) {
59054
+ if (snapshot)
59055
+ setState(snapshot);
59056
+ return { ...result, rolledBack: !!snapshot };
59037
59057
  }
59038
- function invoke({ params, governor, methodName }) {
59039
- engine.error = undefined;
59040
- engine.success = false;
59041
- const matchUp = params?.matchUp || getMatchUp();
59042
- const matchUps = params?.matchUps || getMatchUps();
59043
- const snapshot = params?.rollbackOnError && makeDeepCopy(matchUp, false, true);
59044
- params = {
59045
- ...params,
59046
- matchUpId: matchUp?.matchUpId,
59047
- matchUps,
59048
- matchUp,
59049
- };
59050
- const result = governor[methodName](params);
59051
- if (result?.error) {
59052
- if (snapshot)
59053
- setState(snapshot);
59054
- return { ...result, rolledBack: !!snapshot };
59055
- }
59056
- const notify = result?.success && params?.delayNotify !== true && params?.doNotNotify !== true;
59057
- if (notify)
59058
- notifySubscribers();
59059
- if (notify || !result?.success || params?.doNotNotify)
59060
- deleteNotices();
59061
- return result;
59062
- }
59063
- })();
59058
+ const notify = result?.success && params?.delayNotify !== true && params?.doNotNotify !== true;
59059
+ if (notify)
59060
+ notifySubscribers();
59061
+ if (notify || !result?.success || params?.doNotNotify)
59062
+ deleteNotices();
59063
+ return result;
59064
+ }
59064
59065
 
59065
59066
  let devContextSet = false;
59066
59067
  const mocksEngine = (() => {