Skip to content

Commit

Permalink
docs: 📝 add matchUpFilters documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
CourtHive committed Mar 22, 2024
1 parent 0748840 commit 811e8a8
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
62 changes: 62 additions & 0 deletions documentation/docs/concepts/matchup-filtering.mdx
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 });
```
1 change: 1 addition & 0 deletions documentation/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module.exports = {
matchUps: [
'concepts/matchup-overview',
'concepts/matchup-context',
'concepts/matchup-filtering',
'concepts/tieMatchUp',
'concepts/lineUp',
'concepts/tieFormat',
Expand Down

0 comments on commit 811e8a8

Please sign in to comment.