diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/absenceCreation.graphql b/aleksis/apps/alsijil/frontend/components/coursebook/absences/absenceCreation.graphql index 6c73bfad4b62c02ce8ee598edfc7893324058a26..130b5cabbfa80b59b053734dec055696a8be776d 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/absenceCreation.graphql +++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/absenceCreation.graphql @@ -1,3 +1,4 @@ +# Use core persons query query persons { persons: persons { id diff --git a/aleksis/apps/alsijil/schema/__init__.py b/aleksis/apps/alsijil/schema/__init__.py index 029a12e5be9fec566dbf8bdaf95e4689af74b992..fd813944bef7f154959a0da3f804d4da22849645 100644 --- a/aleksis/apps/alsijil/schema/__init__.py +++ b/aleksis/apps/alsijil/schema/__init__.py @@ -38,7 +38,7 @@ class Query(graphene.ObjectType): courses_of_person = FilterOrderList(CourseType, person=graphene.ID()) lessons_for_persons = FilterOrderList( - PersonAbsencesType??, + LessonForPerson, # person graphene.List(LessonEvent) persons=graphene.List(graphene.ID, required=True), start=graphene.Date(required=True), end=graphene.Date(required=True), @@ -134,21 +134,32 @@ class Query(graphene.ObjectType): # Do date like resolve_documentations_for_coursebook? # Get all lesson events for person - # Make this reusable for mutation + # Make this reusable for mutation -> Einzeiler # Pack into (id fullname lesson (start end course subject ...)) - + event_params = { - "" + "type": "PARTICIPANT", + "obj_id": PERSON_ID, } + # get_objects (lesson_events chronos models.py) + # adapt own -> person as param + # _put list of person IDs in event_params_ + events = LessonEvent.get_single_events( start, end, - request??, + None, event_params, with_reference_object=True, ) + return [id + + get_single_events -> python object ical + # Use own graphene types (wrapper, & event + # then populate them here + return class Mutation(graphene.ObjectType): diff --git a/aleksis/apps/alsijil/schema/absences.py b/aleksis/apps/alsijil/schema/absences.py index f7c27a92bd80afcc2cfedbb52ce6c3c0c9b458fe..323ceb1926c998fe1ed394610f9d31d0140d5f4b 100644 --- a/aleksis/apps/alsijil/schema/absences.py +++ b/aleksis/apps/alsijil/schema/absences.py @@ -18,6 +18,7 @@ class AbsencesBatchCreateMutation(graphene.Mutation): # has lesson event lookup as well & returns real & fake documentations # => extract & reuse the documentation lookup) # Create a ParticipationStatus for each documentation + # (OR if no documentation and in past create documentation) # If there are any LessonEvents without a documentation # create a Kolego Absence for the whole duration # Return ok=True if everything went well.