1- from datetime import datetime
1+ from datetime import date
22
3- from pydantic import BaseModel
3+ from pydantic import BaseModel , Field
44
5- from officers .constants import OfficerPositionEnum
5+ from officers .constants import OFFICER_LEGAL_NAME_MAX , OfficerPositionEnum
66
77
8- class BaseOfficerModel (BaseModel ):
8+ class OfficerBaseModel (BaseModel ):
99 # TODO (#71): compute this using SFU's API & remove from being uploaded
10- legal_name : str
10+ legal_name : str = Field (..., max_length = OFFICER_LEGAL_NAME_MAX )
1111 position : OfficerPositionEnum
12- start_date : datetime
13- end_date : str | None = None
12+ start_date : date
13+ end_date : date | None = None
1414
15- class PublicOfficerResponse (BaseOfficerModel ):
15+ class PublicOfficerResponse (OfficerBaseModel ):
1616 """
1717 Response when fetching public officer data
1818 """
@@ -33,17 +33,17 @@ class PrivateOfficerResponse(PublicOfficerResponse):
3333 github_username : str | None = None
3434 google_drive_email : str | None = None
3535
36- class OfficerTermCreate (BaseOfficerModel ):
37- """
38- Create a new Officer term
39- """
36+ class OfficerTermBaseModel (BaseModel ):
4037 computing_id : str
41-
42- class OfficerTermUpdate (BaseModel ):
43- """
44- Update an Officer Term
45- """
46- legal_name : str | None = None
47- position : OfficerPositionEnum | None = None
48- start_date : datetime | None = None
49- end_date : datetime | None = None
38+ position : OfficerPositionEnum
39+ start_date : date
40+
41+ class OfficerTermResponse (OfficerTermBaseModel ):
42+ id : int
43+ end_date : date | None = None
44+ favourite_course_0 : str | None = None
45+ favourite_course_1 : str | None = None
46+ favourite_pl_0 : str | None = None
47+ favourite_pl_1 : str | None = None
48+ biography : str | None = None
49+ photo_url : str | None = None
0 commit comments