[10765] | 1 | ## $Id: interfaces.py 15859 2019-11-28 08:21:23Z 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 | |
---|
| 19 | from zope import schema |
---|
[13740] | 20 | from waeup.kofa.students.vocabularies import StudyLevelSource |
---|
[15704] | 21 | from waeup.kofa.interfaces import validate_email |
---|
[10765] | 22 | from kofacustom.nigeria.students.interfaces import ( |
---|
| 23 | INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, |
---|
| 24 | INigeriaStudentPersonal, INigeriaStudentStudyLevel, |
---|
| 25 | INigeriaStudentStudyCourse, INigeriaCourseTicket, |
---|
| 26 | INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo, |
---|
| 27 | ) |
---|
[15563] | 28 | from kofacustom.iuokada.payments.interfaces import ICustomOnlinePayment |
---|
| 29 | from kofacustom.iuokada.interfaces import MessageFactory as _ |
---|
[10765] | 30 | |
---|
| 31 | class ICustomStudentBase(INigeriaStudentBase): |
---|
| 32 | """Representation of student base data. |
---|
| 33 | |
---|
| 34 | """ |
---|
| 35 | |
---|
[15704] | 36 | email2 = schema.ASCIILine( |
---|
| 37 | title = _(u'Second Email'), |
---|
| 38 | required = False, |
---|
| 39 | constraint=validate_email, |
---|
| 40 | ) |
---|
| 41 | |
---|
[15859] | 42 | library = schema.Bool( |
---|
| 43 | title = _(u'Library Id Card'), |
---|
| 44 | default = False, |
---|
| 45 | required = False, |
---|
| 46 | ) |
---|
| 47 | |
---|
[15704] | 48 | ICustomStudentBase['email2'].order = ICustomStudentBase[ |
---|
| 49 | 'phone'].order |
---|
| 50 | ICustomStudentBase['phone'].order = ICustomStudentBase[ |
---|
| 51 | 'email'].order |
---|
| 52 | |
---|
[10765] | 53 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
| 54 | """Student personal data. |
---|
| 55 | |
---|
| 56 | """ |
---|
| 57 | |
---|
| 58 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
| 59 | """Representation of ug student clearance data. |
---|
| 60 | |
---|
| 61 | """ |
---|
| 62 | |
---|
| 63 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
| 64 | """Representation of pg student clearance data. |
---|
| 65 | |
---|
| 66 | """ |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance, |
---|
| 70 | ICustomPGStudentClearance,ICustomStudentPersonal): |
---|
| 71 | """Representation of a student. |
---|
| 72 | |
---|
| 73 | """ |
---|
| 74 | |
---|
| 75 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
| 76 | """A container for student study levels. |
---|
| 77 | |
---|
| 78 | """ |
---|
| 79 | |
---|
| 80 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
| 81 | """A container for course tickets. |
---|
| 82 | |
---|
| 83 | """ |
---|
| 84 | |
---|
| 85 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
| 86 | """A student payment via payment gateways. |
---|
| 87 | |
---|
| 88 | This Interface does not inherit from IStudentOnlinePayment. |
---|
| 89 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
| 90 | """ |
---|
| 91 | |
---|
| 92 | p_current = schema.Bool( |
---|
| 93 | title = _(u'Current Session Payment'), |
---|
| 94 | default = True, |
---|
| 95 | required = False, |
---|
| 96 | ) |
---|
| 97 | |
---|
[13740] | 98 | p_level = schema.Choice( |
---|
[10765] | 99 | title = _(u'Payment Level'), |
---|
[13740] | 100 | source = StudyLevelSource(), |
---|
[10765] | 101 | required = False, |
---|
| 102 | ) |
---|
| 103 | |
---|
| 104 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
| 105 | 'p_session'].order |
---|
| 106 | |
---|
| 107 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
| 108 | """A course ticket. |
---|
| 109 | |
---|
| 110 | """ |
---|
| 111 | |
---|
| 112 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
| 113 | """Representation of a student. Skip regular reg_number validation. |
---|
| 114 | |
---|
| 115 | """ |
---|
| 116 | |
---|
| 117 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
| 118 | """Representation of a student. Skip regular matric_number validation. |
---|
| 119 | |
---|
| 120 | """ |
---|