[7505] | 1 | ## $Id: interfaces.py 15371 2019-03-25 17:59:03Z 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 | |
---|
[8865] | 42 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
[7618] | 43 | """Student personal data. |
---|
[13085] | 44 | """ |
---|
[7618] | 45 | |
---|
[13085] | 46 | parent_email = schema.ASCIILine( |
---|
| 47 | title = _(u'Parent Email'), |
---|
| 48 | required = False, |
---|
| 49 | constraint=validate_email, |
---|
| 50 | ) |
---|
| 51 | |
---|
| 52 | class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit): |
---|
| 53 | """Interface for editing personal data by students. |
---|
[7618] | 54 | """ |
---|
| 55 | |
---|
[12856] | 56 | parent_email = schema.ASCIILine( |
---|
| 57 | title = _(u'Parent Email'), |
---|
| 58 | required = False, |
---|
| 59 | constraint=validate_email, |
---|
| 60 | ) |
---|
| 61 | |
---|
[8865] | 62 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
[7995] | 63 | """Representation of ug student clearance data. |
---|
[7505] | 64 | """ |
---|
| 65 | |
---|
[8865] | 66 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
[7995] | 67 | """Representation of pg student clearance data. |
---|
[7505] | 68 | """ |
---|
| 69 | |
---|
[12856] | 70 | class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance, |
---|
| 71 | ICustomPGStudentClearance, ICustomStudentPersonal): |
---|
[7995] | 72 | """Representation of a student. |
---|
[7505] | 73 | """ |
---|
[8247] | 74 | |
---|
[8865] | 75 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
[8326] | 76 | """A container for student study levels. |
---|
| 77 | """ |
---|
| 78 | |
---|
[8865] | 79 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
[8326] | 80 | """A container for course tickets. |
---|
| 81 | """ |
---|
| 82 | |
---|
[8866] | 83 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
[8247] | 84 | """A student payment via payment gateways. |
---|
| 85 | |
---|
[8866] | 86 | This Interface does not inherit from IStudentOnlinePayment. |
---|
| 87 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
[8270] | 88 | """ |
---|
| 89 | |
---|
[9152] | 90 | p_current = schema.Bool( |
---|
| 91 | title = _(u'Current Session Payment'), |
---|
| 92 | default = True, |
---|
| 93 | required = False, |
---|
| 94 | ) |
---|
| 95 | |
---|
[13741] | 96 | p_level = schema.Choice( |
---|
[8866] | 97 | title = _(u'Payment Level'), |
---|
[13741] | 98 | source = StudyLevelSource(), |
---|
[8866] | 99 | required = False, |
---|
| 100 | ) |
---|
| 101 | |
---|
[14853] | 102 | staff_rebate = schema.Bool( |
---|
| 103 | title = _(u'Staff Rebate Payment'), |
---|
| 104 | default = False, |
---|
| 105 | required = False, |
---|
| 106 | ) |
---|
| 107 | |
---|
| 108 | rebate_amount = schema.Float( |
---|
| 109 | title = _(u'Rebate'), |
---|
| 110 | default = 0.0, |
---|
| 111 | required = False, |
---|
| 112 | readonly = False, |
---|
| 113 | ) |
---|
| 114 | |
---|
[8866] | 115 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
| 116 | 'p_session'].order |
---|
| 117 | |
---|
[8865] | 118 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
[8326] | 119 | """A course ticket. |
---|
[8582] | 120 | """ |
---|
| 121 | |
---|
[8865] | 122 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
[8582] | 123 | """Representation of a student. Skip regular reg_number validation. |
---|
| 124 | """ |
---|
| 125 | |
---|
[8865] | 126 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
[8582] | 127 | """Representation of a student. Skip regular matric_number validation. |
---|
| 128 | """ |
---|