source: main/waeup.fceokene/trunk/src/waeup/fceokene/students/interfaces.py @ 18122

Last change on this file since 18122 was 18067, checked in by Henrik Bettermann, 3 months ago

Add JAMB registration number and NIN.

  • Property svn:keywords set to Id
File size: 8.1 KB
Line 
1## $Id: interfaces.py 18067 2025-04-24 01:07:30Z 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.schema import FormattedDate, PhoneNumber
21from waeup.kofa.students.interfaces import IUGStudentClearance
22from waeup.kofa.students.vocabularies import nats_vocab, StudyLevelSource
23from waeup.kofa.schoolgrades import ResultEntryField
24from kofacustom.nigeria.interfaces import (
25    high_qual, high_grade, exam_types, LGASource)
26from kofacustom.nigeria.students.interfaces import (
27    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
28    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
29    INigeriaStudentStudyCourse, INigeriaCourseTicket,
30    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
31    )
32from waeup.fceokene.payments.interfaces import ICustomOnlinePayment
33from waeup.fceokene.interfaces import MessageFactory as _
34
35class ICustomStudentBase(INigeriaStudentBase):
36    """Representation of student base data.
37
38    """
39
40class ICustomStudentPersonal(INigeriaStudentPersonal):
41    """Student personal data.
42
43    """
44
45class ICustomUGStudentClearance(IUGStudentClearance):
46    """Representation of ug student clearance data.
47
48    Completely customized for FCE Okene.
49
50    """
51
52    officer_comment = schema.Text(
53        title = _(u"Officer's Comment"),
54        required = False,
55        )
56
57    clearance_locked = schema.Bool(
58        title = _(u'Clearance form locked'),
59        default = False,
60        required = False,
61        )
62
63    clr_code = schema.TextLine(
64        title = _(u'CLR Activation Code'),
65        required = False,
66        readonly = False,
67        )
68
69    date_of_birth = FormattedDate(
70        title = _(u'Date of Birth'),
71        required = False,
72        show_year = True,
73        )
74
75    nationality = schema.Choice(
76        source = nats_vocab,
77        title = _(u'Nationality'),
78        required = True,
79        )
80
81    lga = schema.Choice(
82        source = LGASource(),
83        title = _(u'State/LGA (Nigerians only)'),
84        required = False,
85        )
86
87    def_adm = schema.Bool(
88        title = _(u'Deferent of Admission'),
89        required = False,
90        readonly = False,
91        )
92    jamb_reg_number = schema.TextLine(
93        title = _(u'JAMB Registration Number'),
94        required = False,
95        readonly = False,
96        )
97
98    nin = schema.Int(
99        title = _(u'National Identity Number (NIN)'),
100        required = False,
101        readonly = False,
102        min=10000000000,
103        max=99999999999,
104        )
105
106    fst_sit_fname = schema.TextLine(
107        title = _(u'Full Name'),
108        required = False,
109        readonly = False,
110        )
111    fst_sit_no = schema.TextLine(
112        title = _(u'Exam Number'),
113        required = False,
114        readonly = False,
115        )
116
117    fst_sit_date = FormattedDate(
118        title = _(u'Exam Date'),
119        required = False,
120        readonly = False,
121        show_year = True,
122        )
123
124    fst_sit_type = schema.Choice(
125        title = _(u'Exam Type'),
126        required = False,
127        readonly = False,
128        vocabulary = exam_types,
129        )
130
131    fst_sit_results = schema.List(
132        title = _(u'Exam Results'),
133        value_type = ResultEntryField(),
134        required = False,
135        readonly = False,
136        defaultFactory=list,
137        )
138
139    scd_sit_fname = schema.TextLine(
140        title = _(u'Full Name'),
141        required = False,
142        readonly = False,
143        )
144    scd_sit_no = schema.TextLine(
145        title = _(u'Exam Number'),
146        required = False,
147        readonly = False,
148        )
149
150    scd_sit_date = FormattedDate(
151        title = _(u'Exam Date'),
152        required = False,
153        readonly = False,
154        show_year = True,
155        )
156
157    scd_sit_type = schema.Choice(
158        title = _(u'Exam Type'),
159        required = False,
160        readonly = False,
161        vocabulary = exam_types,
162        )
163
164    scd_sit_results = schema.List(
165        title = _(u'Exam Results'),
166        value_type = ResultEntryField(),
167        required = False,
168        readonly = False,
169        defaultFactory=list,
170        )
171
172    #alr_fname = schema.TextLine(
173    #    title = _(u'Full Name'),
174    #    required = False,
175    #    readonly = False,
176    #    )
177
178    #alr_no = schema.TextLine(
179    #    title = _(u'Exam Number'),
180    #    required = False,
181    #    readonly = False,
182    #    )
183
184    #alr_date = FormattedDate(
185    #    title = _(u'Exam Date'),
186    #    required = False,
187    #    readonly = False,
188    #    show_year = True,
189    #    )
190
191    #alr_results = schema.List(
192    #    title = _(u'Exam Results'),
193    #    value_type = ResultEntryField(),
194    #    required = False,
195    #    readonly = False,
196    #    defaultFactory=list,
197    #    )
198
199    hq_type = schema.Choice(
200        title = _(u'Qualification Obtained'),
201        required = False,
202        readonly = False,
203        vocabulary = high_qual,
204        )
205
206    hq_fname = schema.TextLine(
207        title = _(u'Full Name'),
208        required = False,
209        readonly = False,
210        )
211
212    hq_matric_no = schema.TextLine(
213        title = _(u'Former Matric Number'),
214        required = False,
215        readonly = False,
216        )
217
218    #hq_degree = schema.Choice(
219    #    title = _(u'Class of Degree'),
220    #    required = False,
221    #    readonly = False,
222    #    vocabulary = high_grade,
223    #    )
224
225    hq_school = schema.TextLine(
226        title = _(u'Institution Attended'),
227        required = False,
228        readonly = False,
229        )
230
231    hq_session = schema.TextLine(
232        title = _(u'Years Attended'),
233        required = False,
234        readonly = False,
235        )
236
237    hq_disc = schema.TextLine(
238        title = _(u'Course Combination'),
239        required = False,
240        readonly = False,
241        )
242
243class ICustomPGStudentClearance(INigeriaPGStudentClearance):
244    """Representation of pg student clearance data.
245
246    """
247
248
249class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
250    ICustomPGStudentClearance,ICustomStudentPersonal):
251    """Representation of a student.
252
253    """
254
255class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
256    """A container for student study levels.
257
258    """
259
260class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
261    """A container for course tickets.
262
263    """
264
265    total_credits_s1 = schema.Int(
266        title = _(u'1st Semester Credits'),
267        required = False,
268        )
269
270    total_credits_s2 = schema.Int(
271        title = _(u'2nd Semester Credits'),
272        required = False,
273        )
274
275    total_credits = schema.Int(
276        title = _(u'Total Credits'),
277        required = False,
278        )
279
280class ICustomStudentOnlinePayment(ICustomOnlinePayment):
281    """A student payment via payment gateways.
282
283    This Interface does not inherit from IStudentOnlinePayment.
284    Thus all fields from IStudentOnlinePayment have to be repeated here.
285    """
286
287    p_current = schema.Bool(
288        title = _(u'Current Session Payment'),
289        default = True,
290        required = False,
291        )
292
293    p_level = schema.Choice(
294        title = _(u'Payment Level'),
295        source = StudyLevelSource(),
296        required = False,
297        )
298
299ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
300    'p_session'].order
301
302class ICustomCourseTicket(INigeriaCourseTicket):
303    """A course ticket.
304
305    """
306
307class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
308    """Representation of a student. Skip regular reg_number validation.
309
310    """
311
312class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
313    """Representation of a student. Skip regular matric_number validation.
314
315    """
Note: See TracBrowser for help on using the repository browser.