forked from CodieTamida/CPSC-449-Project2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
164 lines (125 loc) · 3.61 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel
from enum import Enum
class AvailableClass(BaseModel):
course_code: str
course_name: str
department: str
instructor_first_name: str
instructor_last_name: str
current_enrollment: int
max_enrollment: int
waitlist: int
section_number: int
class AvailableClassResponse(BaseModel):
available_classes: List[AvailableClass]
class EnrollmentResponse(BaseModel):
enrollment_status: str
enrollment_date: Optional[datetime] = None
class EnrollmentRequest(BaseModel):
section_number: int
course_code: str
student_id: int
class RegistrationStatus(str, Enum):
ENROLLED = 'enrolled'
WAITLISTED = 'waitlisted'
NOT_ELIGIBLE = 'not_eligible'
DROPPED = "dropped"
ALREADY_ENROLLED = "already_enrolled"
class Registration(BaseModel):
section_number: int #Section Number
student_id: int
enrollment_status: str
course_code: str
class QueryStatus(str, Enum):
SUCCESS = "success"
FAILED = "failed"
class UserRole(str, Enum):
STUDENT = "student"
INSTRUCTOR = "instructor"
REGISTRAR = "registrar"
NOT_FOUND = "not_found"
class DropCourseResponse(BaseModel):
course_code: str
section_number: int
status: str
class AddClassRequest(BaseModel):
course_code: str
class_name: str
department: str
section_number: int
instructor_id: int
max_enrollment: int
class AddClassResponse(BaseModel):
addClass_status: str
class DeleteSectionResponse(BaseModel):
deleteSection_status: str
class DeleteSectionRequest(BaseModel):
course_code: str
section_number: int
class ChangeInstructorResponse(BaseModel):
changeInstructor_status: str
class ChangeInstructorRequest(BaseModel):
course_code: str
section_number: int
instructor_id: int
class FreezeEnrollmentResponse(BaseModel):
freezeEnrollment_status: str
class FreezeEnrollmentRequest(BaseModel):
course_code: str
section_number: int
# instructor models
class EnrollmentListResponse(BaseModel):
student_cwid: int
student_first_name: str
student_last_name: str
course_code: str
section_number: int
class_name: str
status: str
class RecordsEnrollmentResponse(BaseModel):
enrolled_students: List[EnrollmentListResponse]
class RecordsDroppedResponse(BaseModel):
dropped_students: List[EnrollmentListResponse]
class WaitlistPositionReq(BaseModel):
# section_number: int
# course_code: str
student_id: int
class WaitlistPositionList(BaseModel):
section_number: int
course_code: str
waitlist_position: int
class WaitlistPositionRes(BaseModel):
waitlist_positions: List[WaitlistPositionList]
class ViewWaitlistReq(BaseModel):
section_number: int
course_code: str
class WaitlistStudents(BaseModel):
student_id: int
student_name: str
enrollment_date: datetime
class ViewWaitlistRes(BaseModel):
waitlisted_students: List[WaitlistStudents]
#Waitlist
class WaitlistPositionList(BaseModel):
section_number: int
course_code: str
waitlist_position: int
class WaitlistPositionRes(BaseModel):
waitlist_positions: List[WaitlistPositionList]
class RemoveWaitlistReq(BaseModel):
student_id: int
section_number: int
course_code: str
class ViewWaitlistReq(BaseModel):
section_number: int
course_code: str
class WaitlistStudents(BaseModel):
student_id: int
student_name: str
enrollment_date: datetime
class ViewWaitlistRes(BaseModel):
waitlisted_students: List[WaitlistStudents]
class RemoveFromWaitlistRes(BaseModel):
status: str