Skip to content
Snippets Groups Projects
Commit 87d26d33 authored by permcu's avatar permcu Committed by Julian
Browse files

WIP Update sketch

parent 72941ea3
No related branches found
No related tags found
1 merge request!360Resolve "Add absence management to course book student dialog"
# Use core persons query
query persons {
persons: persons {
id
......
......@@ -39,7 +39,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),
......@@ -135,21 +135,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):
......
......@@ -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.
......
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