Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepopulate unscheduled sessions #1942

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

thomasleese
Copy link
Contributor

This changes the mechanism for creating unscheduled sessions to prepopulate all the sessions each year or when a new location is added to a team. Currently these are created dynamically when the user first clicks on a location without a session, but this new approach allows us to include the unscheduled sessions in any statistics, specifically allows us to count the number of children that would be added to a session when the dates are selected.

This adds a class which populates the unscheduled sessions for each
team, either creating missing sessions or destroying any sessions that
shouldn't exist.
When seeding the database for the first time we should create any
unscheduled sessions so they're displayed to the user.
Instead these sessions will created when schools are added to teams and
when the year comes around.
When adding a location to a team we should also create any unscheduled
sessions for the year.
When creating sessions, we don't need to set the programmes anymore as
they're set as part of the factory or when importing records for the
first time.

I've also added a validation to ensure a session has programmes.
Copy link

sonarcloud bot commented Oct 8, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants