Esempio n. 1
0
    def resolve_upcoming_meetings(self, info):
        user = info.context.user
        if isinstance(user, DomainInstructor):
            meetings = meeting_api(info).get_meetings_of_instructor(
                user.user_name)
        else:
            meetings = meeting_api(info).get_meetings_of_student(
                user.student_number)

        return [Meeting.from_domain(meeting) for meeting in meetings]
Esempio n. 2
0
 def mutate(self, info, instructor, office_hour_id, index, start_time):
     student = info.context.user
     instructor = instructor_api(info).get_instructor(instructor).unwrap()
     return (meeting_api(info).create_meeting(
         instructor, student, office_hour_id, index,
         start_time).map(Meeting.from_domain).unwrap())
Esempio n. 3
0
 def mutate(self, info, note_id):
     return (meeting_api(info).delete_note(
         note_id, info.context.user).map(DeleteNote).unwrap())
Esempio n. 4
0
 def mutate(self, info, meeting_id, content_text):
     return (meeting_api(info).create_note(meeting_id, info.context.user,
                                           content_text).map(
                                               Note.from_domain).unwrap())
Esempio n. 5
0
 def mutate(self, info, meeting_id):
     user = info.context.user
     return (meeting_api(info).delete_meeting(
         meeting_id, user).map(DeleteMeeting).unwrap())
Esempio n. 6
0
 def resolve_meeting(self, info, meeting_id):
     return (meeting_api(info).get_meeting(meeting_id).map_or(
         Meeting.from_domain, None))
Esempio n. 7
0
 def resolve_meetings(self, info, office_hour_id, start_time, end_time):
     return [
         Meeting.from_domain(meeting) for meeting in meeting_api(
             info).get_meetings_of_officehour_for_date(
                 office_hour_id, start_time, end_time)
     ]