Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Following the implementation of SPR-453 Draft Redesign, two game tables will exist: Game (published) and DraftGame (unpublished). The original Draft table that creates an isolated container effect will no longer continue to exist. Sequences (this proposal) are necessary to introduce to maintain the original start number draft option functionality.

Sequences

A sequence will be composed of a starting number (which may have a prefix/suffix matching the regular expression /^(.*?)(\d+)(\D*)$/) and a maximum range.

...

Creating a sequence must validate if the range overlaps with any existing sequences to avoid creating conflicts. A new sequence must throw a validation error if the maximum causes an overlap into another sequence in the schedule.

Scheduling

Creating a game, regardless of whether it’s published directly or a draft game, will pull the next sequence number available. Drafts will require sequences to be configured in the schedule as draft games cannot rely on the game ID sequence.

...

When a game is deleted, creating a gap in the sequence, that number in the sequence will not be reused, despite the gap.

It will be possible to manually reset a sequence back to a given starting number, which may be necessary in case a batch of games are deleted. Resets will never be done automatically as we cannot predict if the user wants to reuse the sequence or not. All games in the schedule must be deleted in order for the reset to be available.

It will Assuming a sequence of U13L1000-1999, it is possible for a user to create 100 draft games, which will use sequence numbers 1000-1099, then before publishing, a user may create a published game in the same scheduling, which will use the next number in the sequence, 1100. Publishing the pending draft games would retain their original 1000-1099 range of game numbers. Publicly, a gap in the game numbers would appear as 1000-1099 hasn’t been published yet, but this is not a concern.

Groups

If a schedule has no groups, it is limited to one sequence for the schedule. If a schedule has groups, it is limited to one group per sequence.

1001-1299 = Flight 1
1300-1599 = Flight 2
1600-1899 = Flight 3
1900-2199 = Flight 4

When scheduling cross-group games, the game number is always taken from the sequence of the home team. While it is possible for a team to be in multiple groups in the same schedule (e.g., PCAHA playoffs), when generating the schedule, we select the groups, so this is how we can disambiguate the groups.

If necessary, it can also be possible to produce multiple sequences, so that you can have multiple sets of sequences as necessary. The sequence with the lowest next number that has not been exhausted will be used to produce the next sequence. However, this is unlikely necessary and will not be allowed initially to avoid potential user error.

...

Exceptions

It will be possible to manually reset a sequence back to a given starting number, which may be necessary in case a batch of games are deleted. Resets will never be done automatically as we cannot predict if the user wants to reuse the sequence or not. All games in the schedule must be deleted in order for the reset to be available.

Once all sequences are exhausted, a validation error will prevent games from being created or draft games from being published until a viable sequence is available. We cannot fall back to a game ID as that would be a bigger mess to clean up, and it would be easier to block publishing so that they can fix the sequence then resume publishing.Assuming a sequence of U13L1000-1999, it is possible for a user to create 100 draft games, which will use sequence numbers 1000-1099, then before publishing, a user may create a published game in the same scheduling, which will use the next number in the sequence, 1100. Publishing the pending draft games would retain their original 1000-1099 range of game numbers. Publicly, a gap in the game numbers would appear as 1000-1099 hasn’t been published yet, but this is not a concern.

Examples

PCAHA game numbering system is well defined:

...