...
Accumulation properties specify when the Sanction
is applicable and behaviour properties specify what the resulting Suspension
will be defined as.
Any sanction within the same sanction group counts as an offence. Ex. the second sanction you get within the group results in Offence #2.sanctions that happen twice in a season will result in a second
Blue properties to be added with automation.
...
Property | Type | Description | |
---|---|---|---|
id | uuid | ||
sanctionId | id | ||
offense | number | 1, 2, 3… | |
Behaviour | |||
durationType | enum | Definite or Indefinite | |
games | number | Total games required to serve | |
lastMinutesGames | number | Optional - Total games required to serve when end of game or overtime (will hardcode to last 10 minutes for now) (undefined → fall back to totalGames) | |
injuryGames | number | Optional - Total games required to serve when penalty has an injury (undefined → fall back to totalGames) | |
days | number | Optional - Number of days to calculate the expiry date | |
lastMinutesDays | number | Optional - Number of days to calculate the expiry date in the last 10 minutes | |
injuryDays | number | Optional - Number of days to calculate the expiry date when penalty has an injury | |
Accumulation | |||
| enum[] | Optional - Applicable to players or bench staff | |
| Default to 1 | ||
|
|
| |
|
|
| |
|
|
|
Settings Models
OfficeBreak (V2)
Required to define breaks when calculating the suspension expiry date for the season. Could also be used for the scheduler.
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | enum | |
type | enum | Sanctions, Scheduling |
startDate | date | |
endDate | date | |
officeId | id | |
categoryIds | id[] | Optionally specify which categories it applies to |
SanctionRatio
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 | |
seasonId | enum | |
games | number | Optional - Number of games the accumulation requires |
days | number | Number of days |
officeId | id |
...
Property | Type | Description |
---|---|---|
lastMinutesDuration (V2) | 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 |
...
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 |
penaltyId | id | Penalty that resulted in the suspension |
positionGroup | enum | Position that this participant was suspended in. Player, Staff |
sanctionId | id | Sanction that was determined by the rulebook sanction rules |
|
|
|
durationType | enum | Definite or Indefinite. This is required to be the same as the sanction duration |
requiredGames | number | Number of games required to complete the suspension. Optional when Indefinite duration type, but may be set with it |
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 | ||||
---|---|---|---|---|
|
Handle indefinite and expiry dates
Jira Legacy server System Jira serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-646
Replace code with sanctions
Jira Legacy server System Jira serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-665985
Accumulation
Status | ||||
---|---|---|---|---|
|
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
When the game is completed (or certified, depending on settings), get all sanctions for the schedule office
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 multiple suspensions, suspensions will stack and be pending until the prior suspension has completed
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)
...
Jira Legacy server System Jira serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-1285 Add ability to deactivate suspensions
Jira Legacy server System Jira serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-1336
Discipline Committee
Status | ||||
---|---|---|---|---|
|
League administrators may add additional suspensions to increase the required number of games and expiry date. This does not affect the automatic game suspension.
If a suspension has the Appealed status, it is not effective. The automatic game suspension is not affected. The suspension should follow the expiry ratio logic and breaks defined in the rulebook
Status colour Blue title TODO
Lineup Status
Status | ||||
---|---|---|---|---|
|
...
If an official has any active suspension, they should be flagged as Suspended
Status colour Green title COMPLETE Jira Legacy server System Jira serverId 03e16d48-9e59-3010-89f5-a1a3500d66b7 key SPR-655
Completion
Status | |
---|---|
|
...
|
...
|
If the suspension type is Indefinite, the suspension can never automatically be completed
Status colour Green title COMPLETE 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 Green title COMPLETE This will require a task to run at midnight daily (based on the timezone of the office)
Status colour Green title COMPLETE 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
If there is a pending suspension dependent on a completed suspension, start the dependent suspensionStatus colour Green title COMPLETE Status colour Blue title TODO
Syncing
Status | ||||
---|---|---|---|---|
|
...