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

Added a SlotModificationService to do shift deletion and updates in a controlled way. #497

Merged
merged 5 commits into from
Jun 25, 2024

Conversation

Theophile-Madet
Copy link
Contributor

@Theophile-Madet Theophile-Madet commented Jun 19, 2024

Since we want to many slots now and later make slot deletion available for Vorstand members, I made a little service that searches for the most appropriate slots to update (the ones without a member registered to them if available) and prints out which members are affected by the changes so that they can be contacted if necessary.

I added a management command so that it's easy to test, edit the command then run:

docker compose exec web poetry run python manage.py test_slot_modification_service

I'm hoping it could be used as a base or as a reference if we make slot deletion available for Vorstand members.

I'm fairly confident that it works as intended, but it'd be great to have some feedback on how readable it is. Thanks!

@Theophile-Madet Theophile-Madet requested a review from tvedeane June 19, 2024 11:17
@Theophile-Madet Theophile-Madet self-assigned this Jun 19, 2024
@Theophile-Madet Theophile-Madet linked an issue Jun 19, 2024 that may be closed by this pull request
…ions in SlotModificationService

First tests, for now only for SlotModificationService.pick_shift_templates
@Theophile-Madet
Copy link
Contributor Author

@tvedeane I added a few tests, hopefully they help understand what's happening!

Theophile-Madet and others added 2 commits June 24, 2024 17:46
…dated by comparing sets instead of lists, since the order doesn't matter (test was green on my machine but red in github actions)
}

@classmethod
def preview_changes(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this method is not used, did you add it for future use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I thought we may want to see if a change would affect anyone before applying the changes.

@Theophile-Madet Theophile-Madet merged commit 35b4647 into master Jun 25, 2024
8 checks passed
@Theophile-Madet Theophile-Madet deleted the 496-shift-modification-service branch June 25, 2024 07:02
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.

Cutting shifts on Tapir_june 2024
2 participants