Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

https://spordle.atlassian.net/browse/SPR-614

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

Baseball

  • Each branch (BQ) has it’s own rules

    • Suspensions do not apply across branches (BQ suspension does not apply in BA), but a Baseball Canada suspension (e.g., from nationals) can apply to all branches

  • Suspensions

    • All penalties (ejections) result in a 1 game suspension, then accumulate into 3 games, 5 games then indefinite

    • Suspensions accumulate by participant (any team, office within BQ)

  • No expiry time component or indefinite rules from game infractions

Soccer

  • Each branch (SQ) has it’s own rules

    • Suspensions do not apply across offices (suspension in office A allows play in office B)

  • Suspensions

    • Yellow card

      • 3x accumulation results in a 1 game suspension

      • Resets after accumulation

    • Indirect red card

      • Results in a 1 game suspension

      • Affects accumulation of yellow cards

    • Direct red cards

      • Results in a 1 game suspension

      • No accumulation side effects

  • No expiry time component or indefinite rules from game infractions

  • Suspensions only accumulate with the same office and team

Hockey

  • Federation (HC) sets minimum baselines and each branch (BC) can extend baselines

    • Suspensions apply across the entire federation

    • Suspension rules are based on the schedule office

    • If a BC team plays in an AB tournament, AB suspension guidelines will be used, unless the player fails to purge the suspension prior to returning to BC, then BC guidelines will take effect and could possibly extend the suspension

      • e.g., AB may impose a 1 game suspension while BC imposes 2 games, so a player would be required to serve 2 games upon returning to BC

  • Suspensions

    • Accumulation based on penalty code or set of penalties (accumulation groups)

      • e.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’.

    • Multiple sanctions may be applied.

      • 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 resets each season

      • Head contact accumulation resets prior to minor championships

        • 🚩 Waiting to confirm if we’re isolation the championship office or setting a reset date for this accumulation group

      • 🚩 Waiting to confirm what happens after last defined accumulation

    • Penalty in the last 10 minutes or OT can affect suspension severity

    • Some sanctions are based on if the penalty was incurred pre/post game, or if an injury was sustained

      • Will need to check incident reports for the injury, may need to add additional meta for penalties

      • 🚩 Waiting to confirm if we can skip pre/post meta

  • 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

  • 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, will not count towards the serving of that suspension.

    • Rule added to avoid working around with an exhibition game mid-week. Did not commit to supporting this on day 1

  • Team Officials

    • Team officials may be suspended based on penalty accumulation in the same game

      • e.g., AS112 for 3 majors in a game, AS113 if that happens again in a second game, AS114 if it happens in a third game. AS118 for fights, AS107 for matches.

    • 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


Models

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

Property

Type

Description

id

uuid

name

string

Description of the sanction rule

positions

enum[]

Optional - Applicable to players or coaches

order

number

Rule precedence order

sanctionId

uuid

Resulting sanction

officeId

id

Accumulation

order

number

Accumulation precedence order

exclusive

boolean

If an infraction matches this sanction it doesn’t count towards other sanctions

min

number

Minimum number of infractions (>=)

max

number

Maximum number of infractions (<=)

resets

boolean

Accumulation count resets to 0 after reaching last accumulation

SanctionRuleMember

List of infractions that apply under a rule

Property

Type

Description

id

uuid

ruleId

id

infractionId

id

injury

boolean

Requires the penalty to be marked as injured

Sanction

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

externalId

uuid

For syncing with Spordle ID

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

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

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)

code

enum

Deprecated, replaced by sanctionId

SanctionBreak

Required to define breaks when calculating the suspension expiry date for the season

Property

Type

Description

id

uuid

startDate

date

endDate

date

officeId

id

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

games

number

Optional - Number of games the accumulation requires

days

number

Number of days

officeId

id


Implementation

Unhardcoding TODO

  • Handle indefinite and expiry dates

    • SPR-646 - Getting issue details... STATUS

  • Replace code with sanctions

    • SPR-665 - Getting issue details... STATUS

Accumulation TODO

  • 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

  • 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

    • 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)

Supplemental COMPLETE

  • 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 TODO

Lineup Status COMPLETE

  • Get all Active suspensions for each player COMPLETE

    • In soccer, exclude suspensions for other offices COMPLETE

  • If the suspension is for another team, it cannot be purged COMPLETE

Assigning COMPLETE

  • If an official has any active suspension, they should be flagged as Suspended COMPLETE

    • SPR-655 - Getting issue details... STATUS

    • This will be limited to Play suspensions as querying ID will absolutely kill performance

Completion TODO

  • If the suspension type is Indefinite, the suspension can never automatically be completed COMPLETE

    • SPR-646 - Getting issue details... STATUS

  • 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 COMPLETE

    • This will require a task to run at midnight daily (based on the timezone of the office)

    • SPR-646 - Getting issue details... STATUS

  • A suspension completes once the suspension has the required amount of purges that are completed games COMPLETE

  • If there is a pending suspension dependent on a completed suspension, start the dependent suspension TODO

Syncing TODO

  • Will need a two-way sync with ID

    • SPR-664 - Getting issue details... STATUS

  • This will remove the need to query suspensions in member validation

  • No labels