[10765] | 1 | ## $Id: interfaces.py 15704 2019-10-28 07:12:20Z 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 | |
---|
| 42 | ICustomStudentBase['email2'].order = ICustomStudentBase[ |
---|
| 43 | 'phone'].order |
---|
| 44 | ICustomStudentBase['phone'].order = ICustomStudentBase[ |
---|
| 45 | 'email'].order |
---|
| 46 | |
---|
[10765] | 47 | class ICustomStudentPersonal(INigeriaStudentPersonal): |
---|
| 48 | """Student personal data. |
---|
| 49 | |
---|
| 50 | """ |
---|
| 51 | |
---|
| 52 | class ICustomUGStudentClearance(INigeriaUGStudentClearance): |
---|
| 53 | """Representation of ug student clearance data. |
---|
| 54 | |
---|
| 55 | """ |
---|
| 56 | |
---|
| 57 | class ICustomPGStudentClearance(INigeriaPGStudentClearance): |
---|
| 58 | """Representation of pg student clearance data. |
---|
| 59 | |
---|
| 60 | """ |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance, |
---|
| 64 | ICustomPGStudentClearance,ICustomStudentPersonal): |
---|
| 65 | """Representation of a student. |
---|
| 66 | |
---|
| 67 | """ |
---|
| 68 | |
---|
| 69 | class ICustomStudentStudyCourse(INigeriaStudentStudyCourse): |
---|
| 70 | """A container for student study levels. |
---|
| 71 | |
---|
| 72 | """ |
---|
| 73 | |
---|
| 74 | class ICustomStudentStudyLevel(INigeriaStudentStudyLevel): |
---|
| 75 | """A container for course tickets. |
---|
| 76 | |
---|
| 77 | """ |
---|
| 78 | |
---|
| 79 | class ICustomStudentOnlinePayment(ICustomOnlinePayment): |
---|
| 80 | """A student payment via payment gateways. |
---|
| 81 | |
---|
| 82 | This Interface does not inherit from IStudentOnlinePayment. |
---|
| 83 | Thus all fields from IStudentOnlinePayment have to be repeated here. |
---|
| 84 | """ |
---|
| 85 | |
---|
| 86 | p_current = schema.Bool( |
---|
| 87 | title = _(u'Current Session Payment'), |
---|
| 88 | default = True, |
---|
| 89 | required = False, |
---|
| 90 | ) |
---|
| 91 | |
---|
[13740] | 92 | p_level = schema.Choice( |
---|
[10765] | 93 | title = _(u'Payment Level'), |
---|
[13740] | 94 | source = StudyLevelSource(), |
---|
[10765] | 95 | required = False, |
---|
| 96 | ) |
---|
| 97 | |
---|
| 98 | ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[ |
---|
| 99 | 'p_session'].order |
---|
| 100 | |
---|
| 101 | class ICustomCourseTicket(INigeriaCourseTicket): |
---|
| 102 | """A course ticket. |
---|
| 103 | |
---|
| 104 | """ |
---|
| 105 | |
---|
| 106 | class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): |
---|
| 107 | """Representation of a student. Skip regular reg_number validation. |
---|
| 108 | |
---|
| 109 | """ |
---|
| 110 | |
---|
| 111 | class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo): |
---|
| 112 | """Representation of a student. Skip regular matric_number validation. |
---|
| 113 | |
---|
| 114 | """ |
---|