## $Id: interfaces.py 14591 2017-02-25 17:59:16Z henrik $ ## ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## from zope import schema from waeup.kofa.schema import FormattedDate, PhoneNumber from waeup.kofa.students.interfaces import IUGStudentClearance from waeup.kofa.students.vocabularies import nats_vocab, StudyLevelSource from waeup.kofa.schoolgrades import ResultEntryField from kofacustom.nigeria.interfaces import ( high_qual, high_grade, exam_types, LGASource) from kofacustom.nigeria.students.interfaces import ( INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, INigeriaStudentPersonal, INigeriaStudentStudyLevel, INigeriaStudentStudyCourse, INigeriaCourseTicket, INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo, ) from waeup.fceokene.payments.interfaces import ICustomOnlinePayment from waeup.fceokene.interfaces import MessageFactory as _ class ICustomStudentBase(INigeriaStudentBase): """Representation of student base data. """ class ICustomStudentPersonal(INigeriaStudentPersonal): """Student personal data. """ class ICustomUGStudentClearance(IUGStudentClearance): """Representation of ug student clearance data. Completely customized for FCE Okene. """ officer_comment = schema.Text( title = _(u"Officer's Comment"), required = False, ) clearance_locked = schema.Bool( title = _(u'Clearance form locked'), default = False, required = False, ) clr_code = schema.TextLine( title = _(u'CLR Activation Code'), required = False, readonly = False, ) date_of_birth = FormattedDate( title = _(u'Date of Birth'), required = False, show_year = True, ) nationality = schema.Choice( source = nats_vocab, title = _(u'Nationality'), required = True, ) lga = schema.Choice( source = LGASource(), title = _(u'State/LGA (Nigerians only)'), required = False, ) def_adm = schema.Bool( title = _(u'Deferent of Admission'), required = False, readonly = False, ) fst_sit_fname = schema.TextLine( title = _(u'Full Name'), required = False, readonly = False, ) fst_sit_no = schema.TextLine( title = _(u'Exam Number'), required = False, readonly = False, ) fst_sit_date = FormattedDate( title = _(u'Exam Date'), required = False, readonly = False, show_year = True, ) fst_sit_type = schema.Choice( title = _(u'Exam Type'), required = False, readonly = False, vocabulary = exam_types, ) fst_sit_results = schema.List( title = _(u'Exam Results'), value_type = ResultEntryField(), required = False, readonly = False, defaultFactory=list, ) scd_sit_fname = schema.TextLine( title = _(u'Full Name'), required = False, readonly = False, ) scd_sit_no = schema.TextLine( title = _(u'Exam Number'), required = False, readonly = False, ) scd_sit_date = FormattedDate( title = _(u'Exam Date'), required = False, readonly = False, show_year = True, ) scd_sit_type = schema.Choice( title = _(u'Exam Type'), required = False, readonly = False, vocabulary = exam_types, ) scd_sit_results = schema.List( title = _(u'Exam Results'), value_type = ResultEntryField(), required = False, readonly = False, defaultFactory=list, ) #alr_fname = schema.TextLine( # title = _(u'Full Name'), # required = False, # readonly = False, # ) #alr_no = schema.TextLine( # title = _(u'Exam Number'), # required = False, # readonly = False, # ) #alr_date = FormattedDate( # title = _(u'Exam Date'), # required = False, # readonly = False, # show_year = True, # ) #alr_results = schema.List( # title = _(u'Exam Results'), # value_type = ResultEntryField(), # required = False, # readonly = False, # defaultFactory=list, # ) hq_type = schema.Choice( title = _(u'Qualification Obtained'), required = False, readonly = False, vocabulary = high_qual, ) hq_fname = schema.TextLine( title = _(u'Full Name'), required = False, readonly = False, ) hq_matric_no = schema.TextLine( title = _(u'Former Matric Number'), required = False, readonly = False, ) #hq_degree = schema.Choice( # title = _(u'Class of Degree'), # required = False, # readonly = False, # vocabulary = high_grade, # ) hq_school = schema.TextLine( title = _(u'Institution Attended'), required = False, readonly = False, ) hq_session = schema.TextLine( title = _(u'Years Attended'), required = False, readonly = False, ) hq_disc = schema.TextLine( title = _(u'Course Combination'), required = False, readonly = False, ) class ICustomPGStudentClearance(INigeriaPGStudentClearance): """Representation of pg student clearance data. """ class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance, ICustomPGStudentClearance,ICustomStudentPersonal): """Representation of a student. """ class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): """A container for student study levels. """ class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): """A container for course tickets. """ total_credits_s1 = schema.Int( title = _(u'1st Semester Credits'), required = False, ) total_credits_s2 = schema.Int( title = _(u'2nd Semester Credits'), required = False, ) total_credits = schema.Int( title = _(u'Total Credits'), required = False, ) class ICustomStudentOnlinePayment(ICustomOnlinePayment): """A student payment via payment gateways. This Interface does not inherit from IStudentOnlinePayment. Thus all fields from IStudentOnlinePayment have to be repeated here. """ p_current = schema.Bool( title = _(u'Current Session Payment'), default = True, required = False, ) p_level = schema.Choice( title = _(u'Payment Level'), source = StudyLevelSource(), required = False, ) ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ 'p_session'].order class ICustomCourseTicket(INigeriaCourseTicket): """A course ticket. """ class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): """Representation of a student. Skip regular reg_number validation. """ class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): """Representation of a student. Skip regular matric_number validation. """