-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: 📝 add
matchUpFilters
documentation
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
title: matchUp filtering | ||
--- | ||
|
||
Every public factory method which returns `matchUps` supports the `matchUpFilters` and `contextFilters` parameters. | ||
The underlying `filterMatchUps` method is also exposed for direct use via the `matchUpsGovernor`. | ||
|
||
## matchUpFilters | ||
|
||
```js | ||
const matchUpFilters = { | ||
matchUpFormat: 'SET3-S:6/TB7-F:TB10', | ||
excludeMatchUpStatuses: [], | ||
hasParticipantsCount: 2, | ||
isCollectionMatchUp: [], | ||
hasWinningSide: true, | ||
isMatchUpTie: false, | ||
matchUpStatuses: [], | ||
matchUpFormats: [], | ||
roundPositions: [], | ||
collectionIds: [], | ||
roundNumbers: [], | ||
matchUpIds: [], | ||
roundNames: [], | ||
|
||
filterMatchUpTypes = true, | ||
filterMatchUpIds = true, | ||
}; | ||
``` | ||
|
||
## contextFilters | ||
|
||
Only function on `matchUps` which are `inContext`. | ||
|
||
```js | ||
const contextFilters = { | ||
scheduledDate: '2024-04-01', | ||
processContext: true, | ||
readyToScore: true, | ||
stageSequences: [], | ||
scheduledDates: [], | ||
participantIds: [], | ||
tournamentIds: [], | ||
matchUpTypes: [], | ||
structureIds: [], | ||
courtIds: [], | ||
eventIds: [], | ||
venueIds: [], | ||
drawIds: [], | ||
stages: [], | ||
}; | ||
``` | ||
|
||
## filterMatchUps | ||
|
||
The `matchUpFilters` options listed above are direct attributes of `filterMatchUps`. | ||
|
||
```js | ||
import { matchUpsGovernor } from 'tods-competition-factory'; | ||
matchUpsGovernor.filterMatchUps({ matchUps, ...matchUpFilters }); | ||
matchUpsGovernor.filterMatchUps({ matchUps, ...contextFilters, processContext: true }); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters