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

Last change on this file since 17835 was 17835, checked in by Henrik Bettermann, 2 months ago

Improve NYSCExporter.

  • Property svn:keywords set to Id
File size: 9.8 KB
Line 
1## $Id: interfaces.py 17835 2024-07-08 16:05:10Z 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 waeup.kofa.schema import FormattedDate
26from kofacustom.nigeria.students.interfaces import (
27    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
28    INigeriaStudentPersonal, INigeriaStudentPersonalEdit,
29    INigeriaStudentStudyLevel,
30    INigeriaStudentStudyCourse, INigeriaCourseTicket,
31    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
32    )
33from waeup.uniben.payments.interfaces import ICustomOnlinePayment
34from waeup.uniben.interfaces import MessageFactory as _
35
36
37class ICustomStudentBase(INigeriaStudentBase):
38    """Representation of student base data.
39    """
40
41    library = schema.Bool(
42        title = _(u'Library Id Card'),
43        default = False,
44        required = False,
45        )
46
47    email2 = schema.ASCIILine(
48        title = _(u'Institution Email'),
49        required = False,
50        constraint=validate_email,
51        )
52
53ICustomStudentBase['email2'].order = ICustomStudentBase[
54    'phone'].order
55ICustomStudentBase['phone'].order = ICustomStudentBase[
56    'email'].order
57
58class IMedicalHistory(IKofaObject):
59    """Students Medical History Questionnaire.
60    """
61
62    medical_updated = schema.Datetime(
63        title = _(u'Last updated'),
64        required = False,
65        readonly = False,
66        )
67
68    # History of Symptoms
69
70    fever = schema.Bool(
71        title = _(u'Fever'),
72        default = False,
73        required = True,
74        )
75
76    headaches = schema.Bool(
77        title = _(u'Headaches'),
78        default = False,
79        required = True,
80        )
81
82    catarrh = schema.Bool(
83        title = _(u'Catarrh'),
84        default = False,
85        required = True,
86        )
87
88    cough = schema.Bool(
89        title = _(u'Cough'),
90        default = False,
91        required = True,
92        )
93
94    sore_throat = schema.Bool(
95        title = _(u'Sore throat'),
96        default = False,
97        required = True,
98        )
99
100    breathing = schema.Bool(
101        title = _(u'Difficulty with breathing'),
102        default = False,
103        required = True,
104        )
105
106    sneezing = schema.Bool(
107        title = _(u'Sneezing'),
108        default = False,
109        required = True,
110        )
111
112    weakness = schema.Bool(
113        title = _(u'Weakness/tiredness'),
114        default = False,
115        required = True,
116        )
117
118    body_pains = schema.Bool(
119        title = _(u'Body pains'),
120        default = False,
121        required = True,
122        )
123
124    smell = schema.Bool(
125        title = _(u'Loss of smell (inability to smell)'),
126        default = False,
127        required = True,
128        )
129
130    taste = schema.Bool(
131        title = _(u'Loss of taste'),
132        default = False,
133        required = True,
134        )
135
136    # Medical History
137
138    asthma = schema.Bool(
139        title = _(u'Asthma'),
140        default = False,
141        required = True,
142        )
143
144    hypertension = schema.Bool(
145        title = _(u'Hypertension'),
146        default = False,
147        required = True,
148        )
149
150    diabetes = schema.Bool(
151        title = _(u'Diabetes'),
152        default = False,
153        required = True,
154        )
155
156    obesity = schema.Bool(
157        title = _(u'Obesity'),
158        default = False,
159        required = True,
160        )
161
162    others = schema.TextLine(
163        title = _(u'Others'),
164        required = False,
165        )
166
167    medicines = schema.TextLine(
168        title = _(u'Are you on a regular medication? If yes, list the medicines'),
169        required = False,
170        )
171
172    # Travel History
173
174    lagos_abuja = schema.Bool(
175        title = _(u'Have you travelled to Lagos or Abuja in the last two weeks?'),
176        default = False,
177        required = True,
178        )
179
180    outside = schema.Bool(
181        title = _(u'Have you travelled outside the country in the last 4 weeks?'),
182        default = False,
183        required = True,
184        )
185
186    # History of contact/infection
187
188    company_suspected = schema.Bool(
189        title = _(u'Were you in the company of a suspected case of COVID 19 in the last two weeks?'),
190        default = False,
191        required = True,
192        )
193
194    company_confirmed = schema.Bool(
195        title = _(u'Were you in the company of a confirmed case of COVID 19 in the last two weeks?'),
196        default = False,
197        required = True,
198        )
199
200    positive = schema.Bool(
201        title = _(u'Have you had a positive COVID 19 test done?'),
202        default = False,
203        required = True,
204        )
205
206    negative = schema.Bool(
207        title = _(u'Have you had a negative COVID 19 test done?'),
208        default = False,
209        required = True,
210        )
211
212    vaccination = schema.Bool(
213        title = _(u'Have you had COVID 19 vaccination?'),
214        default = False,
215        required = True,
216        )
217
218class INYSC(IKofaObject):
219    """Student NYSC data.
220    """
221
222    nysc = schema.Bool(
223        title = u'NYSC',
224        default = False,
225        required = True,
226        )
227
228    nysc_processed = schema.Bool(
229        title = u'NYSC processed',
230        default = False,
231        required = True,
232        )
233
234    nysc_updated = schema.Datetime(
235        title = _(u'NYSC request data last updated by student'),
236        )
237
238    nysc_date_of_graduation = FormattedDate(
239        title = _(u'Date of Graduation'),
240        required = False,
241        show_year = True,
242        )
243
244    nysc_senate_info = schema.TextLine(
245        title = _(u'Senate Info'),
246        required = False,
247        description = u'Sample: Meeting Date: 10TH MAY 2023. DEG CLASS: FIRST CLASS. S/NO: 01',
248        )
249
250class ITiship(IKofaObject):
251    """Student tiship data.
252    """
253
254    genotype = schema.TextLine(
255        title = _(u'Genotype'),
256        required = False,
257        )
258
259    bloodgroup = schema.TextLine(
260        title = _(u'Blood Group'),
261        required = False,
262        )
263
264class ICustomStudentPersonal(INigeriaStudentPersonal):
265    """Student personal data.
266    """
267
268    parent_email = schema.ASCIILine(
269        title = _(u'Parent Email'),
270        required = False,
271        constraint=validate_email,
272        )
273
274class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit):
275    """Interface for editing personal data by students.
276    """
277
278    parent_email = schema.ASCIILine(
279        title = _(u'Parent Email'),
280        required = False,
281        constraint=validate_email,
282        )
283
284class ICustomUGStudentClearance(INigeriaUGStudentClearance):
285    """Representation of ug student clearance data.
286    """
287
288class ICustomPGStudentClearance(INigeriaPGStudentClearance):
289    """Representation of pg student clearance data.
290    """
291
292class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance,
293    ICustomPGStudentClearance, ICustomStudentPersonal, IMedicalHistory,
294    ITiship, INYSC):
295    """Representation of a student.
296    """
297
298class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
299    """A container for student study levels.
300    """
301
302class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
303    """A container for course tickets.
304    """
305
306class ICustomStudentOnlinePayment(ICustomOnlinePayment):
307    """A student payment via payment gateways.
308
309    This Interface does not inherit from IStudentOnlinePayment.
310    Thus all fields from IStudentOnlinePayment have to be repeated here.
311    """
312
313    p_current = schema.Bool(
314        title = _(u'Current Session Payment'),
315        default = True,
316        required = False,
317        )
318
319    p_level = schema.Choice(
320        title = _(u'Payment Level'),
321        source = StudyLevelSource(),
322        required = False,
323        )
324
325    staff_rebate = schema.Bool(
326        title = _(u'Staff Rebate Payment'),
327        default = False,
328        required = False,
329        )
330
331    rebate_amount = schema.Float(
332        title = _(u'Rebate'),
333        default = 0.0,
334        required = False,
335        readonly = False,
336        )
337
338ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
339    'p_session'].order
340
341class ICustomCourseTicket(INigeriaCourseTicket):
342    """A course ticket.
343    """
344
345    grading_sys = schema.Choice(
346        title = _(u'Grading System'),
347        source = GradingSystemSource(),
348        required = True,
349        default = 'A',
350        )
351
352class ICustomCourseTicketImport(ICustomCourseTicket):
353    """An interface for importing course results and nothing more.
354    """
355
356    score = schema.Int(
357        title = _(u'Score'),
358        required = False,
359        readonly = False,
360        )
361
362    level_session = schema.Choice(
363        title = _(u'Level Session'),
364        source = academic_sessions_vocab,
365        required = False,
366        readonly = False,
367        )
368
369    grading_sys = schema.Choice(
370        title = _(u'Grading System'),
371        source = GradingSystemSource(),
372        required = False,
373        default = 'A',
374        )
375
376class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
377    """Representation of a student. Skip regular reg_number validation.
378    """
379
380class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
381    """Representation of a student. Skip regular matric_number validation.
382    """
Note: See TracBrowser for help on using the repository browser.