...
Bit of a challenge coming up for the names of each part. Infractions
have a Duration
and belong to Rules
which belong to Sections
. Infractions are grouped as Options
to require Major+GM or Double Minors to be selected together.
Purple requires i18n., gray are for backwards compatibility.
InfractionDuration
Minor, Major, Match, Misconduct, Game Misconduct
Property | Type | Description |
---|---|---|
id | uuid | |
officeId | id | Hockey Canada |
name | string | Minor |
description | string | |
abbreviation | string | |
length | number | Minutes |
InfractionSection
07 Physical Fouls
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | id | 2024-25 |
officeId | id | Hockey Canada |
name | string | Physical Fouls |
code | text | 7 |
order | number |
InfractionRule
Head Contact
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | id | 2024-25 |
officeId | id | Hockey Canada |
name | string | Head Contact |
code | string | 7.6 |
sectionId | id | Physical Fouls |
order | number |
...
Also fun, HQ doesn’t combine majors and game misconducts, so this definitely needs to be configurable by branch.
InfractionOption
This is a container that represents the options the scorekeeper can select.
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | id | 2024-25 |
officeId | id | Hockey Canada |
ruleId | id | 7.6 Head Contact (07 Physical Fouls) |
parentId | id | Allows overriding a parent option by a lower office |
order | number |
InfractionOptionMember
These are the effective infractions upon selecting the option. Order is significant and allows for sequencing penalties as consecutive (e.g., major = 0, GM = 1) or parallel (same order) for start times
...
Typical examples are 3x Stick Infraction → Game Ejection or 2x Misconduct → Game Ejection.
InfractionAccumulation
This acts as a grouping that defines the count of the member infractions necessary and what the resulting infraction is.
Property | Type | Description |
---|---|---|
id | uuid | |
seasonId | id | 2023-24 |
officeId | id | Hockey Canada |
name | string | Stick Infractions |
count | number | 3 |
infractionId | id | Resulting infraction when accumulation reached 4.8 (b) |
InfractionAccumulationMember
These are the list of infractions that are part of the accumulation group. Order is not significant; any member infraction counts towards the accumulation group.
...
Property | Type | Description |
---|---|---|
id | uuid | |
accumulationId | id | 2023-24 |
infractionId | id | 9.1 (a) |
Penalty Models
Yellow are new properties, red are deprecated.
GamePenalty
Instances of an infraction in a game are called penalties. This is a scoresheet artifact.
Property | Type | Description |
---|---|---|
id | uuid | |
gameId | id | |
teamId | id | |
participantId | id | |
servedById | id | |
isInjured | boolean | Necessary for suspensions |
Time | ||
gameTime | GameTime | Time of infraction |
startTime | GameTime | Time the penalty started to be served |
endTime | GameTime | Time the penalty ceased to be served |
isEnded | boolean | Whether or not the penalty was ended |
Infraction | ||
infractionId | id | |
durationId | id | Technically not really necessary since the durationId is part of the infraction above |
optionId | id | Link penalties part of the same option group when creating instead of trying to reverse them as we currently do |
accumulationId | id | Link penalties that were created by an accumulation rule |
Legacy infraction options (deprecated) | ||
infraction | string | Infraction “id” which is something like “head-contact” in the rulebook |
duration | string | Duration “id” which is something like “minor” in the rulebook |
code | string | Infraction “code” |
Penalties are consisted linked if they have the same participantId
, gameTime
and optionId
or have an accumulationId
that matches.
...
The /meta API should return all applicable infraction, infraction option and accumulation entities.
...
Administration
A new Rulebook office tab will be added that will show durations, sections, rules, infractions, options and accumulations as individual cards. Each card would have a filter to show effective offices, but editing is disabled if the office doesn’t match.
Durations, Sections, Rules
These are only configurable by top-level offices.
Meta
Meta is critical for building the effective rulebook for the scorekeeping interface, as the app needs to be able to function offline, so it needs all data up front. Another key bit is we need to resolve all the overridden rules by child organizations.
2023-24 and prior seasons must continue to maintain backwards-compatible support and resolve using the legacy rulebook.
Durations, Sections, Rules
These are not overridable, so all effective entities should be included.
Infractions
These can be overridden, so when a parentId
is present, the parent is excluded from the result.
Options, Accumulations
Similar to infractions, can be overridden.
Payload
This payload basically keeps everything at the top-level unlike the legacy payload so it’s easy to resolve references, and the app can decide to nest infractions into rules into sections as needed. The legacy ejections key is replaced by accumulations.
durations
sections
rules
infractions
options
members
accumulations
members
lineupLimits
pitcherLimits
variances