source: main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py @ 15404

Last change on this file since 15404 was 15371, checked in by Henrik Bettermann, 5 years ago

Implement a library access switch.

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
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##
18
19from zope import schema
20from waeup.kofa.interfaces import validate_email
21from waeup.kofa.students.vocabularies import StudyLevelSource
22from kofacustom.nigeria.students.interfaces import (
23    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
24    INigeriaStudentPersonal, INigeriaStudentPersonalEdit,
25    INigeriaStudentStudyLevel,
26    INigeriaStudentStudyCourse, INigeriaCourseTicket,
27    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
28    )
29from waeup.uniben.payments.interfaces import ICustomOnlinePayment
30from waeup.uniben.interfaces import MessageFactory as _
31
32class ICustomStudentBase(INigeriaStudentBase):
33    """Representation of student base data.
34    """
35
36    library = schema.Bool(
37        title = _(u'Library Id Card'),
38        default = False,
39        required = False,
40        )
41
42class ICustomStudentPersonal(INigeriaStudentPersonal):
43    """Student personal data.
44    """
45
46    parent_email = schema.ASCIILine(
47        title = _(u'Parent Email'),
48        required = False,
49        constraint=validate_email,
50        )
51
52class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit):
53    """Interface for editing personal data by students.
54    """
55
56    parent_email = schema.ASCIILine(
57        title = _(u'Parent Email'),
58        required = False,
59        constraint=validate_email,
60        )
61
62class ICustomUGStudentClearance(INigeriaUGStudentClearance):
63    """Representation of ug student clearance data.
64    """
65
66class ICustomPGStudentClearance(INigeriaPGStudentClearance):
67    """Representation of pg student clearance data.
68    """
69
70class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance,
71    ICustomPGStudentClearance, ICustomStudentPersonal):
72    """Representation of a student.
73    """
74
75class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
76    """A container for student study levels.
77    """
78
79class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
80    """A container for course tickets.
81    """
82
83class ICustomStudentOnlinePayment(ICustomOnlinePayment):
84    """A student payment via payment gateways.
85
86    This Interface does not inherit from IStudentOnlinePayment.
87    Thus all fields from IStudentOnlinePayment have to be repeated here.
88    """
89
90    p_current = schema.Bool(
91        title = _(u'Current Session Payment'),
92        default = True,
93        required = False,
94        )
95
96    p_level = schema.Choice(
97        title = _(u'Payment Level'),
98        source = StudyLevelSource(),
99        required = False,
100        )
101
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
115ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
116    'p_session'].order
117
118class ICustomCourseTicket(INigeriaCourseTicket):
119    """A course ticket.
120    """
121
122class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
123    """Representation of a student. Skip regular reg_number validation.
124    """
125
126class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
127    """Representation of a student. Skip regular matric_number validation.
128    """
Note: See TracBrowser for help on using the repository browser.