Drafts currently function as isolated schedules which are very intentionally self-contained as a separate workflow. Due to the nature of the database modelling, there are a lot of limitations to being able to easily share draft games to associations and allow them to work on multiple drafts.
Instead, we’ll move away from the single Draft model to a parallel games table (likely called DraftGames) which we can work with like any other model.
Requirements
Draft games need to be shared to associations who need to be able to view all their draft games in one place regardless of schedule
Draft games must be in their own model to make this relation feasible
Draft games may impact availability as soon as they’re scheduled even if not yet “published”
This setting currently exists
If a draft game is rescheduling an existing game this should be clearer
Currently this matches on game number
More flexibility on draft creation flows
Currently it’s a rigid info/teams/review/publish flow, certain options may require more details for improved UX
Should be possible to partially publish some draft games when they’re ready
e.g., one association is done early but others aren’t ready yet
Future (Out of scope)
Total games per round
Provide a matrix to show how many games each team plays against each other to produce a set of games to be scheduled
Date scheduling in calendar
Scheduler must produce dates to be able to use the calendar currently
Rescheduling
Teams need to be able to propose changes to scheduled games by other team and/or league approval
Models
Draft
Deprecated. Unpublished games will be created as DraftGame in the migration
DraftGame
Would be nearly identical to Game, with additional properties:
Property | Type | Description |
---|---|---|
gameId | number | ID of game being updated or the resulting game that was published This would be automatically filled in based on the game number when generating/uploading games and would be used when using the (future) rescheduling function |
round | number | Not 100% sure if this is still desired |
isShared | boolean | Grants access to scheduling:drafts role |
isPublished | boolean | Acts as isDeleted, but differentiates that it was used |
ScheduleTeam
Same as before, with additional properties:
Property | Type | Description |
---|---|---|
order | number | This is used to maintain schedule balance when generating additional games. Adding a scheduleteam would automatically use the next order. Schedulers would be able to adjust the order in the UI 🚩 Competitions integration will create ScheduleTeams, so order needs to be automatic through the API |
ScheduleSequence
Add starting game number(s)? If this is per group, should this function as a pg sequence instead?
🚩 Need to thoroughly analyze this to make sure it doesn’t have any issues when replacing the draft start number
Property | Type | Description |
---|---|---|
scheduleId | number | |
groupId | number | |
start | string | Starting number (U15T2500) |
current | number | Zero indexed. Increments start (U15T2500) + current (5) = U15T1005 |
max | number | Max number to generate from this sequence (100 caps at U152599) |
UX
Draft creation will no longer be a single page workflow, since games will no longer be within a draft. Instead, draft creation behaves more like an import modal.
Once the information from the draft modal is filled out, draft games are created and they’ll be available in a cards on the schedule and office pages.
We can make use of card expanding (from reports) to provide more space to schedule games and use the calendar, or provide a dedicated tab instead.
Generated
Convert the current card design (of the info step) into individual steps in the modal
Need to add a previous round input so that the scheduler can continue schedules as usual
This already exists, but isn’t exposed in the UI
Critical for PCAHA. Need to check if it’s feasible for their schedulers to use this instead of selecting the last league, or if we need to infer from DraftGames
Order matters in team selection. May be best to just maintain an order on ScheduleTeam directly so it can be easily reused. Otherwise, the teams step just duplicates the schedule’s teams tab
Uploaded
This can behave exactly like existing import modals
Manual
No longer necessary. Schedulers will be able to create draft games directly in the schedule
Need to make sure current behaviour of autoincrementing a starting number is maintained in any case
Updates
When a DraftGame is created, search for an existing game the schedule by number and link the gameId automatically
This will become relevant later when reusing this functionality for game change requests
Analysis
We must maintain the existing analysis functionality and move this into an API
The great thing is it’ll be very easy now to mix the published games and draft games and show the analysis at all times in the schedule view (and potentially even the office)
Would want to allow being able to toggle showing draft games so you can see what your schedule is like currently and how the draft games will affect it
Implementation
This can live behind a feature flag under development, as the isolation of drafts makes this convenient.
Model changes TODO
Add order to ScheduleTeam
- SPR-752Getting issue details... STATUSCreate DraftGame, add a new card to show them in place of Drafts per flag
- SPR-455Getting issue details... STATUSImplement game number sequence
- SPR-753Getting issue details... STATUS
Manual creation TODO
- SPR-455Getting issue details... STATUS
Modal to create draft games one by one via the new DraftGame card
Select multiple games to publish, share, or delete
Analysis dialog TODO
- SPR-456Getting issue details... STATUS
Move the game analysis logic into a library and accessible through the API
Provide an analysis dialog on the schedule page
Import modal TODO
- SPR-437Getting issue details... STATUS
Follow the existing importers to parse a file
This would import as draft games as well as schedule teams
Should we provide an option to publish directly?
Generation TODO
- SPR-454Getting issue details... STATUS
Create a stepper modal that mimics the existing cards
New
POST /schedules/:id/generate
API would accept the parameters and create draft games
Release TODO
Existing unpublished drafts to be converted to draft games
Remove flags, UI and deprecate API