Resolve "Only allow one absence at any point of time" #115

Merged
yuha merged 12 commits from 32-only-allow-one-absence-at-any-point-of-time into master 2024-12-01 21:24:30 +01:00
yuha commented 2024-11-21 10:40:00 +01:00 (Migrated from edugit.org)

Closes #32

Closes #32
yuha commented 2024-11-21 10:40:01 +01:00 (Migrated from edugit.org)

assigned to @yuha

assigned to @yuha
yuha commented 2024-11-21 11:35:54 +01:00 (Migrated from edugit.org)

added 1 commit

  • 2f14ace5 - Add clean method checking for overlapping absences

Compare with previous version

added 1 commit <ul><li>2f14ace5 - Add clean method checking for overlapping absences</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=50695&start_sha=a29a354499a528c64e3e06b5f88edf6551f8b5db)
yuha commented 2024-11-23 16:04:37 +01:00 (Migrated from edugit.org)

added 1 commit

  • 3e06c764 - WIP: Cut existing absences on absence creation to avoid overlaps

Compare with previous version

added 1 commit <ul><li>3e06c764 - WIP: Cut existing absences on absence creation to avoid overlaps</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=50730&start_sha=2f14ace5db7323a1e7163660f5f0d2379710474f)
yuha commented 2024-11-27 10:56:10 +01:00 (Migrated from edugit.org)

added 1 commit

  • 4e97b71b - Cut existing absences on absence creation to avoid overlaps

Compare with previous version

added 1 commit <ul><li>4e97b71b - Cut existing absences on absence creation to avoid overlaps</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=50877&start_sha=3e06c764737b2449770eeedfab53389b8be239f2)
yuha commented 2024-11-27 12:25:17 +01:00 (Migrated from edugit.org)

added 2 commits

  • 66f22cdd - Fix handling of new absences cutting existing ones in two halves
  • 01db56c4 - WIP: Handle overlapping absences with same reason correctly

Compare with previous version

added 2 commits <ul><li>66f22cdd - Fix handling of new absences cutting existing ones in two halves</li><li>01db56c4 - WIP: Handle overlapping absences with same reason correctly</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=50881&start_sha=4e97b71b008d934b4d306f86ec6a395c8571f8a0)
yuha commented 2024-11-27 12:32:20 +01:00 (Migrated from edugit.org)

@hansegucker @ZugBahnHof two questions:

  1. We should probably inform the user in case of overlapping absences and the consequences of creating/editing an absence in a way that leads to overlaps (cuts to existing absences). How exactly should this happen? I'd think of something like the overview step when creating absences in the coursebook that shows which lessons will be affected.
  2. This is more related to Alsijils use of Kolego absences, but how exactly should instances that relate to Kolego absences be updates in case these said absences change?
@hansegucker @ZugBahnHof two questions: 1. We should probably inform the user in case of overlapping absences and the consequences of creating/editing an absence in a way that leads to overlaps (cuts to existing absences). How exactly should this happen? I'd think of something like the overview step when creating absences in the coursebook that shows which lessons will be affected. 2. This is more related to Alsijils use of Kolego absences, but how exactly should instances that relate to Kolego absences be updates in case these said absences change?
yuha commented 2024-11-27 12:36:17 +01:00 (Migrated from edugit.org)

apart from that, TODO: There are now use cases for which trying to create an absence does not actually lead to an absence being created (when overlaps exist with pre-existing absences that share the same absence reason; this leads to a merge, reflected in the existing absence being updated which seems semantically correct to me). This causes problems with graphene for now since create mutations depend on the obj being created & saved having an ID to return. Probably the logic for handling overlaps should be moved to some custom mutation instead?

apart from that, TODO: There are now use cases for which trying to create an absence does not actually lead to an absence being created (when overlaps exist with pre-existing absences that share the same absence reason; this leads to a merge, reflected in the existing absence being updated which seems semantically correct to me). This causes problems with graphene for now since create mutations depend on the obj being created & saved having an ID to return. Probably the logic for handling overlaps should be moved to some custom mutation instead?
yuha commented 2024-11-28 15:17:31 +01:00 (Migrated from edugit.org)

second one can be ignore – alsijil already does that

second one can be ignore – alsijil already does that
yuha commented 2024-11-28 15:17:48 +01:00 (Migrated from edugit.org)

first one goes into follow-up issue

first one goes into follow-up issue
yuha commented 2024-11-28 15:18:26 +01:00 (Migrated from edugit.org)

created #35 to continue this discussion

created #35 to continue this discussion
yuha commented 2024-11-28 15:18:27 +01:00 (Migrated from edugit.org)

mentioned in issue #35

mentioned in issue #35
yuha commented 2024-11-29 01:23:53 +01:00 (Migrated from edugit.org)

resolved all threads

resolved all threads
yuha commented 2024-11-29 01:26:38 +01:00 (Migrated from edugit.org)

added 1 commit

  • 178874bc - Handle overlapping absences with same reason correctly

Compare with previous version

added 1 commit <ul><li>178874bc - Handle overlapping absences with same reason correctly</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=50960&start_sha=01db56c40a0c0030f51edd2585c687af2938df79)
yuha commented 2024-11-29 01:26:57 +01:00 (Migrated from edugit.org)

TODO: Refresh absences list after save

TODO: Refresh absences list after save
yuha commented 2024-11-29 01:27:59 +01:00 (Migrated from edugit.org)

TODO/to discuss: what should happen with absences that get deleted because their time span is now fully covered by a newly created/edited absence but that are used as the reference absence in existing participation statuses?

TODO/to discuss: what should happen with absences that get deleted because their time span is now fully covered by a newly created/edited absence but that are used as the reference absence in existing participation statuses?
yuha commented 2024-11-29 01:28:21 +01:00 (Migrated from edugit.org)

@hansegucker

probably we should just replace the reference values – but how?

@hansegucker probably we should just replace the reference values – but how?
hansegucker commented 2024-11-29 10:41:26 +01:00 (Migrated from edugit.org)

Yeah, we should update those references beforehand.

  1. Create new absence
  2. Update references
  3. Delete old absence
Yeah, we should update those references beforehand. 1. Create new absence 2. Update references 3. Delete old absence
yuha commented 2024-11-30 15:18:00 +01:00 (Migrated from edugit.org)

added 4 commits

  • 50eee039 - Refresh absence list on create/edit
  • 21569732 - Add basic tests
  • 0a0cabbf - Fix handling of new absences outside of existing ones
  • 6b58dad8 - Fix call of parent save method

Compare with previous version

added 4 commits <ul><li>50eee039 - Refresh absence list on create/edit</li><li>21569732 - Add basic tests</li><li>0a0cabbf - Fix handling of new absences outside of existing ones</li><li>6b58dad8 - Fix call of parent save method</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=51016&start_sha=178874bc1ea84c11a91a0b5f5391c6e8f1ed700c)
yuha commented 2024-11-30 16:13:10 +01:00 (Migrated from edugit.org)

added 3 commits

  • 94361e86 - Add basic tests
  • 7cf98d40 - Fix handling of new absences outside of existing ones
  • 6bf75d9c - Fix call of parent save method

Compare with previous version

added 3 commits <ul><li>94361e86 - Add basic tests</li><li>7cf98d40 - Fix handling of new absences outside of existing ones</li><li>6bf75d9c - Fix call of parent save method</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=51043&start_sha=6b58dad83acfd6201a6a4ea3ac4c75db1795b7b0)
yuha commented 2024-12-01 12:55:00 +01:00 (Migrated from edugit.org)

added 2 commits

  • f0729721 - Fix handling of overlapping absences with same reason and person
  • 8ced4059 - Correctly return modified objects in mutation

Compare with previous version

added 2 commits <ul><li>f0729721 - Fix handling of overlapping absences with same reason and person</li><li>8ced4059 - Correctly return modified objects in mutation</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=51151&start_sha=6bf75d9c087721cc61e1a49c2e14d8caa76b99bf)
yuha commented 2024-12-01 14:19:51 +01:00 (Migrated from edugit.org)

TODO: actually remove absences from CRUD list when saving leads to deletion (somehow update apollo cache)

TODO: actually remove absences from CRUD list when saving leads to deletion (somehow update apollo cache)
yuha commented 2024-12-01 14:20:08 +01:00 (Migrated from edugit.org)

created #36 to continue this discussion

created #36 to continue this discussion
yuha commented 2024-12-01 14:20:08 +01:00 (Migrated from edugit.org)

mentioned in issue #36

mentioned in issue #36
yuha commented 2024-12-01 18:26:01 +01:00 (Migrated from edugit.org)

added 2 commits

  • 4838125c - Add classmethod that gets/creates one absence for given time span
  • c4ddcca2 - Reformat

Compare with previous version

added 2 commits <ul><li>4838125c - Add classmethod that gets/creates one absence for given time span</li><li>c4ddcca2 - Reformat</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=51197&start_sha=8ced4059db4b18c0d355581a78c0f2f503ef7ebc)
yuha commented 2024-12-01 18:26:50 +01:00 (Migrated from edugit.org)

resolved all threads

resolved all threads
yuha commented 2024-12-01 18:27:06 +01:00 (Migrated from edugit.org)

assigned to @hansegucker and unassigned @yuha

assigned to @hansegucker and unassigned @yuha
yuha commented 2024-12-01 18:27:08 +01:00 (Migrated from edugit.org)

marked this merge request as ready

marked this merge request as **ready**
hansegucker commented 2024-12-01 19:00:57 +01:00 (Migrated from edugit.org)

added 2 commits

  • 812c00fe - Refactor overlapping logic
  • a7a6b029 - Add migration for existing overlapping absences

Compare with previous version

added 2 commits <ul><li>812c00fe - Refactor overlapping logic</li><li>a7a6b029 - Add migration for existing overlapping absences</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Kolego/-/merge_requests/52/diffs?diff_id=51209&start_sha=c4ddcca20836bcd3fb5a29d24d8fb6b89e2b80dc)
hansegucker commented 2024-12-01 21:24:07 +01:00 (Migrated from edugit.org)
                else datetime.combine(self.date_start, time.min)
```suggestion:-0+0 else datetime.combine(self.date_start, time.min) ```
hansegucker commented 2024-12-01 21:24:07 +01:00 (Migrated from edugit.org)
                else datetime.combine(self.date_end, time.max)
```suggestion:-0+0 else datetime.combine(self.date_end, time.max) ```
hansegucker commented 2024-12-01 21:24:07 +01:00 (Migrated from edugit.org)
    def save(self, *args, skip_overlap_handling: bool=False, **kwargs):
```suggestion:-0+0 def save(self, *args, skip_overlap_handling: bool=False, **kwargs): ```
hansegucker commented 2024-12-01 21:24:07 +01:00 (Migrated from edugit.org)
                else datetime.combine(self.date_start, datetime.time.min)
```suggestion:-0+0 else datetime.combine(self.date_start, datetime.time.min) ```
hansegucker commented 2024-12-01 21:24:07 +01:00 (Migrated from edugit.org)
                else datetime.combine(self.date_end, datetime.time.max)
```suggestion:-0+0 else datetime.combine(self.date_end, datetime.time.max) ```
hansegucker commented 2024-12-01 21:24:08 +01:00 (Migrated from edugit.org)
                    event_within.datetime_start
```suggestion:-0+0 event_within.datetime_start ```
hansegucker commented 2024-12-01 21:24:08 +01:00 (Migrated from edugit.org)
                    event_within.datetime_end
```suggestion:-0+0 event_within.datetime_end ```
hansegucker commented 2024-12-01 21:24:24 +01:00 (Migrated from edugit.org)

resolved all threads

resolved all threads
hansegucker (Migrated from edugit.org) merged commit 7bac57ffa5 into master 2024-12-01 21:24:30 +01:00
hansegucker commented 2024-12-01 21:24:31 +01:00 (Migrated from edugit.org)

mentioned in commit 7bac57ffa5

mentioned in commit 7bac57ffa5b56161f7e537bacd127492cd8a5a3c
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS-App-Kolego!115
No description provided.