SPR-794 Cross group/schedule

Requirements

  • When selecting a team for a game, the team must be in the selected group(s)/schedule(s)

  • Stats/standings for the game apply to the applicable group/schedule

  • Only one copy of the game,

Out of scope

  • Stats sharing; bringing a tournament game to count towards a league

Models

Game / DraftGame

Property

Type

Description

Property

Type

Description

crossGroupId

number

Optional

crossScheduleId

number

Optional

UX / Implementation

Game Form

  • New checkboxes to show cross schedule and cross group inputs

    • Cross schedule checkbox is always visible, cross-group is only visible if either the main or cross schedule have groups. This is so we don’t show the option redundantly

    • Alternatively could make this a “Add cross-schedule” text button, or hide it behind a collapse?

  • In the cross group input, the “No Group” option should show “No Cross-Group”

  • Cross group input should reset if the cross schedule office does not match the cross group office

  • Both teams inputs should allow selecting from either group/schedule

Validation

  • Cross group with both teams from the same group is invalid, since this isn’t actually cross-group

    • Either unselect cross-group or select a team from the other group

  • Selected team cannot be in both groups

  • Home/away team are not restricted to main/cross group respectively

  • If cross-schedule is selected, cross-group must be in the same office; likewise the primary group should be in the same office as the primary schedule

Game Display

  • When there’s a cross-group show “Main Group / Cross Group” wherever a group is shown and same for the cross schedule

  • When filtering by group, filter should automatically search the cross group

    • When searching by null groupId, do not include non-null groupId + null crossGroupId

  • If cross group/schedule games show in both schedules

Authorization

  • Cross group/schedule inherits read/edit access as if it’s part of their schedule

Publishing

  • Game number is determined from the home team’s group (which may be either main/cross group)

  • crossGroupId/crossScheduleId properties are transferred from draft to game like all others

Scorekeeping / Assigning

  • No change. Any settings based on the schedule/group continue to be based on the primary schedule/group

Stats & Standings

  • Game only affects the group that the team is in; the team does not get added to the group standings that they’re not part of

  • Points/etc for the team are based on the team/schedule they’re in

    • e.g., a win in the primary schedule could be 3 points while cross schedule is 2 points

  • No schema change for stats; scheduleId would assume the cross schedule when applicable