Table of Contents |
---|
...
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | string | Season |
name | string | With i18n |
code | string | Usually the rule number or an accumulation code |
typedurationType | enum | Definite or Indefinite |
officeId | number | 1:1 with the rulebook office |
externalId | uuid | For syncing with Spordle ID |
...
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 |
typedurationType | enum | Definite or Indefinite. This is required to be the same as the sanction type.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 |
...
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)
...