Skip to content
Snippets Groups Projects
Commit 0aca9c6d authored by permcu's avatar permcu
Browse files

WIP Update sketch

parent de5d2f94
No related branches found
No related tags found
1 merge request!361Resolve "Add statistics page for absences"
# Use core persons query
query persons { query persons {
persons: persons { persons: persons {
id id
......
...@@ -38,7 +38,7 @@ class Query(graphene.ObjectType): ...@@ -38,7 +38,7 @@ class Query(graphene.ObjectType):
courses_of_person = FilterOrderList(CourseType, person=graphene.ID()) courses_of_person = FilterOrderList(CourseType, person=graphene.ID())
lessons_for_persons = FilterOrderList( lessons_for_persons = FilterOrderList(
PersonAbsencesType??, LessonForPerson, # person graphene.List(LessonEvent)
persons=graphene.List(graphene.ID, required=True), persons=graphene.List(graphene.ID, required=True),
start=graphene.Date(required=True), start=graphene.Date(required=True),
end=graphene.Date(required=True), end=graphene.Date(required=True),
...@@ -134,21 +134,32 @@ class Query(graphene.ObjectType): ...@@ -134,21 +134,32 @@ class Query(graphene.ObjectType):
# Do date like resolve_documentations_for_coursebook? # Do date like resolve_documentations_for_coursebook?
# Get all lesson events for person # 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 ...)) # Pack into (id fullname lesson (start end course subject ...))
event_params = { 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( events = LessonEvent.get_single_events(
start, start,
end, end,
request??, None,
event_params, event_params,
with_reference_object=True, with_reference_object=True,
) )
return [id
get_single_events -> python object ical
# Use own graphene types (wrapper, & event
# then populate them here
return return
class Mutation(graphene.ObjectType): class Mutation(graphene.ObjectType):
......
...@@ -18,6 +18,7 @@ class AbsencesBatchCreateMutation(graphene.Mutation): ...@@ -18,6 +18,7 @@ class AbsencesBatchCreateMutation(graphene.Mutation):
# has lesson event lookup as well & returns real & fake documentations # has lesson event lookup as well & returns real & fake documentations
# => extract & reuse the documentation lookup) # => extract & reuse the documentation lookup)
# Create a ParticipationStatus for each documentation # Create a ParticipationStatus for each documentation
# (OR if no documentation and in past create documentation)
# If there are any LessonEvents without a documentation # If there are any LessonEvents without a documentation
# create a Kolego Absence for the whole duration # create a Kolego Absence for the whole duration
# Return ok=True if everything went well. # Return ok=True if everything went well.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment