Skip to content

Commit

Permalink
refactor: 🧑‍💻 code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
CourtHive committed Apr 10, 2024
1 parent 4d624f2 commit 55609ee
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions documentation/docs/governors/participant-governor.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ Modifying team assignments has "global" effect, meaning that if a team appears i

```js
const scaleAttributes = {
sortOrder: ASCENDING, // defaults to ASCENDING; use case for DESCENDING is unclear!
scaleType: RANKING,
eventType: SINGLES,
scaleName: 'U18',
sortOrder: ASCENDING, // defaults to ASCENDING; use case for DESCENDING is unclear!
};
engine.scaledTeamAssignment({
clearExistingAssignments, // optional - true by default remove all existing individualParticipantIds from targeted teams
Expand All @@ -430,8 +430,8 @@ const scaleAttributes = {
};

const scaledParticipants = individualParticipants.map((participant) => ({
participantId: 'participantId',
scaleValue: participantScaleItem({ participant, scaleAttributes }).scaleItem.scaleValue,
participantId: 'participantId',
}));

const teamParticipantIds = teamParticipants.map(getParticipantId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { attachFlightProfile as attachProfile } from '@Mutate/events/attachFlightProfile';
import { chunkArray, chunkByNth, generateRange, shuffleArray } from '@Tools/arrays';
import { getScaledEntries } from '@Query/event/getScaledEntries';
import { getParticipantId } from '@Functions/global/extractors';
import { getFlightProfile } from '@Query/event/getFlightProfile';
import { getDevContext } from '@Global/state/globalState';
import { UUID } from '@Tools/UUID';
import { chunkArray, chunkByNth, generateRange, shuffleArray } from '@Tools/arrays';

// constants and types
import { EXISTING_PROFILE, ErrorType, MISSING_EVENT } from '@Constants/errorConditionConstants';
import { Entry, Event, StageTypeUnion, Tournament } from '@Types/tournamentTypes';
import { SPLIT_SHUTTLE, SPLIT_WATERFALL } from '@Constants/flightConstants';
import { DIRECT_ENTRY_STATUSES } from '@Constants/entryStatusConstants';
import { FlightProfile, ScaleAttributes } from '@Types/factoryTypes';
import { SUCCESS } from '@Constants/resultConstants';
import { EXISTING_PROFILE, ErrorType, MISSING_EVENT } from '@Constants/errorConditionConstants';
import { SPLIT_SHUTTLE, SPLIT_WATERFALL } from '@Constants/flightConstants';
import { Entry, Event, StageTypeUnion, Tournament } from '@Types/tournamentTypes';

/**
* @param {object} event - automatically retrieved by tournamentEngine given eventId
Expand Down
5 changes: 3 additions & 2 deletions src/tests/mutations/events/scaledFlightProfile.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { ensureInt } from '@Tools/ensureInt';
import mocksEngine from '@Assemblies/engines/mock';
import tournamentEngine from '@Engines/syncEngine';
import { ensureInt } from '@Tools/ensureInt';
import { expect, it } from 'vitest';

// constants
import { SPLIT_LEVEL_BASED, SPLIT_SHUTTLE, SPLIT_WATERFALL } from '@Constants/flightConstants';
import { MISSING_EVENT } from '@Constants/errorConditionConstants';
import { INDIVIDUAL } from '@Constants/participantConstants';
import { RANKING, RATING } from '@Constants/scaleConstants';
import { SINGLES } from '@Constants/eventConstants';
import { SPLIT_LEVEL_BASED, SPLIT_SHUTTLE, SPLIT_WATERFALL } from '@Constants/flightConstants';

// turn on devContext to enable checking splitEntries value
tournamentEngine.devContext(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { participantScaleItem } from '@Query/participant/participantScaleItem';
import { getParticipantId } from '@Functions/global/extractors';
import tournamentEngine from '@Engines/syncEngine';
import mocksEngine from '@Assemblies/engines/mock';
import { generateRange } from '@Tools/arrays';
import tournamentEngine from '@Engines/syncEngine';
import { expect, it } from 'vitest';

// constants
import { INVALID_PARTICIPANT_IDS, INVALID_VALUES, MISSING_VALUE } from '@Constants/errorConditionConstants';
import { TEAM_PARTICIPANT } from '@Constants/participantConstants';
import { SINGLES_EVENT, TEAM_EVENT } from '@Constants/eventConstants';
import { UNGROUPED } from '@Constants/entryStatusConstants';
import { COMPETITOR } from '@Constants/participantRoles';
import { ScaleAttributes } from '@Types/factoryTypes';
import { RANKING } from '@Constants/scaleConstants';
import { INVALID_PARTICIPANT_IDS, INVALID_VALUES, MISSING_VALUE } from '@Constants/errorConditionConstants';

const EVENT_NAME = 'Team Event';

Expand Down

0 comments on commit 55609ee

Please sign in to comment.