...
Accumulation
Accumulation based on infraction or a set of infractions (accumulation groups)
e.g., 7.2(b)
will result in a 1 game suspension then a 2 game suspension the second game it happense.g., 7.2(b) will result in a 1 game suspension, and 7.3(b) in a latter game will result in an accumulation sanction (AS104) due to ‘any 2 majors’.
🚩 Is this a misinterpretation?
Multiple sanctions may be applied from a single game
e.g., in a fight, player may be assessed 7.10 Fighting Major + GM (1 game) + 7.11(a) Instigator (1 game)
e.g., 7.2(c) in game one results in 1 game suspension, then 7.8(c) in next game results in 3 games under 7.8(c) + 5 games under AS107 which is pending until after the 3 game has completed
Accumulation is per season
Head contact accumulation resets prior to minor championships
🚩 Waiting to confirm if we’re isolating the championship office or setting a reset date for this accumulation group
Penalty in the last 10 minutes or OT, or an injury, can affect suspension severity
🚩 Would this be a separate sanction or ?These factors do not create multiple suspensions, just a single suspension
Some sanctions are based on if the penalty was incurred pre/post game, or if an injury was sustained
Injury attribute added to penalties; pre/post meta is out of scope initially
Team Officials
Team officials may be suspended based on penalty accumulation in the same game
e.g., An official who’s players accumulate 3 majors in a game will be assessed a 1 game suspension, then 3 games the second game that happens, and an indefinite suspension for the third game it happens
Head coach is suspended by default unless they’re not present, then it would be an assistant coach or manager unless the referee reports otherwise
🚩 Possibly implement this based on the signatory of the lineup?
...
Minor / Junior
Minor hockey suspensions don’t typically allow purging when transitioning to Junior, but there’s an exception to allow purging if they actually intend to play to help eligibility for next season. This will be handled manually by BC
Suspensions have a total required games and expiry date; will be considered completed when the first criteria is reached
Expiry has breaks (e.g., winter, summer)
Game/expiry ratio is not 1:1 (1/7/15/21/25/30/n*7) and varies by branch. Not defined by HC
Game infractions may result in indefinite suspensions with minimum number of game purges
Only games that were scheduled at the time of suspension may count towards to the serving of a suspension. Therefore, any game that is added to a team’s schedule after the date of a suspension, cannot be used to purge that suspension.
Rule added to avoid working around with an exhibition game mid-week. Did not commit to supporting this on day 1
Purging can only be done in the next scheduled game that was created prior to the suspension
Lineups of following games cannot be entered until the scheduled end time of the preceding game to prevent a potentially suspended member being added, or a suspended member being added with an excessive purge
View file | ||
---|---|---|
|
View file | ||
---|---|---|
|
...
Infractions are the rules, penalties are violations of infractions, sanctions define infraction accumulation and suspensions are the violation of sanctions.
SanctionRules act as sets of infractions and accumulation sets that produce a suspension with a given sanction.
SanctionRule
https://docs.google.com/spreadsheets/d/1iz1YxqmLZZsR02LOdJ8w3UkFT5noUtakCh_vjYMyAtM/edit#gid=0
Sanction
Suspensions are linked to a sanction to describe what the suspension is for
Accumulation properties specify when the Sanction
is applicable and behaviour properties specify what the resulting Suspension
will be defined as.
Yellow properties to be added with automation.
positions
enum[]
Optional - Applicable to players or coaches
order
number
Rule precedence order
sanctionId
uuid
Resulting sanction
parentId
id
officeId
id
Accumulation
order
number
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | string | Season |
name | string |
Description of the sanction rule
With i18n | ||
code | string | Usually the rule number or an accumulation code |
officeId | id | |
parentId | id | Optional - To override parent sanctions |
externalId | uuid | For syncing with Spordle ID |
Behaviour | ||
durationType | enum | Definite or Indefinite |
totalGames | number | Optional - Total games required in all cases |
endGames | number | Optional - Total games required when end of game or overtime (defined by office settings) |
injuryGames | number | Optional - Total games required when penalty has an injury |
Accumulation | ||
positionGroups | enum[] | Optional - Applicable to players or coaches |
priority | number | Priority precedence order for accumulations |
exclusive | boolean | If an infraction matches this sanction it doesn’t count towards other sanctions |
Not sure if this is necessary | ||
minCount | number | Minimum number of infractions (>=) |
maxCount | number | Maximum number of infractions (<=) |
resetCount | boolean | Accumulation count resets to 0 after reaching last accumulation |
...
SanctionMember
List of infractions that apply under a rule
Property | Type | Description | |
---|---|---|---|
id | uuid | ||
ruleIdsanctionId | id | ||
infractionId | idinjury | boolean | Requires the penalty to be marked as injured |
SanctionRule
Alternate option if no accumulation groups are applicable
...
Property
...
Type
...
Description
...
id
...
uuid
...
infractionId
...
id
...
positions
...
enum[]
...
Optional - Applicable to players or coaches
...
sanctionId
...
uuid
...
Resulting sanction
...
parentId
...
id
...
officeId
...
id
...
Accumulation
...
totals
...
number[]
...
Number of games
[1, 3, 5, ♾️]
...
exclusive
...
boolean
...
If an infraction matches this sanction rule it doesn’t count towards other sanctions
...
resets
...
boolean
...
Accumulation count resets to 0 after reaching last accumulation
Settings Models
SanctionBreak
...
Property | Type | Description |
---|---|---|
id | uuid | |
games | number | Optional - Number of games the accumulation requires |
days | number | Number of days |
officeId | id |
Suspension Models
Sanction
...
OfficeSettings
Office settings that affect general suspension behaviour
Property | Type | Description |
---|
endGameSomething |
uuid
seasonId
string
Season
name
string
With i18n
code
string
Usually the rule number or an accumulation code
durationType
enum
Definite or Indefinite
officeId
id
parentId
id
externalId
uuid
number | Number of minutes before the end of the game when Hockey Canada defines this as 10 minutes; QC defines this as 5 minutes | |
suspensionActivation | enum |
Suspension Models
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 inpositionGroup | enum | Position that this participant was suspended in. Player, Staff |
sanctionId | id | Sanction that was determined by the rulebook sanction rules | ||
penaltyId | id | Penalty that resulted in the suspension | ||
positionGroup | enum | Position that this participant was suspended in. Player, Staff | ||
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 | ||
expiry | 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 | ||
Legacy suspension options (deprecated) | ||||
| enum | Deprecated, replaced by sanctionId |
...
Implementation
Unhardcoding
Status | ||||
---|---|---|---|---|
|
...
When the game is completed (or certified, depending on settings), get all parent rulebooks of sanctions for 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
Get Find matching sanctions based on the sanction members that match the penalties
Find 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
Sanctions with higher priority cancel out lower priority sanctions
All sanctions are added unless there is an exclusive sanction
If there are
accumulatedmultiple suspensions,
theysuspensions will stack and 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
Suspension length will be defined as a sum of totalGames, endGames and injuryGames
endGames is only applicable when the penalty is in the last 10 minutes (per office settings)
injuryGames is only applicable when the penalty is marked as injured
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)
...