...
Table of Contents |
---|
Requirements
All sports
Automatic suspensions are not appealable in any sport
If suspended, only eligible to “purge” for the same team, otherwise suspended and cannot purge or play on other teams
Suspensions follow into the following season and can by served by any team in the following season
Schedule office (e.g., league) is responsible for administering suspensions, not team
Suspensions prohibit officials from officiating games (exceptions may be granted by the assigner)
Notifications to be sent to the player, team staff, schedule and team offices
...
Suspensions are linked to a sanction to describe what the suspension is for
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | string | Season |
name | string | With i18n |
code | string | Usually the rule number or an accumulation code |
durationType | enum | Definite or Indefinite |
officeId | number | 1:1 with the rulebook office |
externalId | uuid | For syncing with Spordle ID |
Rulebook
In the future, we may split out rulebooks into multiple tables, but at this time, this would take too long to ship unhardcoded suspensions in time.
Note |
---|
May be worthwhile to implement changes to the rulebook (especially for infractions) prior to proceeding with suspension implementation, as linking with infraction IDs would simplify a lot |
SanctionRule
Will work similar to AssignRule matchers.
Minimum sanctions will be defined in the federation and each branch
Games will resolve sanctions from all parent rulebooks, children will cancel out parents based on matchers
Rulebook validation will require sanctions that match a parent rulebook to be at minimum of the parent
Still need to define how to cancel out yellow accumulation for indirect reds in soccer
Property | Type | Description |
---|---|---|
id | uuid | Automatically generated |
name | string | Description of the sanction rule |
positions | enum[] | Optional - Applicable to players or coaches |
Penalty matching | ||
matchers[] | object[] | Types of penalties |
name | string | Name of the penalty to match |
code | string | Optional - code of the penalty to match |
injury | boolean | Optional - accounts for if there’s a linked incident report with an injury or not |
Accumulation | ||
order | number | Accumulation precedence order |
resetAccumulation | number | Optional - number of infractions to reset the count after |
accumulations[] | object[] | Total number of infractions required to be accumulated |
total | number | Optional? - Total number of infractions |
sanctionId | uuid | Resulting sanction |
Breaks
Required to define breaks when calculating the suspension expiry date for the season
Property | Type | Description |
---|---|---|
id | uuid | |
startDate | date | |
endDate | date |
Expiry Ratio
BC Hockey defines a ratio generally, not per game, so it might be better to do the same. When games is undefined, it will serve as the default case and serve as a n:m ratio
Property | Type | Description |
---|---|---|
id | uuid | |
games | number | Optional - Number of games the accumulation requires |
days | number | Number of days |
Suspension
Property | Type | Description |
---|---|---|
id | uuid | |
gameId | id | Game the suspension originated in |
participantId | id | Participant that was suspended |
teamId | id | Team that the participant is suspended in |
positionGroup | enum | Position that this participant was suspended in. Player, Staff |
| enum | Deprecated, replaced by sanctionId |
sanctionId | id | Sanction that was determined by the rulebook sanction rules |
penaltyId | id | Penalty that resulted in the suspension |
durationType | enum | Definite or Indefinite. This is required to be the same as the sanction duration |
minimumGames | number | Minimum number of games required for this suspension Optional when indefinite. Set by system. |
requiredGames | number | Number of games required to complete the suspension. Optional when Indefinite. Required to be >= minimumGames |
expiryDate | date | Optional - Date when the suspension will expire if the games requirement isn’t met |
status | enum | Pending, Appealed, Active, Completed, Cancelled, Expired |
externalId | uuid | For syncing with Spordle ID |
...
Implementation
...
...
server | System JIRA |
---|---|
serverId | 03e16d48-9e59-3010-89f5-a1a3500d66b7 |
key | SPR-614 |
Unhardcoding
Status | ||||
---|---|---|---|---|
|
...
When the game is completed (or certified, depending on settings), get all parent rulebooks of the schedule office
Cancel out sanctions in parent rulebooks that have a matching sanction in a child rulebook by matchers
Determine matching sanction rule for each player
Each penalty typically only results in one suspension per game
Hockey has some exceptions with accumulations and fighting
Determine sanction rules by matching the strictest penalty name/code match and order
TODO: indirect red will affect yellow here somehow 🚩
Get all past penalties and suspensions of all suspend-able players in the same season
In soccer, limit both to same office
Determine the sanction(s) based on the accumulation rules
accumulations[] is ordered, find the matching total based on the number of penalties incurred in past games and current. Account for reset count.
If there are accumulated suspensions, they will be pending until the prior suspension has completed
7.2(c) results in 3 games, then later 7.8(c) will result in 3 games (15 days) immediately then AS107 5 games (25 days) following its completion
If there is an expiry ratio defined, calculate the expiry based on the number of days
If the expiry falls within a break, extend it by the number of days within that break
When creating the suspension, send a notification to the player, team officials and office admins (except player, will be based on notification setting)
...
Get all Active suspensions for each player
Status colour Green title COMPLETE In soccer, exclude suspensions for other offices
Status colour Green title COMPLETE
If the suspension is for another team, it cannot be purged
Status colour Green title COMPLETE
Assigning
Status | |
---|---|
|
...
|
...
|
If an official has any active suspension, they should be flagged as Suspended
Status colour BlueGreen title TODOCOMPLETE Jira Legacy server System JIRA serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-655 This will be limited to Play suspensions as querying ID will absolutely kill performance
Completion
Status | ||||
---|---|---|---|---|
|
If the suspension type is Indefinite, the suspension can never automatically be completed
Status colour BlueGreen title TODOCOMPLETE Jira Legacy server System JIRA serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-646
If there is an expiry date, the suspension is considered Expired once that date passes if it is not yet completed based on the required games
Status colour BlueGreen title TODOCOMPLETE This will require a task to run at midnight daily (based on the timezone of the office)
Jira Legacy server System JIRA serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-646
A suspension completes once the suspension has the required amount of purges that are completed games
Status colour Green title COMPLETE If there is a pending suspension dependent on a completed suspension, start the dependent suspension
Status colour Blue title TODO
Syncing
Status | ||||
---|---|---|---|---|
|
...