[7505] | 1 | ## $Id: interfaces.py 16088 2020-05-11 07:50:40Z 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 | ## |
---|
[8865] | 18 | |
---|
[8866] | 19 | from zope import schema |
---|
[12856] | 20 | from waeup.kofa.interfaces import validate_email |
---|
[13741] | 21 | from waeup.kofa.students.vocabularies import StudyLevelSource |
---|
[8865] | 22 | from kofacustom.nigeria.students.interfaces import ( |
---|
| 23 | INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, |
---|
[13085] | 24 | INigeriaStudentPersonal, INigeriaStudentPersonalEdit, |
---|
| 25 | INigeriaStudentStudyLevel, |
---|
[8865] | 26 | INigeriaStudentStudyCourse, INigeriaCourseTicket, |
---|
| 27 | INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo, |
---|
[7505] | 28 | ) |
---|
[8866] | 29 | from waeup.uniben.payments.interfaces import ICustomOnlinePayment |
---|
| 30 | from waeup.uniben.interfaces import MessageFactory as _ |
---|
[7505] | 31 | |
---|
[8865] | 32 | class ICustomStudentBase(INigeriaStudentBase): |
---|
[7618] | 33 | """Representation of student base data. |
---|
[7505] | 34 | """ |
---|
[7618] | 35 | |
---|
[15371] | 36 | library = schema.Bool( |
---|
| 37 | title = _(u'Library Id Card'), |
---|
| 38 | default = False, |
---|
| 39 | required = False, |
---|
| 40 | ) |
---|
| 41 | |
---|
[16088] | 42 | email2 = schema.ASCIILine( |
---|
| 43 | title = _(u'Institution Email'), |
---|
| 44 | required = False, |
---|
| 45 | constraint=validate_email, |
---|
| 46 | ) |
---|
| 47 | |
---|
| 48 | ICustomStudentBase['email2'].order = ICustomStudentBase[ |
---|
| 49 | 'phone'].order |
---|
| 50 | ICustomStudentBase['phone'].order = ICustomStudentBase[ |
---|
| 51 | 'email'].order |
---|
| 52 | |
---|
[8865] | 53 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
[7618] | 54 | """Student personal data. |
---|
[13085] | 55 | """ |
---|
[7618] | 56 | |
---|
[13085] | 57 | parent_email = schema.ASCIILine( |
---|
| 58 | title = _(u'Parent Email'), |
---|
| 59 | required = False, |
---|
| 60 | constraint=validate_email, |
---|
| 61 | ) |
---|
| 62 | |
---|
| 63 | class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit): |
---|
| 64 | """Interface for editing personal data by students. |
---|
[7618] | 65 | """ |
---|
| 66 | |
---|
[12856] | 67 | parent_email = schema.ASCIILine( |
---|
| 68 | title = _(u'Parent Email'), |
---|
| 69 | required = False, |
---|
| 70 | constraint=validate_email, |
---|
| 71 | ) |
---|
| 72 | |
---|
[8865] | 73 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
[7995] | 74 | """Representation of ug student clearance data. |
---|
[7505] | 75 | """ |
---|
| 76 | |
---|
[8865] | 77 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
[7995] | 78 | """Representation of pg student clearance data. |
---|
[7505] | 79 | """ |
---|
| 80 | |
---|
[12856] | 81 | class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance, |
---|
| 82 | ICustomPGStudentClearance, ICustomStudentPersonal): |
---|
[7995] | 83 | """Representation of a student. |
---|
[7505] | 84 | """ |
---|
[8247] | 85 | |
---|
[8865] | 86 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
[8326] | 87 | """A container for student study levels. |
---|
| 88 | """ |
---|
| 89 | |
---|
[8865] | 90 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
[8326] | 91 | """A container for course tickets. |
---|
| 92 | """ |
---|
| 93 | |
---|
[8866] | 94 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
[8247] | 95 | """A student payment via payment gateways. |
---|
| 96 | |
---|
[8866] | 97 | This Interface does not inherit from IStudentOnlinePayment. |
---|
| 98 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
[8270] | 99 | """ |
---|
| 100 | |
---|
[9152] | 101 | p_current = schema.Bool( |
---|
| 102 | title = _(u'Current Session Payment'), |
---|
| 103 | default = True, |
---|
| 104 | required = False, |
---|
| 105 | ) |
---|
| 106 | |
---|
[13741] | 107 | p_level = schema.Choice( |
---|
[8866] | 108 | title = _(u'Payment Level'), |
---|
[13741] | 109 | source = StudyLevelSource(), |
---|
[8866] | 110 | required = False, |
---|
| 111 | ) |
---|
| 112 | |
---|
[14853] | 113 | staff_rebate = schema.Bool( |
---|
| 114 | title = _(u'Staff Rebate Payment'), |
---|
| 115 | default = False, |
---|
| 116 | required = False, |
---|
| 117 | ) |
---|
| 118 | |
---|
| 119 | rebate_amount = schema.Float( |
---|
| 120 | title = _(u'Rebate'), |
---|
| 121 | default = 0.0, |
---|
| 122 | required = False, |
---|
| 123 | readonly = False, |
---|
| 124 | ) |
---|
| 125 | |
---|
[8866] | 126 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
| 127 | 'p_session'].order |
---|
| 128 | |
---|
[8865] | 129 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
[8326] | 130 | """A course ticket. |
---|
[8582] | 131 | """ |
---|
| 132 | |
---|
[8865] | 133 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
[8582] | 134 | """Representation of a student. Skip regular reg_number validation. |
---|
| 135 | """ |
---|
| 136 | |
---|
[8865] | 137 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
[8582] | 138 | """Representation of a student. Skip regular matric_number validation. |
---|
| 139 | """ |
---|