@@ -31,28 +31,28 @@ def register_course(self, name: str, places: int) -> CourseID:
3131 self .save (course )
3232 return course .id
3333
34- def join_course (self , student_id : str , course_id : str ) -> None :
34+ def join_course (self , student_id : StudentID , course_id : CourseID ) -> None :
3535 course = self .get_course (course_id )
3636 student = self .get_student (student_id )
3737 course .accept_student (student_id )
3838 student .join_course (course_id )
3939 self .save (course , student )
4040
41- def list_students_for_course (self , course_id : str ) -> list [str ]:
41+ def list_students_for_course (self , course_id : CourseID ) -> list [str ]:
4242 course = self .get_course (course_id )
4343 return [self .get_student (s ).name for s in course .student_ids ]
4444
45- def list_courses_for_student (self , student_id : str ) -> list [str ]:
45+ def list_courses_for_student (self , student_id : StudentID ) -> list [str ]:
4646 student = self .get_student (student_id )
4747 return [self .get_course (s ).name for s in student .course_ids ]
4848
49- def get_student (self , student_id : str ) -> Student :
49+ def get_student (self , student_id : StudentID ) -> Student :
5050 try :
5151 return self .repository .get (student_id )
5252 except AggregateNotFoundError :
5353 raise StudentNotFoundError from None
5454
55- def get_course (self , course_id : str ) -> Course :
55+ def get_course (self , course_id : CourseID ) -> Course :
5656 try :
5757 return self .repository .get (course_id )
5858 except AggregateNotFoundError :
0 commit comments