source: main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py @ 17326

Last change on this file since 17326 was 17255, checked in by Henrik Bettermann, 2 years ago

Add ExportPDFTishipSlip.

  • Property svn:keywords set to Id
File size: 8.9 KB
Line 
1## $Id: interfaces.py 17255 2023-01-03 17:40:18Z henrik $
2##
3## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18
19from zope import schema
20from waeup.kofa.interfaces import (
21    validate_email, IKofaObject,
22    academic_sessions_vocab)
23from waeup.kofa.students.vocabularies import StudyLevelSource
24from kofacustom.nigeria.interfaces import GradingSystemSource
25from kofacustom.nigeria.students.interfaces import (
26    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
27    INigeriaStudentPersonal, INigeriaStudentPersonalEdit,
28    INigeriaStudentStudyLevel,
29    INigeriaStudentStudyCourse, INigeriaCourseTicket,
30    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
31    )
32from waeup.uniben.payments.interfaces import ICustomOnlinePayment
33from waeup.uniben.interfaces import MessageFactory as _
34
35
36class ICustomStudentBase(INigeriaStudentBase):
37    """Representation of student base data.
38    """
39
40    library = schema.Bool(
41        title = _(u'Library Id Card'),
42        default = False,
43        required = False,
44        )
45
46    email2 = schema.ASCIILine(
47        title = _(u'Institution Email'),
48        required = False,
49        constraint=validate_email,
50        )
51
52ICustomStudentBase['email2'].order = ICustomStudentBase[
53    'phone'].order
54ICustomStudentBase['phone'].order = ICustomStudentBase[
55    'email'].order
56
57class IMedicalHistory(IKofaObject):
58    """Students Medical History Questionnaire.
59    """
60
61    medical_updated = schema.Datetime(
62        title = _(u'Last updated'),
63        required = False,
64        readonly = False,
65        )
66
67    # History of Symptoms
68
69    fever = schema.Bool(
70        title = _(u'Fever'),
71        default = False,
72        required = True,
73        )
74
75    headaches = schema.Bool(
76        title = _(u'Headaches'),
77        default = False,
78        required = True,
79        )
80
81    catarrh = schema.Bool(
82        title = _(u'Catarrh'),
83        default = False,
84        required = True,
85        )
86
87    cough = schema.Bool(
88        title = _(u'Cough'),
89        default = False,
90        required = True,
91        )
92
93    sore_throat = schema.Bool(
94        title = _(u'Sore throat'),
95        default = False,
96        required = True,
97        )
98
99    breathing = schema.Bool(
100        title = _(u'Difficulty with breathing'),
101        default = False,
102        required = True,
103        )
104
105    sneezing = schema.Bool(
106        title = _(u'Sneezing'),
107        default = False,
108        required = True,
109        )
110
111    weakness = schema.Bool(
112        title = _(u'Weakness/tiredness'),
113        default = False,
114        required = True,
115        )
116
117    body_pains = schema.Bool(
118        title = _(u'Body pains'),
119        default = False,
120        required = True,
121        )
122
123    smell = schema.Bool(
124        title = _(u'Loss of smell (inability to smell)'),
125        default = False,
126        required = True,
127        )
128
129    taste = schema.Bool(
130        title = _(u'Loss of taste'),
131        default = False,
132        required = True,
133        )
134
135    # Medical History
136
137    asthma = schema.Bool(
138        title = _(u'Asthma'),
139        default = False,
140        required = True,
141        )
142
143    hypertension = schema.Bool(
144        title = _(u'Hypertension'),
145        default = False,
146        required = True,
147        )
148
149    diabetes = schema.Bool(
150        title = _(u'Diabetes'),
151        default = False,
152        required = True,
153        )
154
155    obesity = schema.Bool(
156        title = _(u'Obesity'),
157        default = False,
158        required = True,
159        )
160
161    others = schema.TextLine(
162        title = _(u'Others'),
163        required = False,
164        )
165
166    medicines = schema.TextLine(
167        title = _(u'Are you on a regular medication? If yes, list the medicines'),
168        required = False,
169        )
170
171    # Travel History
172
173    lagos_abuja = schema.Bool(
174        title = _(u'Have you travelled to Lagos or Abuja in the last two weeks?'),
175        default = False,
176        required = True,
177        )
178
179    outside = schema.Bool(
180        title = _(u'Have you travelled outside the country in the last 4 weeks?'),
181        default = False,
182        required = True,
183        )
184
185    # History of contact/infection
186
187    company_suspected = schema.Bool(
188        title = _(u'Were you in the company of a suspected case of COVID 19 in the last two weeks?'),
189        default = False,
190        required = True,
191        )
192
193    company_confirmed = schema.Bool(
194        title = _(u'Were you in the company of a confirmed case of COVID 19 in the last two weeks?'),
195        default = False,
196        required = True,
197        )
198
199    positive = schema.Bool(
200        title = _(u'Have you had a positive COVID 19 test done?'),
201        default = False,
202        required = True,
203        )
204
205    negative = schema.Bool(
206        title = _(u'Have you had a negative COVID 19 test done?'),
207        default = False,
208        required = True,
209        )
210
211    vaccination = schema.Bool(
212        title = _(u'Have you had COVID 19 vaccination?'),
213        default = False,
214        required = True,
215        )
216
217
218    # Tiship form
219
220    genotype = schema.TextLine(
221        title = _(u'Genotype'),
222        required = False,
223        )
224
225    bloodgroup = schema.TextLine(
226        title = _(u'Blood Group'),
227        required = False,
228        )
229
230class ICustomStudentPersonal(INigeriaStudentPersonal):
231    """Student personal data.
232    """
233
234    parent_email = schema.ASCIILine(
235        title = _(u'Parent Email'),
236        required = False,
237        constraint=validate_email,
238        )
239
240class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit):
241    """Interface for editing personal data by students.
242    """
243
244    parent_email = schema.ASCIILine(
245        title = _(u'Parent Email'),
246        required = False,
247        constraint=validate_email,
248        )
249
250class ICustomUGStudentClearance(INigeriaUGStudentClearance):
251    """Representation of ug student clearance data.
252    """
253
254class ICustomPGStudentClearance(INigeriaPGStudentClearance):
255    """Representation of pg student clearance data.
256    """
257
258class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance,
259    ICustomPGStudentClearance, ICustomStudentPersonal, IMedicalHistory):
260    """Representation of a student.
261    """
262
263class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
264    """A container for student study levels.
265    """
266
267class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
268    """A container for course tickets.
269    """
270
271class ICustomStudentOnlinePayment(ICustomOnlinePayment):
272    """A student payment via payment gateways.
273
274    This Interface does not inherit from IStudentOnlinePayment.
275    Thus all fields from IStudentOnlinePayment have to be repeated here.
276    """
277
278    p_current = schema.Bool(
279        title = _(u'Current Session Payment'),
280        default = True,
281        required = False,
282        )
283
284    p_level = schema.Choice(
285        title = _(u'Payment Level'),
286        source = StudyLevelSource(),
287        required = False,
288        )
289
290    staff_rebate = schema.Bool(
291        title = _(u'Staff Rebate Payment'),
292        default = False,
293        required = False,
294        )
295
296    rebate_amount = schema.Float(
297        title = _(u'Rebate'),
298        default = 0.0,
299        required = False,
300        readonly = False,
301        )
302
303ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
304    'p_session'].order
305
306class ICustomCourseTicket(INigeriaCourseTicket):
307    """A course ticket.
308    """
309
310    grading_sys = schema.Choice(
311        title = _(u'Grading System'),
312        source = GradingSystemSource(),
313        required = True,
314        default = 'A',
315        )
316
317class ICustomCourseTicketImport(ICustomCourseTicket):
318    """An interface for importing course results and nothing more.
319    """
320
321    score = schema.Int(
322        title = _(u'Score'),
323        required = False,
324        readonly = False,
325        )
326
327    level_session = schema.Choice(
328        title = _(u'Level Session'),
329        source = academic_sessions_vocab,
330        required = False,
331        readonly = False,
332        )
333
334    grading_sys = schema.Choice(
335        title = _(u'Grading System'),
336        source = GradingSystemSource(),
337        required = False,
338        default = 'A',
339        )
340
341class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
342    """Representation of a student. Skip regular reg_number validation.
343    """
344
345class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
346    """Representation of a student. Skip regular matric_number validation.
347    """
Note: See TracBrowser for help on using the repository browser.